Skip to content

Commit

Permalink
rust-analyzer/main_loop: simplify workspace discovery at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
bobozaur committed Nov 6, 2024
1 parent 44a97eb commit 1ff4e8d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/rust-analyzer/src/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 },
Expand Down

0 comments on commit 1ff4e8d

Please sign in to comment.