diff options
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 9 | ||||
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index ae364f862..7e96f3c4a 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -454,7 +454,9 @@ impl GlobalState { | |||
454 | } | 454 | } |
455 | } | 455 | } |
456 | 456 | ||
457 | self.fetch_workspaces_if_needed(); | 457 | if self.config.cargo_autoreload() { |
458 | self.fetch_workspaces_if_needed(); | ||
459 | } | ||
458 | self.fetch_build_data_if_needed(); | 460 | self.fetch_build_data_if_needed(); |
459 | 461 | ||
460 | let loop_duration = loop_start.elapsed(); | 462 | let loop_duration = loop_start.elapsed(); |
@@ -494,7 +496,10 @@ impl GlobalState { | |||
494 | } | 496 | } |
495 | 497 | ||
496 | RequestDispatcher { req: Some(req), global_state: self } | 498 | RequestDispatcher { req: Some(req), global_state: self } |
497 | .on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| Ok(s.fetch_workspaces_request()))? | 499 | .on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| { |
500 | self.fetch_workspaces_request(); | ||
501 | self.fetch_workspaces_if_needed(); | ||
502 | })? | ||
498 | .on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))? | 503 | .on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))? |
499 | .on_sync::<lsp_ext::OnEnter>(|s, p| handlers::handle_on_enter(s.snapshot(), p))? | 504 | .on_sync::<lsp_ext::OnEnter>(|s, p| handlers::handle_on_enter(s.snapshot(), p))? |
500 | .on_sync::<lsp_types::request::Shutdown>(|s, ()| { | 505 | .on_sync::<lsp_types::request::Shutdown>(|s, ()| { |
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index a8ae56070..5ff60c22a 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -60,11 +60,7 @@ impl GlobalState { | |||
60 | ", " | 60 | ", " |
61 | ) | 61 | ) |
62 | ); | 62 | ); |
63 | if self.config.cargo_autoreload() { | 63 | self.fetch_workspaces_request(); |
64 | self.fetch_workspaces_request(); | ||
65 | } else { | ||
66 | self.transition(Status::NeedsReload); | ||
67 | } | ||
68 | 64 | ||
69 | fn is_interesting(path: &AbsPath, change_kind: ChangeKind) -> bool { | 65 | fn is_interesting(path: &AbsPath, change_kind: ChangeKind) -> bool { |
70 | const IMPLICIT_TARGET_FILES: &[&str] = &["build.rs", "src/main.rs", "src/lib.rs"]; | 66 | const IMPLICIT_TARGET_FILES: &[&str] = &["build.rs", "src/main.rs", "src/lib.rs"]; |