Skip to content

Commit 27abd4a

Browse files
bors[bot]kiljacken
andauthored
Merge #2824
2824: Defer cargo check until after workspace load r=kiljacken a=kiljacken Fixes #2822 Co-authored-by: Emil Lauridsen <[email protected]>
2 parents 5621f90 + c774850 commit 27abd4a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

crates/ra_cargo_watch/src/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,13 @@ impl CheckWatcherState {
184184
workspace_root: PathBuf,
185185
shared: Arc<RwLock<CheckWatcherSharedState>>,
186186
) -> CheckWatcherState {
187-
let watcher = WatchThread::new(&options, &workspace_root);
188-
CheckWatcherState { options, workspace_root, watcher, last_update_req: None, shared }
187+
CheckWatcherState {
188+
options,
189+
workspace_root,
190+
watcher: WatchThread::dummy(),
191+
last_update_req: None,
192+
shared,
193+
}
189194
}
190195

191196
fn run(&mut self, task_send: &Sender<CheckTask>, cmd_recv: &Receiver<CheckCommand>) {
@@ -313,6 +318,10 @@ enum CheckEvent {
313318
}
314319

315320
impl WatchThread {
321+
fn dummy() -> WatchThread {
322+
WatchThread { handle: None, message_recv: never() }
323+
}
324+
316325
fn new(options: &CheckOptions, workspace_root: &PathBuf) -> WatchThread {
317326
let mut args: Vec<String> = vec![
318327
options.command.clone(),

crates/ra_lsp_server/src/main_loop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ fn loop_turn(
417417
let msg = format!("workspace loaded, {} rust packages", n_packages);
418418
show_message(req::MessageType::Info, msg, &connection.sender);
419419
}
420+
world_state.check_watcher.update();
420421
}
421422

422423
if state_changed {

0 commit comments

Comments
 (0)