From c27d8e0c7a66cfc2ad32d7bd17267e5d85d74956 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Tue, 16 Sep 2025 21:58:24 -0400 Subject: [PATCH] editor: Don't pull diagnostics on excerpts change in diagnostics editors (#38212) This can lead to an infinite regress when using a language server that supports pull diagnostics, since the excerpts for the diagnostics editor are set based on the project's diagnostics. Closes #36772 Release Notes: - Fixed a bug that could cause duplicated diagnostics with some language servers. --- crates/editor/src/editor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 00ae0bcbac1e49e193739ed8b8af77a8c02dc845..8f69efe30ef9f3be5f95b49162bb57baa43346dc 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -20549,7 +20549,9 @@ impl Editor { ) .detach(); } - self.update_lsp_data(false, Some(buffer_id), window, cx); + if self.active_diagnostics != ActiveDiagnostic::All { + self.update_lsp_data(false, Some(buffer_id), window, cx); + } cx.emit(EditorEvent::ExcerptsAdded { buffer: buffer.clone(), predecessor: *predecessor,