-
Notifications
You must be signed in to change notification settings - Fork 46
[fix] clean up previous diagnostics | #BAZEL-376 Done #381
[fix] clean up previous diagnostics | #BAZEL-376 Done #381
Conversation
0da3821
to
92e5dbf
Compare
According to the BSP specification build-server-protocol/build-server-protocol#484 BSP servers must publish `build/publishDiagnostics` with an empty array of of diagnostics to clean up previous diagnostics. However, bazel-bsp didn't publish `build/publishDiagnostics` if build completed without errors or warnings, and as a result, BSP clients such as BSP clients such as `scalameta/metals` couldn't clear previous diagnostics. due to missing notifications. With this commit, bazel-bsp will publish `build/publishDiagnostics` with with an empty array of diagnostics if the build was successful. https://youtrack.jetbrains.com/issue/BAZEL-376
92e5dbf
to
5242fc4
Compare
if it's not suuuuuper urgent, i'd postpone this PR / close it - at the moment we are working on a complete migration to BEP and prob we will address this issue as well |
Sure, I'm fine with postponing this PR as it's not super urgent 👍 (just out of curiosity, what "complete migration to BEP" entails? It seems like most BSP notifications are already translated from BEP like a However, I'd like to bring to your attention that there is a number of users awaiting the Bazel integration, and this feature is crucial for enabling that support. While we understand that the migration to BEP might address this issue, it would be greatly appreciated if the team could prioritize this feature in the upcoming efforts. Anyway, thank you for your work / review on bazel-bsp :) This paved the way for Bazel integration from Metals. |
that's actually the only notification xd in general i believe that we will change the way how we process events, so prob we will change the way how this feature should be implemented; on top of that i believe that we actually dont need a global state of it ( |
Got it, thanks! Do you have a rough idea of how long it takes to refactor on BEP? If it takes a long time, we may want to implement a workaround on the BSP client (scalameta/metals) side to clear up former diagnostics. (e.g., clear up previous diagnostics on build/taskFinish with errors=0) 👍
I introduced the state (to manage which files had issues in previous builds) to reduce the number of notifications sent from the BSP server to the client. However, the BSP client (and possibly the server too) would experience a significant CPU load when processing a large number of I'm not sure if BEP has information on whether a target previously had problems, but if it doesn't, some form of build state might be needed to reduce the communication load between the BSP server and client. |
ohh right i completely forgot that there is no "wildcard"
prob it doesnt : / |
Maybe "wildcard" would be good to have in BSP 😄 |
we should deliver it next week, so i'll wait with the review here |
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.
unfortunately the bep change (ae52b8f) didnt make it easier : (
some nitpicking from my side
server/src/main/java/org/jetbrains/bsp/bazel/server/diagnostics/DiagnosticsService.kt
Show resolved
Hide resolved
commons/src/main/java/org/jetbrains/bsp/bazel/commons/BspCompileState.kt
Outdated
Show resolved
Hide resolved
server/src/test/java/org/jetbrains/bsp/bazel/server/diagnostics/DiagnosticsServiceTest.kt
Show resolved
Hide resolved
server/src/main/java/org/jetbrains/bsp/bazel/server/diagnostics/DiagnosticsService.kt
Outdated
Show resolved
Hide resolved
server/src/main/java/org/jetbrains/bsp/bazel/server/diagnostics/DiagnosticsService.kt
Outdated
Show resolved
Hide resolved
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.
sorry for such long waiting time, last few weeks were veeery busy - looks nice just 2 questions / nitpicking
server/src/main/java/org/jetbrains/bsp/bazel/server/diagnostics/DiagnosticsService.kt
Show resolved
Hide resolved
server/src/main/java/org/jetbrains/bsp/bazel/server/diagnostics/DiagnosticsService.kt
Outdated
Show resolved
Hide resolved
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.
lil thing and we can merge i think
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 a lot and sorry for the delay
According to the BSP specification build-server-protocol/build-server-protocol#484 BSP servers must publish
build/publishDiagnostics
with an empty array of of diagnostics to clean up previous diagnostics.However, bazel-bsp didn't publish
build/publishDiagnostics
if build completed without errors or warnings, and as a result, BSP clients such asscalameta/metals
couldn't clear previous diagnostics. due to missing notifications.With this commit, bazel-bsp will publish
build/publishDiagnostics
with with an empty array of diagnostics if the build was successful.https://youtrack.jetbrains.com/issue/BAZEL-376