From 089542c6f4c8132fb8f095c21c5a735b745c5355 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 7 Jan 2022 10:33:21 +0100 Subject: [PATCH] Avoid removing diagnostics from `Worktree` after opening a buffer This allows re-opening the same buffer and supplying the previous diagnostics. --- crates/project/src/worktree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rs index 6108e9eb108a0f170e5056702b00db78a1f0c166..843a775993ccc1b4f9a9486ba2f4953c6a2c4cac 100644 --- a/crates/project/src/worktree.rs +++ b/crates/project/src/worktree.rs @@ -1267,7 +1267,7 @@ impl LocalWorktree { let (diagnostics, language, language_server) = this.update(&mut cx, |this, cx| { let this = this.as_local_mut().unwrap(); - let diagnostics = this.diagnostics.remove(&path); + let diagnostics = this.diagnostics.get(&path).cloned(); let language = this .language_registry .select_language(file.full_path())