aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cargo_watch/src
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2020-01-13 16:12:14 +0000
committerEmil Lauridsen <[email protected]>2020-01-13 16:12:14 +0000
commitdaca5a3711851db2a954646c6f7209be996144ff (patch)
tree774c9f908b0fcb431a420e808596d85d6a4ba875 /crates/ra_cargo_watch/src
parent5621f90071f576a8989cd09f98eb0fc6c9b7a612 (diff)
Defer cargo check until after workspace load
Diffstat (limited to 'crates/ra_cargo_watch/src')
-rw-r--r--crates/ra_cargo_watch/src/lib.rs13
1 files changed, 11 insertions, 2 deletions
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 {
184 workspace_root: PathBuf, 184 workspace_root: PathBuf,
185 shared: Arc<RwLock<CheckWatcherSharedState>>, 185 shared: Arc<RwLock<CheckWatcherSharedState>>,
186 ) -> CheckWatcherState { 186 ) -> CheckWatcherState {
187 let watcher = WatchThread::new(&options, &workspace_root); 187 CheckWatcherState {
188 CheckWatcherState { options, workspace_root, watcher, last_update_req: None, shared } 188 options,
189 workspace_root,
190 watcher: WatchThread::dummy(),
191 last_update_req: None,
192 shared,
193 }
189 } 194 }
190 195
191 fn run(&mut self, task_send: &Sender<CheckTask>, cmd_recv: &Receiver<CheckCommand>) { 196 fn run(&mut self, task_send: &Sender<CheckTask>, cmd_recv: &Receiver<CheckCommand>) {
@@ -313,6 +318,10 @@ enum CheckEvent {
313} 318}
314 319
315impl WatchThread { 320impl WatchThread {
321 fn dummy() -> WatchThread {
322 WatchThread { handle: None, message_recv: never() }
323 }
324
316 fn new(options: &CheckOptions, workspace_root: &PathBuf) -> WatchThread { 325 fn new(options: &CheckOptions, workspace_root: &PathBuf) -> WatchThread {
317 let mut args: Vec<String> = vec![ 326 let mut args: Vec<String> = vec![
318 options.command.clone(), 327 options.command.clone(),