aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r--crates/ra_lsp_server/Cargo.toml2
-rw-r--r--crates/ra_lsp_server/src/main.rs7
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs1
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/support.rs3
4 files changed, 3 insertions, 10 deletions
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index 21aef842c..41672eaff 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -13,7 +13,6 @@ relative-path = "1.0.0"
13serde_json = "1.0.34" 13serde_json = "1.0.34"
14serde = { version = "1.0.83", features = ["derive"] } 14serde = { version = "1.0.83", features = ["derive"] }
15crossbeam-channel = "0.4" 15crossbeam-channel = "0.4"
16flexi_logger = "0.14.0"
17log = "0.4.3" 16log = "0.4.3"
18lsp-types = { version = "0.61.0", features = ["proposed"] } 17lsp-types = { version = "0.61.0", features = ["proposed"] }
19rustc-hash = "1.0" 18rustc-hash = "1.0"
@@ -27,6 +26,7 @@ lsp-server = "0.3.0"
27ra_project_model = { path = "../ra_project_model" } 26ra_project_model = { path = "../ra_project_model" }
28ra_prof = { path = "../ra_prof" } 27ra_prof = { path = "../ra_prof" }
29ra_vfs_glob = { path = "../ra_vfs_glob" } 28ra_vfs_glob = { path = "../ra_vfs_glob" }
29env_logger = { version = "0.7.1", default-features = false, features = ["humantime"] }
30 30
31[dev-dependencies] 31[dev-dependencies]
32tempfile = "3" 32tempfile = "3"
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs
index e13c8ca14..8076a7fa5 100644
--- a/crates/ra_lsp_server/src/main.rs
+++ b/crates/ra_lsp_server/src/main.rs
@@ -1,6 +1,5 @@
1//! `ra_lsp_server` binary 1//! `ra_lsp_server` binary
2 2
3use flexi_logger::{Duplicate, Logger};
4use lsp_server::Connection; 3use lsp_server::Connection;
5use ra_lsp_server::{show_message, Result, ServerConfig}; 4use ra_lsp_server::{show_message, Result, ServerConfig};
6use ra_prof; 5use ra_prof;
@@ -14,11 +13,7 @@ fn main() -> Result<()> {
14fn setup_logging() -> Result<()> { 13fn setup_logging() -> Result<()> {
15 std::env::set_var("RUST_BACKTRACE", "short"); 14 std::env::set_var("RUST_BACKTRACE", "short");
16 15
17 let logger = Logger::with_env_or_str("error").duplicate_to_stderr(Duplicate::All); 16 env_logger::try_init()?;
18 match std::env::var("RA_LOG_DIR") {
19 Ok(ref v) if v == "1" => logger.log_to_file().directory("log").start()?,
20 _ => logger.start()?,
21 };
22 17
23 ra_prof::set_filter(match std::env::var("RA_PROFILE") { 18 ra_prof::set_filter(match std::env::var("RA_PROFILE") {
24 Ok(spec) => ra_prof::Filter::from_spec(&spec), 19 Ok(spec) => ra_prof::Filter::from_spec(&spec),
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index 2ba82ab05..29224cbe8 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -15,7 +15,6 @@ use tempfile::TempDir;
15 15
16use crate::support::{project, Project}; 16use crate::support::{project, Project};
17 17
18const LOG: &'static str = "";
19const PROFILE: &'static str = ""; 18const PROFILE: &'static str = "";
20// const PROFILE: &'static str = "*@3>100"; 19// const PROFILE: &'static str = "*@3>100";
21 20
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs
index 86073b57d..d5ea52fa9 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/support.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs
@@ -7,7 +7,6 @@ use std::{
7}; 7};
8 8
9use crossbeam_channel::{after, select, Receiver}; 9use crossbeam_channel::{after, select, Receiver};
10use flexi_logger::Logger;
11use lsp_server::{Connection, Message, Notification, Request}; 10use lsp_server::{Connection, Message, Notification, Request};
12use lsp_types::{ 11use lsp_types::{
13 notification::{DidOpenTextDocument, Exit}, 12 notification::{DidOpenTextDocument, Exit},
@@ -53,7 +52,7 @@ impl<'a> Project<'a> {
53 let tmp_dir = self.tmp_dir.unwrap_or_else(|| TempDir::new().unwrap()); 52 let tmp_dir = self.tmp_dir.unwrap_or_else(|| TempDir::new().unwrap());
54 static INIT: Once = Once::new(); 53 static INIT: Once = Once::new();
55 INIT.call_once(|| { 54 INIT.call_once(|| {
56 let _ = Logger::with_env_or_str(crate::LOG).start().unwrap(); 55 let _ = env_logger::builder().is_test(true).try_init().unwrap();
57 ra_prof::set_filter(if crate::PROFILE.is_empty() { 56 ra_prof::set_filter(if crate::PROFILE.is_empty() {
58 ra_prof::Filter::disabled() 57 ra_prof::Filter::disabled()
59 } else { 58 } else {