Do not underline unnecessary diagnostics (#31355)

Closes
https://github.com/zed-industries/zed/pull/31229#issuecomment-2906946881

Follow
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticTag

> Clients are allowed to render diagnostics with this tag faded out
instead of having an error squiggle.

and do not underline any unnecessary diagnostic at all.

Release Notes:

- Fixed clangd's inactive regions diagnostics excessive highlights
This commit is contained in:
Kirill Bulatov 2025-05-24 23:08:46 +03:00 committed by GitHub
parent 6f918ed99b
commit 20a0956fb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 40 deletions

View file

@ -492,7 +492,7 @@ pub struct Diff {
pub edits: Vec<(Range<usize>, Arc<str>)>,
}
#[derive(Clone, Copy)]
#[derive(Debug, Clone, Copy)]
pub(crate) struct DiagnosticEndpoint {
offset: usize,
is_start: bool,
@ -4592,7 +4592,7 @@ impl<'a> Iterator for BufferChunks<'a> {
syntax_highlight_id: highlight_id,
diagnostic_severity: self.current_diagnostic_severity(),
is_unnecessary: self.current_code_is_unnecessary(),
..Default::default()
..Chunk::default()
})
} else {
None