-
Notifications
You must be signed in to change notification settings - Fork 949
[BSP] Send diagnostics and meaningful error message when reloading fails #6566
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
Conversation
@adpi2 I feel like locally I'm doing something wrong when testing this out with Metals.
I can't seem to get the diagnostics to publish. I do see that it attaches to the new snapshot (I even bumped the version up in sbt to ensure I was really getting a fresh version). BSP logs
I do get a whole bunch of
So I thought maybe that was causing some issues, but even removing the |
From the logs it seems you don't have the snapshot running. Because the following message does not exist anymore (in this PR):
When you change the sbt version in the
If it is still not working you can try to clean the |
Fixes sbt#6010: Send real error message when realod failed
721d955
to
a923905
Compare
Since build.sbt is compiled/evaluated in `sbt.compiler.Eval`, this commit introduces a `BuildServerEvalReporter` to redirect the compiler errors to the BSP clients. A new `finalReport` method is added in the new `EvalReporter` base class to reset the old diagnostics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about Scaladoc, but other than that LGTM
Could you run scalafmt please? |
Fix #6010 and address scalameta/metals-feature-requests#143 (comment) (@ckipp01)
It should be probably merged after #6553 to avoid conflicts.
Just as #6553, merging this PR depends on whether we decide to break the binary compatibility of
PluginData
or not. In which case it would probably goes to sbt 1.6.In order of commits:
bspReload
command to catch the exceptions and fill the error response with the correct messageBuildServerEvalReporter
to send diagnostics when evaluating.sbt
filesworkspace/reload
requestIn action within Metals, it looks like this: