From e02b3ec9cc9de8c6d0dceadcef7870d29e4bd0ae Mon Sep 17 00:00:00 2001 From: David Barsky Date: Mon, 6 Jan 2025 18:33:19 -0500 Subject: [PATCH] fix: clear diagnostics on cancel unconditionally, fixing #18854 --- src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 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 bed49c7a6d66..a306302cc0eb 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs @@ -419,9 +419,9 @@ impl FlycheckActor { command_handle.cancel(); self.command_receiver.take(); self.report_progress(Progress::DidCancel); - self.diagnostics_cleared_for.clear(); - self.diagnostics_received = false; } + self.diagnostics_cleared_for.clear(); + self.diagnostics_received = false; } /// Construct a `Command` object for checking the user's code. If the user