-
Notifications
You must be signed in to change notification settings - Fork 950
fix: publish BSP diagnostics when it's necessary #6929
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
main/src/main/scala/sbt/internal/server/BuildServerReporter.scala
Outdated
Show resolved
Hide resolved
@kpodsiad You can add a test in https://github.com/sbt/sbt/blob/1.7.x/server-test/src/test/scala/testpkg/BuildServerTest.scala If you need to change a file in the project, to have different diagnostics you can do something like that: sbt/server-test/src/test/scala/testpkg/BuildServerTest.scala Lines 256 to 263 in f816aed
|
main/src/main/scala/sbt/internal/server/BuildServerReporter.scala
Outdated
Show resolved
Hide resolved
main/src/main/scala/sbt/internal/server/BuildServerReporter.scala
Outdated
Show resolved
Hide resolved
3a0dfe3
to
4730317
Compare
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.
There is still one bug with the warnings. Also I think there are some more reports that could be avoided.
main/src/main/scala/sbt/internal/server/BuildServerReporter.scala
Outdated
Show resolved
Hide resolved
@adpi2 I found interesting behavior (it's already present, tested on 1.6.2). Lets have files
Not sure if it's a bug or feature, however Bloop doesn't clear the warning. |
* do not publish bsp diagnostics if there were and there are no problems * publish diagnostics if problems needs to be updated
4730317
to
e8d60ef
Compare
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.
Thanks @kpodsiad for fixing this! I also appreciate the refactoring in the BuildServerTest
.
You are right about the strange behavior of warnings that disappear and then re-appear again. This is a small bug that is not critical. We will probably be able to fix it by storing more information about previous compilation in the BspCompileState
class. I suggest we do that in a separate PR.
[1.7.x] Backport #6929: Fix publishing BSP diagnostics
continues effort of #6847, closes #6896
@adpi2 do you have an idea how to write test for this PR which will cover #6896?