usethesource / rascal-language-servers

An LSP server for Rascal which includes an easy-to-use LSP generator for languages implemented in Rascal, and an interactive terminal REPL.
BSD 2-Clause "Simplified" License
10 stars 7 forks source link

Provide a clear error message when project is configured incorrectly in VS Code #330

Closed PieterOlivier closed 9 months ago

PieterOlivier commented 9 months ago

When a new user does not follow the correct project initialization procedure (as explained in https://www.rascal-mpl.org/docs/GettingStarted/CreateNewProject/), the Rascal extension seems to work at first. But when you click on "Import in new Rascal terminal" nothing happens and no error message is shown.

To help a new user getting started, it would help a lot if a clear error message was displayed in this case.

Also, for a user who installed Rascal by installing the Rascal VS Code extension, it is not clear how to run the Rascal REPL to follow the steps in https://www.rascal-mpl.org/docs/GettingStarted/CreateNewProject/. The location of rascal-<version>.jar (as referred to in https://www.rascal-mpl.org/docs/GettingStarted/RunningRascal/) is hard to find in this case.

jurgenvinju commented 9 months ago

Both improve the docs and improve the error messages. I think if we put the error in the file on the module name this would help.

DavyLandman commented 9 months ago

I think if you click "import in terminal" we should try and detect common problems as well.

jurgenvinju commented 9 months ago

I like this feature, but it is yet more typescript code while we could also have solved this in pure Rascal. Let's merge it for now, but I'd like to see a missing project setup reported as an error in the module, and as a lense command to help fix it. Both could be a part of the Rascal code for the LSP implementation.

DavyLandman commented 9 months ago

I assume this was a comment on the PR?

jurgenvinju commented 9 months ago

Yes. I'd like to see these features implemented in Rascal. There is a growing collection of typescript code that is not easily ported to other IDEs. In general, a strategy could be to implement anything on the other side of the LSP where possible, in the interest of portability.