-
Notifications
You must be signed in to change notification settings - Fork 132
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
clear diagnostics on close document #1135
Conversation
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 for fixing this!
It seems that CI is blocking merge. Can you take a look at it? thanks! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1135 +/- ##
==========================================
- Coverage 81.25% 81.19% -0.06%
==========================================
Files 29 29
Lines 1408 1409 +1
Branches 334 334
==========================================
Hits 1144 1144
- Misses 217 218 +1
Partials 47 47 ☔ View full report in Codecov by Sentry. |
curious to ask: how such 'clear' helped? |
Quote from lsp specification
clear here usually means send empty diagnostics (i.e. AFAIK, bash-lsp currently does not have very much project system concept, so it's resonable to clear diagnostics. If server does not clear diagnostics, the diagnostics will live forever in client's UI, even after user has deleted the file, util user restart the extension host. This is kind of annoying, in my opinon. Here's a video illustration: Screen.Recording.2024-05-03.at.23.29.52.mov |
the problem or question is send [] to client seems useless since/if that file had been closed or even burden since hanlder needed to ACK it.
perhaps other kinds `clear` which server side only then maybe helpful/useful.
// I cannot see/open your video for now.
…--
shane.xb.qian
|
Does sending [] to client not clear diagnostics on your side? That works well on my side. Here's a illustration: (I'm using vscode version 1.89.0 with bash-lsp on main 81125b8) Screen.Recording.2024-05-04.at.00.45.41.movP.S. this clear diagnostics behavior might be different among different editors, since they implement language client differently. If there are any cross-client compatible methods to clear diagnostics, i'd like to hear. |
i am seeing your video now, i think it's probably not a problem, |
@skovhus so did you plan to keep this, or actually it should be a vscode option to hide it (if there was one) ? |
I haven’t seen this causing any harm. Have you? |
i felt it sent fake |
Currently, bash-language-server does not clear diagnostics when user close an document. This causes bad user experience.
This PR fixes this problem, it makes sure that server clear diagnostics when document was closed