Document diagnostics report not used when text document closed
See original GitHub issueUsing language client 8.0.2-next.5
. The server supports pull document diagnostics, but not workspace diagnostics.
The client (correctly) sends textDocument/diagnostic
to pull a new report when a file is closed (i.e., is no longer managed).
However, the returned report by the server is not then used by the client - the old diagnostics still remain.
In my case, I want to clear the diagnostics of some files when they are closed / no longer managed, but this does not happen.
Minimal example: https://github.com/JohnnyMorganz/pull-diagnostics-bug
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JohnnyMorganz You should looking into using workspace diagnostics
Understandable that the client should be controlling when it shows diagnostics. I guess my main ask would be is there any way of controlling this as a user, not necessarily as a server?
I feel like its quite important, as a user, that some diagnostics should be made available even when the file is closed (https://github.com/microsoft/vscode/issues/13953 shows the importance of this for js/ts), whilst other files can be ignored. It seems that this is something wanted by other servers too (https://github.com/microsoft/vscode-languageserver-node/issues/848#issuecomment-652858418), where there are cases for errors to only be shown whilst a file is open for some (not necessarily all) files
Maybe this is out of scope for this repository/issue though. Its probably also possible to control this once we implement workspace diagnostics, unless that is also not really recommended there.
EDIT: maybe this could be something configurable by a predicate in DiagnosticPullOptions on the client? e.g. as an extension to
filter(document, mode)
, further including some sort of info about the state (open/closed)