From c732f215cb31e9f022090b8d0212f6ea9c134c11 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Fri, 27 Dec 2019 12:43:14 +0100 Subject: Don't finish main cargo watch thread when subprocess finishes. --- crates/ra_cargo_watch/src/lib.rs | 3 +-- crates/ra_lsp_server/src/main_loop.rs | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs index 11b624abf..d683d43d2 100644 --- a/crates/ra_cargo_watch/src/lib.rs +++ b/crates/ra_cargo_watch/src/lib.rs @@ -193,8 +193,7 @@ impl CheckWatcherState { recv(self.watcher.message_recv) -> msg => match msg { Ok(msg) => self.handle_message(msg, task_send), Err(RecvError) => { - // Task channel has closed, so shut down - break; + // Watcher finished, do nothing. }, } }; diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index e66b8f9eb..af1a487de 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -184,7 +184,10 @@ pub fn main_loop( Err(RecvError) => Err("vfs died")?, }, recv(libdata_receiver) -> data => Event::Lib(data.unwrap()), - recv(world_state.check_watcher.task_recv) -> task => Event::CheckWatcher(task.unwrap()) + recv(world_state.check_watcher.task_recv) -> task => match task { + Ok(task) => Event::CheckWatcher(task), + Err(RecvError) => Err("check watcher died")?, + } }; if let Event::Msg(Message::Request(req)) = &event { if connection.handle_shutdown(&req)? { -- cgit v1.2.3