From daca5a3711851db2a954646c6f7209be996144ff Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Mon, 13 Jan 2020 17:12:14 +0100 Subject: Defer cargo check until after workspace load --- crates/ra_cargo_watch/src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crates/ra_cargo_watch/src') diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs index cb0856aa4..20fa5a924 100644 --- a/crates/ra_cargo_watch/src/lib.rs +++ b/crates/ra_cargo_watch/src/lib.rs @@ -184,8 +184,13 @@ impl CheckWatcherState { workspace_root: PathBuf, shared: Arc>, ) -> CheckWatcherState { - let watcher = WatchThread::new(&options, &workspace_root); - CheckWatcherState { options, workspace_root, watcher, last_update_req: None, shared } + CheckWatcherState { + options, + workspace_root, + watcher: WatchThread::dummy(), + last_update_req: None, + shared, + } } fn run(&mut self, task_send: &Sender, cmd_recv: &Receiver) { @@ -313,6 +318,10 @@ enum CheckEvent { } impl WatchThread { + fn dummy() -> WatchThread { + WatchThread { handle: None, message_recv: never() } + } + fn new(options: &CheckOptions, workspace_root: &PathBuf) -> WatchThread { let mut args: Vec = vec![ options.command.clone(), -- cgit v1.2.3