-
Notifications
You must be signed in to change notification settings - Fork 330
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
Errors aren't being reported on scala-cli scripts runs #5820
Comments
Thanks for reporting! The issue here is that this is all handled on the VS Code side to make it faster. We could possibly invoke compile first and check for errors, but that might be much slower. Anyway we might need to do that at some point. |
Vs code reports problems in the workspace (aka compile errors) could these be tracked to prevent run? (As long as they are actual compile errors and not those scalameta/bloop errors that are inaccurate) |
That's one option, yeah. Would need to be fixed in vs code plugin itself. |
I don't think it's achievable to do it in the client. There might be errors in other build targets (e.g. tests) which are unrelated, the client wouldn't be able to tell which files belong to which build target. We could simply not show run/debug code lenses when the code doesn't compile. |
We would need to run refresh code lense on error, which would make these disappear. We could also make VS Code run save before running anything and that should wait for the compilation. |
Just checked and it seems just running save is not enough, we would need a |
Code lenses depend on semanticdb, we might need to rethink that or try to improve semanticdb support, since it's very easily breakable. But apart from code lenses, you can always just use the built in run functionality, it will run anything from the current file. Adding and additional button would be redundant in that case. |
Describe the bug
When I use the "run" functionality of Metals in VS Code to run a scala-cli script with error, it doesn't show any error but silently re-runs the last version of the script it was able to compile successfully.
Screen.Recording.2023-11-08.at.14.50.22.mov
Expected behavior
Should emit an error instead of re-running the last successful compilation result.
Operating system
Windows
Editor/Extension
VS Code
Version of Metals
v1.1.0
Extra context or search terms
No response
The text was updated successfully, but these errors were encountered: