Avoid removing diagnostics from Worktree after opening a buffer

This allows re-opening the same buffer and supplying the previous
diagnostics.
This commit is contained in:
Antonio Scandurra 2022-01-07 10:33:21 +01:00
parent 67f672d0cc
commit 089542c6f4

View file

@ -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())