aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main.rs
diff options
context:
space:
mode:
authorSergey Parilin <[email protected]>2019-04-02 15:52:04 +0100
committerSergey Parilin <[email protected]>2019-04-02 15:52:04 +0100
commit9b73f809596e955216dde24fcf921d6985a1a767 (patch)
tree016b82dc06800a174c49a0ba88957df9c91d1906 /crates/ra_lsp_server/src/main.rs
parentef02c3c038812897cd96789fa35770e4215d27e8 (diff)
PR issuse resolved
Diffstat (limited to 'crates/ra_lsp_server/src/main.rs')
-rw-r--r--crates/ra_lsp_server/src/main.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs
index 5a2905207..eb4091a3d 100644
--- a/crates/ra_lsp_server/src/main.rs
+++ b/crates/ra_lsp_server/src/main.rs
@@ -3,6 +3,7 @@ use flexi_logger::{Duplicate, Logger};
3use gen_lsp_server::{run_server, stdio_transport}; 3use gen_lsp_server::{run_server, stdio_transport};
4 4
5use ra_lsp_server::{Result, InitializationOptions}; 5use ra_lsp_server::{Result, InitializationOptions};
6use ra_prof;
6 7
7fn main() -> Result<()> { 8fn main() -> Result<()> {
8 ::std::env::set_var("RUST_BACKTRACE", "short"); 9 ::std::env::set_var("RUST_BACKTRACE", "short");
@@ -11,6 +12,15 @@ fn main() -> Result<()> {
11 Ok(ref v) if v == "1" => logger.log_to_file().directory("log").start()?, 12 Ok(ref v) if v == "1" => logger.log_to_file().directory("log").start()?,
12 _ => logger.start()?, 13 _ => logger.start()?,
13 }; 14 };
15 let prof_depth = match ::std::env::var("RA_PROFILE_DEPTH") {
16 Ok(ref d) => d.parse()?,
17 _ => 0,
18 };
19 let profile_allowed = match ::std::env::var("RA_PROFILE") {
20 Ok(ref p) => p.split(";").map(String::from).collect(),
21 _ => Vec::new(),
22 };
23 ra_prof::set_filter(ra_prof::Filter::new(prof_depth, profile_allowed));
14 log::info!("lifecycle: server started"); 24 log::info!("lifecycle: server started");
15 match ::std::panic::catch_unwind(main_inner) { 25 match ::std::panic::catch_unwind(main_inner) {
16 Ok(res) => { 26 Ok(res) => {