about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Kirszenberg <alexandre@amo.co>2025-03-10 10:43:28 +0100
committerAlex Kirszenberg <alexandre@amo.co>2025-03-10 11:56:50 +0100
commit680e6f35bcd3f23b9f98e05a3c193405bb69c510 (patch)
treefafa5b511b9b8eae4f28c6c6693d1ca3e25c0699 /src
parent52f39ffe8320955868ce03eb22d9020c568472da (diff)
downloadrust-680e6f35bcd3f23b9f98e05a3c193405bb69c510.tar.gz
rust-680e6f35bcd3f23b9f98e05a3c193405bb69c510.zip
Fix diagnostics being cleared right after being received
Diffstat (limited to 'src')
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
index 7529e7c188f..dd510325806 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
@@ -401,7 +401,9 @@ impl FlycheckActor {
                             package_id = package_id.as_ref().map(|it| &it.repr),
                             "diagnostic received"
                         );
-                        self.diagnostics_received = DiagnosticsReceived::Yes;
+                        if self.diagnostics_received == DiagnosticsReceived::No {
+                            self.diagnostics_received = DiagnosticsReceived::Yes;
+                        }
                         if let Some(package_id) = &package_id {
                             if self.diagnostics_cleared_for.insert(package_id.clone()) {
                                 tracing::trace!(