diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/gen_lsp_server/src/stdio.rs | 8 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main.rs | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/crates/gen_lsp_server/src/stdio.rs b/crates/gen_lsp_server/src/stdio.rs index dab2d8da8..c5fe5b83a 100644 --- a/crates/gen_lsp_server/src/stdio.rs +++ b/crates/gen_lsp_server/src/stdio.rs | |||
@@ -37,11 +37,9 @@ pub struct Threads { | |||
37 | } | 37 | } |
38 | 38 | ||
39 | impl Threads { | 39 | impl Threads { |
40 | pub fn join(self) -> Result<()> { | 40 | pub fn exit(self) -> Result<()> { |
41 | match self.reader.join() { | 41 | // We can't rely on stdin being closed |
42 | Ok(r) => r?, | 42 | drop(self.reader); |
43 | Err(_) => bail!("reader panicked"), | ||
44 | } | ||
45 | match self.writer.join() { | 43 | match self.writer.join() { |
46 | Ok(r) => r, | 44 | Ok(r) => r, |
47 | Err(_) => bail!("writer panicked"), | 45 | Err(_) => bail!("writer panicked"), |
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs index b0b70df5c..6b1274a3b 100644 --- a/crates/ra_lsp_server/src/main.rs +++ b/crates/ra_lsp_server/src/main.rs | |||
@@ -54,7 +54,7 @@ fn main_inner() -> Result<()> { | |||
54 | ra_lsp_server::main_loop(workspace_roots, opts, r, s) | 54 | ra_lsp_server::main_loop(workspace_roots, opts, r, s) |
55 | })?; | 55 | })?; |
56 | log::info!("shutting down IO..."); | 56 | log::info!("shutting down IO..."); |
57 | threads.join()?; | 57 | threads.exit()?; |
58 | log::info!("... IO is down"); | 58 | log::info!("... IO is down"); |
59 | Ok(()) | 59 | Ok(()) |
60 | } | 60 | } |