Refresh diagnostics inside the tab

This commit is contained in:
Kirill Bulatov 2023-11-03 18:33:17 +02:00
parent c529343ba1
commit 9cb8ce172d
5 changed files with 10 additions and 3 deletions

View file

@ -20,6 +20,7 @@ theme = { path = "../theme" }
util = { path = "../util" }
workspace = { path = "../workspace" }
log.workspace = true
anyhow.workspace = true
schemars.workspace = true
serde.workspace = true

View file

@ -151,6 +151,7 @@ impl ProjectDiagnosticsEditor {
) -> Self {
cx.subscribe(&project_handle, |this, _, event, cx| match event {
project::Event::DiskBasedDiagnosticsFinished { language_server_id } => {
log::debug!("Disk based diagnostics finished for server {language_server_id}");
this.update_excerpts(Some(*language_server_id), cx);
this.update_title(cx);
}
@ -158,8 +159,11 @@ impl ProjectDiagnosticsEditor {
language_server_id,
path,
} => {
log::debug!("Adding path {path:?} to update for server {language_server_id}");
this.paths_to_update
.insert((path.clone(), *language_server_id));
this.update_excerpts(Some(*language_server_id), cx);
this.update_title(cx);
}
_ => {}
})
@ -229,6 +233,7 @@ impl ProjectDiagnosticsEditor {
language_server_id: Option<LanguageServerId>,
cx: &mut ViewContext<Self>,
) {
log::debug!("Updating excerpts for server {language_server_id:?}");
let mut paths = Vec::new();
self.paths_to_update.retain(|(path, server_id)| {
if language_server_id