Skip to content
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

x/tools/gopls: support textDocument/diagnostic #60122

Open
findleyr opened this issue May 10, 2023 · 0 comments
Open

x/tools/gopls: support textDocument/diagnostic #60122

findleyr opened this issue May 10, 2023 · 0 comments
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

Comments

@findleyr
Copy link
Member

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

@findleyr findleyr added this to the gopls/later milestone May 10, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. Documentation Issues describing a change to documentation. labels May 10, 2023
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

3 participants