aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-13 16:52:30 +0000
committerGitHub <[email protected]>2020-01-13 16:52:30 +0000
commit27abd4a1a57bba47c717cb55e4719d69f2c5eb5c (patch)
tree4d8e74ed2a746eb675a02d7a69559e9bf8264197
parent5621f90071f576a8989cd09f98eb0fc6c9b7a612 (diff)
parentc774850fd8d983ad61d333441a5b872aba3884b4 (diff)
Merge #2824
2824: Defer cargo check until after workspace load r=kiljacken a=kiljacken Fixes #2822 Co-authored-by: Emil Lauridsen <[email protected]>
-rw-r--r--crates/ra_cargo_watch/src/lib.rs13
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs1
2 files changed, 12 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(),
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 7a49cad86..84012b99d 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -417,6 +417,7 @@ fn loop_turn(
417 let msg = format!("workspace loaded, {} rust packages", n_packages); 417 let msg = format!("workspace loaded, {} rust packages", n_packages);
418 show_message(req::MessageType::Info, msg, &connection.sender); 418 show_message(req::MessageType::Info, msg, &connection.sender);
419 } 419 }
420 world_state.check_watcher.update();
420 } 421 }
421 422
422 if state_changed { 423 if state_changed {