x/tools/gopls: resend diagnostics for changed files #54983
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
In #50267, I added a (hidden)
chattyDiagnostics
option to gopls that publishes diagnostics on each change to a file, even if the diagnostics have not changed.In practice, this doesn't seem to matter for VS Code has eliminated some cases where certain vim and emacs LSP clients get confused.
For example, from empirical observation coc.nvim seems to be subject to the following race. In pseudo-LSP (
->
is client->server,<-
is server->client):If the client observes (4) and (5) in the opposite order, it skips the diagnostics from 4 as they relate to a stale version. Then gopls never publishes another set of diagnostics (because it thinks the last published diagnostics are valid), and the client still shows "something bad".
Simply always publishing diagnostics after changes has fixed this problem, so we should make this the default behavior.
The text was updated successfully, but these errors were encountered: