Update diagnostics indicator when diagnostics are udpated

Kirill Bulatov created

Change summary

crates/diagnostics/src/items.rs | 4 ++++
crates/project/src/project.rs   | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)

Detailed changes

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

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,