Skip to content

Commit c9fdc48

Browse files
committed
Add identifier to pull diagnostic LSP capabilities
This field in the server capabilities instructs the client to maintain the diagnostics received from a `textDocument/diagnostic` pull request as a separate set from other diagnostics: namely those sent with classic "push" diagnostics, `textDocument/publishDiagnostic`. rust-analyzer emits "native" diagnostics (computed by rust-analyzer itself) in pull diagnostics and separately emits cargo-based diagnostics with push, so push and pull diagnostics should be different sets. Setting this field instructs the client to avoid clearing push diagnostics when new pull diagnostics arrive and vice versa.
1 parent 7273d71 commit c9fdc48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/rust-analyzer/src/lsp/capabilities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub fn server_capabilities(config: &Config) -> ServerCapabilities {
165165
})),
166166
diagnostic_provider: Some(lsp_types::DiagnosticServerCapabilities::Options(
167167
lsp_types::DiagnosticOptions {
168-
identifier: None,
168+
identifier: Some("rust-analyzer".to_owned()),
169169
inter_file_dependencies: true,
170170
// FIXME
171171
workspace_diagnostics: false,

0 commit comments

Comments
 (0)