2824: Defer cargo check until after workspace load r=kiljacken a=kiljacken

Fixes #2822

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
This commit is contained in:
bors[bot] 2020-01-13 16:52:30 +00:00 committed by GitHub
commit 27abd4a1a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -184,8 +184,13 @@ fn new(
workspace_root: PathBuf,
shared: Arc<RwLock<CheckWatcherSharedState>>,
) -> 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<CheckTask>, cmd_recv: &Receiver<CheckCommand>) {
@ -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<String> = vec![
options.command.clone(),

View File

@ -417,6 +417,7 @@ fn loop_turn(
let msg = format!("workspace loaded, {} rust packages", n_packages);
show_message(req::MessageType::Info, msg, &connection.sender);
}
world_state.check_watcher.update();
}
if state_changed {