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

Controlling workspace/diagnostic/refresh #18424

Closed
alanz opened this issue Oct 28, 2024 · 0 comments · Fixed by #18432
Closed

Controlling workspace/diagnostic/refresh #18424

alanz opened this issue Oct 28, 2024 · 0 comments · Fixed by #18432
Labels
A-lsp LSP conformance issues and missing features Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug E-easy

Comments

@alanz
Copy link
Contributor

alanz commented Oct 28, 2024

rust-analyzer version: rust-analyzer 0.3.2162-standalone (3b3a87f 2024-10-27)
rustc version: rustc 1.81.0 (eeb90cda1 2024-09-04)
editor or extension: emacs lsp-mode
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
repository link (if public, optional): rust-analyzer)

When pull diagnostics were introduced in LSP there was no specific client configuration to enable them, since it is up to the client to pull them.

Pull diagnostics are not currently implemented emacs lsp-mode.
This week's RA release enabled pull diagnostics, together with workspace/diagnostic/refresh, which originates from the server. This server request should be gated by

/**
 * Workspace client capabilities specific to diagnostic pull requests.
 *
 * @since 3.17.0
 */
export interface [DiagnosticWorkspaceClientCapabilities](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticWorkspaceClientCapabilities) {
	/**
	 * Whether the client implementation supports a refresh request sent from
	 * the server to the client.
	 *
	 * Note that this event is global and will force the client to refresh all
	 * pulled diagnostics currently shown. It should be used with absolute care
	 * and is useful for situation where a server for example detects a project
	 * wide change that requires such a calculation.
	 */
	refreshSupport?: boolean;
}

but is currently gated on the mere presence of the textDocument.diagnostics client config. (via

let supports_diagnostic_pull_model = self.config.text_document_diagnostic();
)

So this decision should be made based on workspace.diagnostice.refreshSupport instead.

Related: emacs-lsp/lsp-mode#4570

@alanz alanz added the C-bug Category: bug label Oct 28, 2024
@Veykril Veykril added A-lsp LSP conformance issues and missing features E-easy Broken Window Bugs / technical debt to be addressed immediately labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lsp LSP conformance issues and missing features Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug E-easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants