x/tools/gopls: support textDocument/diagnostic #60122
Labels
Documentation
Issues describing a change to documentation.
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls commands use a
gopls/diagnoseFiles
"non standard request" to implement file diagnostics for commands and testing. Unfortunately, this still publishes diagnostics asynchronously, and so suffers from syncronization problems (e.g. #59475).There is now a
textDocument/diagnostic
LSP method that does exactly what we want: return diagnostics for a requested file. We should implement this method and use it instead.Furthermore, we should remove support for non-standard requests.
workspace/executeCommand
is a better extensibility mechanism.Implementing
textDocument/diagnostic
should be done with some care: if we advertise this capability, some clients may start requesting diagnostics rather than letting gopls compute them asynchronously. This may have lifecycle and performance implications.CC @adonovan
The text was updated successfully, but these errors were encountered: