mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Use autoreload config to gate execution rather that staleness
This commit is contained in:
parent
3698b3eab8
commit
e3c47ccefc
@ -454,7 +454,9 @@ impl GlobalState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.fetch_workspaces_if_needed();
|
if self.config.cargo_autoreload() {
|
||||||
|
self.fetch_workspaces_if_needed();
|
||||||
|
}
|
||||||
self.fetch_build_data_if_needed();
|
self.fetch_build_data_if_needed();
|
||||||
|
|
||||||
let loop_duration = loop_start.elapsed();
|
let loop_duration = loop_start.elapsed();
|
||||||
@ -494,7 +496,10 @@ impl GlobalState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RequestDispatcher { req: Some(req), global_state: self }
|
RequestDispatcher { req: Some(req), global_state: self }
|
||||||
.on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| Ok(s.fetch_workspaces_request()))?
|
.on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| {
|
||||||
|
self.fetch_workspaces_request();
|
||||||
|
self.fetch_workspaces_if_needed();
|
||||||
|
})?
|
||||||
.on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))?
|
.on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))?
|
||||||
.on_sync::<lsp_ext::OnEnter>(|s, p| handlers::handle_on_enter(s.snapshot(), p))?
|
.on_sync::<lsp_ext::OnEnter>(|s, p| handlers::handle_on_enter(s.snapshot(), p))?
|
||||||
.on_sync::<lsp_types::request::Shutdown>(|s, ()| {
|
.on_sync::<lsp_types::request::Shutdown>(|s, ()| {
|
||||||
|
@ -60,11 +60,7 @@ impl GlobalState {
|
|||||||
", "
|
", "
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if self.config.cargo_autoreload() {
|
self.fetch_workspaces_request();
|
||||||
self.fetch_workspaces_request();
|
|
||||||
} else {
|
|
||||||
self.transition(Status::NeedsReload);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn is_interesting(path: &AbsPath, change_kind: ChangeKind) -> bool {
|
fn is_interesting(path: &AbsPath, change_kind: ChangeKind) -> bool {
|
||||||
const IMPLICIT_TARGET_FILES: &[&str] = &["build.rs", "src/main.rs", "src/lib.rs"];
|
const IMPLICIT_TARGET_FILES: &[&str] = &["build.rs", "src/main.rs", "src/lib.rs"];
|
||||||
|
Loading…
Reference in New Issue
Block a user