Allow LSP adapters to decide, which diagnostics to underline (#31450)

Closes
https://github.com/zed-industries/zed/pull/31355#issuecomment-2910439798

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/2eaa8e9b-00bc-4e99-ac09-fceb2d932e41"
/>


Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov
2025-05-26 22:19:02 +03:00
committed by GitHub
parent 4c396bcc91
commit 4567360fd9
9 changed files with 53 additions and 5 deletions
@@ -1255,6 +1255,8 @@ pub struct Chunk<'a> {
pub diagnostic_severity: Option<lsp::DiagnosticSeverity>,
/// Whether this chunk of text is marked as unnecessary.
pub is_unnecessary: bool,
/// Whether this chunk of text should be underlined.
pub underline: bool,
/// Whether this chunk of text was originally a tab character.
pub is_tab: bool,
/// An optional recipe for how the chunk should be presented.
@@ -1422,6 +1424,7 @@ impl<'a> Iterator for FoldChunks<'a> {
diagnostic_severity: chunk.diagnostic_severity,
is_unnecessary: chunk.is_unnecessary,
is_tab: chunk.is_tab,
underline: chunk.underline,
renderer: None,
});
}