diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main.rs | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs index 8301a1044..9ba972562 100644 --- a/crates/ra_lsp_server/src/main.rs +++ b/crates/ra_lsp_server/src/main.rs | |||
@@ -1,15 +1,5 @@ | |||
1 | #[macro_use] | 1 | use serde_derive::Deserialize; |
2 | extern crate log; | 2 | use serde::Deserialize as _D; |
3 | #[macro_use] | ||
4 | extern crate failure; | ||
5 | #[macro_use] | ||
6 | extern crate serde_derive; | ||
7 | extern crate serde; | ||
8 | extern crate flexi_logger; | ||
9 | extern crate gen_lsp_server; | ||
10 | extern crate ra_lsp_server; | ||
11 | |||
12 | use serde::Deserialize; | ||
13 | use flexi_logger::{Duplicate, Logger}; | 3 | use flexi_logger::{Duplicate, Logger}; |
14 | use gen_lsp_server::{run_server, stdio_transport}; | 4 | use gen_lsp_server::{run_server, stdio_transport}; |
15 | use ra_lsp_server::Result; | 5 | use ra_lsp_server::Result; |
@@ -21,15 +11,15 @@ fn main() -> Result<()> { | |||
21 | .log_to_file() | 11 | .log_to_file() |
22 | .directory("log") | 12 | .directory("log") |
23 | .start()?; | 13 | .start()?; |
24 | info!("lifecycle: server started"); | 14 | log::info!("lifecycle: server started"); |
25 | match ::std::panic::catch_unwind(main_inner) { | 15 | match ::std::panic::catch_unwind(main_inner) { |
26 | Ok(res) => { | 16 | Ok(res) => { |
27 | info!("lifecycle: terminating process with {:?}", res); | 17 | log::info!("lifecycle: terminating process with {:?}", res); |
28 | res | 18 | res |
29 | } | 19 | } |
30 | Err(_) => { | 20 | Err(_) => { |
31 | error!("server panicked"); | 21 | log::error!("server panicked"); |
32 | bail!("server panicked") | 22 | failure::bail!("server panicked") |
33 | } | 23 | } |
34 | } | 24 | } |
35 | } | 25 | } |
@@ -60,8 +50,8 @@ fn main_inner() -> Result<()> { | |||
60 | ra_lsp_server::main_loop(false, root, publish_decorations, r, s) | 50 | ra_lsp_server::main_loop(false, root, publish_decorations, r, s) |
61 | }, | 51 | }, |
62 | )?; | 52 | )?; |
63 | info!("shutting down IO..."); | 53 | log::info!("shutting down IO..."); |
64 | threads.join()?; | 54 | threads.join()?; |
65 | info!("... IO is down"); | 55 | log::info!("... IO is down"); |
66 | Ok(()) | 56 | Ok(()) |
67 | } | 57 | } |