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