Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect rascal commands only intended for code-lenses from regular user invocation. #220

Closed
djswagerman opened this issue Jan 3, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@djswagerman
Copy link

The option “Start Rascal Terminal and import this module”, gives the error “Command 'Start Rascal Terminal and Import this module' resulted in an error (command 'rascalmpl.importMain' not found)”.

Steps to reproduce the behavior:

  1. Open empty folder
  2. Create folder src/demo
  3. Create file 'hello.rsc' in this folder with the following content:
    module demo::basic::Hello
    import IO;

void hello() {
println("Hello world, this is my second Rascal program!");
}
4. Type CMD+SHIFT+P and choose option "Start Rascal Terminal and import this module"

This create the error

Expected behavior
A rascal terminal should be opened with the module module demo::basic::Hello imported and ready to use.

Screenshots

Screenshot 2023-01-03 at 12 26 45

Stack traces
Toggle developer option did not result in any additional information.

Desktop (please complete the following information):

  • Visual Studio code Version: 1.74.2
  • Rascal plugin version v0.6.0
  • Mac Ventura
  • Apple M1 Max
  • JDK Temurin 11

Additional context
Add any other context about the problem here.

@djswagerman djswagerman added the bug Something isn't working label Jan 3, 2023
@djswagerman djswagerman changed the title In Visual Studio code Version: 1.74.2, rascal plugin version v0.6.0 on Mac Ventura , the option “Start Rascal Terminal and import this module”, gives the error “Command 'Start Rascal Terminal and Import this module' resulted in an error (command 'rascalmpl.importMain' not found)”. The option “Start Rascal Terminal and import this module”, gives the error “Command 'Start Rascal Terminal and Import this module' resulted in an error (command 'rascalmpl.importMain' not found)”. Jan 3, 2023
@DavyLandman
Copy link
Member

This command should not be run via cmd+shift+p. We should detect this happening and give a better message. Normally you should see a small code-lens pop-up above the main method. As follows:

image

Clicking any of these is the desired interaction of this command.

@DavyLandman DavyLandman changed the title The option “Start Rascal Terminal and import this module”, gives the error “Command 'Start Rascal Terminal and Import this module' resulted in an error (command 'rascalmpl.importMain' not found)”. Protect rascal commands only intended for code-lenses from regular user invocation. Jan 4, 2023
@DavyLandman
Copy link
Member

@yami2200 fixed this in #279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants