From df7f755e3b08e58a30bdbb39685bea76be7762ba Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 4 Aug 2022 14:01:33 +0200 Subject: [PATCH] Don't flycheck while the workspace is being loaded --- crates/rust-analyzer/src/diagnostics.rs | 1 - crates/rust-analyzer/src/global_state.rs | 1 + crates/rust-analyzer/src/main_loop.rs | 5 ++++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/rust-analyzer/src/diagnostics.rs b/crates/rust-analyzer/src/diagnostics.rs index 7917ced666a..09150c77d7d 100644 --- a/crates/rust-analyzer/src/diagnostics.rs +++ b/crates/rust-analyzer/src/diagnostics.rs @@ -72,7 +72,6 @@ pub(crate) fn add_check_diagnostic( let check_fixes = Arc::make_mut(&mut self.check_fixes); check_fixes.entry(flycheck_id).or_default().entry(file_id).or_default().extend(fix); diagnostics.push(diagnostic); - tracing::warn!(?flycheck_id, ?file_id, "add_check_diagnostic changes pushed"); self.changes.insert(file_id); } diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 2cd2044aeff..55c4cfcf860 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -192,6 +192,7 @@ pub(crate) fn process_changes(&mut self) -> bool { if let Some(path) = vfs.file_path(file.file_id).as_path() { let path = path.to_path_buf(); if reload::should_refresh_for_change(&path, file.change_kind) { + tracing::warn!("fetch-fiel_change"); self.fetch_workspaces_queue .request_op(format!("vfs file change: {}", path.display())); } diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 5c93874ca2a..4ed34df01ca 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -447,7 +447,10 @@ fn handle_event(&mut self, event: Event) -> Result<()> { let memdocs_added_or_removed = self.mem_docs.take_changes(); if self.is_quiescent() { - if !was_quiescent { + if !was_quiescent + && !self.fetch_workspaces_queue.op_requested() + && !self.fetch_build_data_queue.op_requested() + { for flycheck in &self.flycheck { flycheck.update(); } -- 2.44.0