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.

Do not add diagnostics for any selection in the diagnostics panel

Kirill Bulatovd38a2b793ec1
diff --git a/assets/settings/default.json b/assets/settings/default.json
index 9a6c7587d62..42f3b312866 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -209,7 +209,7 @@
"ensure_final_newline_on_save": true,
// Whether or not to perform a buffer format before saving
"format_on_save": "on",
- // How to perform a buffer format. This setting can take two values:
+ // How to perform a buffer format. This setting can take 4 values:
//
// 1. Format code using the current language server:
// "formatter": "language_server"
diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs
index e794771434a..4748f63e5d3 100644
--- a/crates/diagnostics/src/diagnostics.rs
+++ b/crates/diagnostics/src/diagnostics.rs
@@ -171,10 +171,9 @@ impl ProjectDiagnosticsEditor {
.entry(*language_server_id)
.or_default()
.insert(path.clone());
- let no_multiselections = this.editor.update(cx, |editor, cx| {
- editor.selections.all::<usize>(cx).len() <= 1
- });
- if no_multiselections && !this.is_dirty(cx) {
+ if this.editor.read(cx).selections.all::<usize>(cx).is_empty()
+ && !this.is_dirty(cx)
+ {
this.update_excerpts(Some(*language_server_id), cx);
}
}