Skip to content

Commit

Permalink
Add identifier to pull diagnostic LSP capabilities
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
the-mikedavis committed Mar 2, 2025
1 parent 7273d71 commit c9fdc48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/lsp/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pub fn server_capabilities(config: &Config) -> ServerCapabilities {
})),
diagnostic_provider: Some(lsp_types::DiagnosticServerCapabilities::Options(
lsp_types::DiagnosticOptions {
identifier: None,
identifier: Some("rust-analyzer".to_owned()),
inter_file_dependencies: true,
// FIXME
workspace_diagnostics: false,
Expand Down

0 comments on commit c9fdc48

Please sign in to comment.