From 1ff4e8d6140b0fb8deb890a803609df3eec98c2d Mon Sep 17 00:00:00 2001 From: Bogdan Mircea Date: Wed, 6 Nov 2024 16:39:50 +0200 Subject: [PATCH] rust-analyzer/main_loop: simplify workspace discovery at startup --- crates/rust-analyzer/src/main_loop.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 0420defe5c5f..19b822ecae7f 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -176,8 +176,6 @@ impl GlobalState { self.register_did_save_capability(additional_patterns); } - let mut ran_startup_discovery = false; - if let Some(cfg) = self.config.discover_workspace_config() { if cfg.run_at_startup && !self.discover_workspace_queue.op_in_progress() { // the clone is unfortunately necessary to avoid a borrowck error when @@ -192,12 +190,10 @@ impl GlobalState { let handle = discover.spawn(None).unwrap(); self.discover_handle = Some(handle); - - ran_startup_discovery = true; } } - if self.config.discover_workspace_config().is_none() || ran_startup_discovery { + if self.config.discover_workspace_config().is_none() { self.fetch_workspaces_queue.request_op( "startup".to_owned(), FetchWorkspaceRequest { path: None, force_crate_graph_reload: false },