Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Update diagnostics indicator when diagnostics are udpated

Kirill Bulatov803ab81eb6e1
diff --git a/crates/diagnostics/src/items.rs b/crates/diagnostics/src/items.rs
index c3733018b67..8d3c2fedd6d 100644
--- a/crates/diagnostics/src/items.rs
+++ b/crates/diagnostics/src/items.rs
@@ -38,6 +38,10 @@ impl DiagnosticIndicator {
this.in_progress_checks.remove(language_server_id);
cx.notify();
}
+ project::Event::DiagnosticsUpdated { .. } => {
+ this.summary = project.read(cx).diagnostic_summary(cx);
+ cx.notify();
+ }
_ => {}
})
.detach();
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs
index f9e1b1ce960..e3251d74835 100644
--- a/crates/project/src/project.rs
+++ b/crates/project/src/project.rs
@@ -2934,8 +2934,8 @@ impl Project {
move |mut params, mut cx| {
let this = this;
let adapter = adapter.clone();
- adapter.process_diagnostics(&mut params);
if let Some(this) = this.upgrade(&cx) {
+ adapter.process_diagnostics(&mut params);
this.update(&mut cx, |this, cx| {
this.update_diagnostics(
server_id,