From d38a2b793ec1b625f30589fa5a4875772bf16d57 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 10 Nov 2023 13:35:58 +0200 Subject: [PATCH] Do not add diagnostics for any selection in the diagnostics panel --- assets/settings/default.json | 2 +- crates/diagnostics/src/diagnostics.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 9a6c7587d6..42f3b31286 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 e794771434..4748f63e5d 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::(cx).len() <= 1 - }); - if no_multiselections && !this.is_dirty(cx) { + if this.editor.read(cx).selections.all::(cx).is_empty() + && !this.is_dirty(cx) + { this.update_excerpts(Some(*language_server_id), cx); } }