Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't show squiggles on unnecesarry code (#32082)

Conrad Irwin6de37fa57c76
diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs
index a2fdb4c05c0..67eea538495 100644
--- a/crates/editor/src/display_map.rs
+++ b/crates/editor/src/display_map.rs
@@ -961,7 +961,10 @@ impl DisplaySnapshot {
if chunk.is_unnecessary {
diagnostic_highlight.fade_out = Some(editor_style.unnecessary_code_fade);
}
- if chunk.underline && editor_style.show_underlines {
+ if chunk.underline
+ && editor_style.show_underlines
+ && !(chunk.is_unnecessary && severity > lsp::DiagnosticSeverity::WARNING)
+ {
let diagnostic_color = super::diagnostic_style(severity, &editor_style.status);
diagnostic_highlight.underline = Some(UnderlineStyle {
color: Some(diagnostic_color),