aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index fb2305b26..d0c2a95ef 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -22,6 +22,7 @@ use crate::{
22 req, 22 req,
23 server_world::{ServerWorld, ServerWorldState}, 23 server_world::{ServerWorld, ServerWorldState},
24 Result, 24 Result,
25 InitializationOptions,
25}; 26};
26 27
27#[derive(Debug, Fail)] 28#[derive(Debug, Fail)]
@@ -47,7 +48,7 @@ const THREADPOOL_SIZE: usize = 8;
47 48
48pub fn main_loop( 49pub fn main_loop(
49 ws_root: PathBuf, 50 ws_root: PathBuf,
50 supports_decorations: bool, 51 options: InitializationOptions,
51 msg_receiver: &Receiver<RawMessage>, 52 msg_receiver: &Receiver<RawMessage>,
52 msg_sender: &Sender<RawMessage>, 53 msg_sender: &Sender<RawMessage>,
53) -> Result<()> { 54) -> Result<()> {
@@ -80,7 +81,7 @@ pub fn main_loop(
80 let mut pending_requests = FxHashSet::default(); 81 let mut pending_requests = FxHashSet::default();
81 let mut subs = Subscriptions::new(); 82 let mut subs = Subscriptions::new();
82 let main_res = main_loop_inner( 83 let main_res = main_loop_inner(
83 supports_decorations, 84 options,
84 &pool, 85 &pool,
85 msg_sender, 86 msg_sender,
86 msg_receiver, 87 msg_receiver,
@@ -147,7 +148,7 @@ impl fmt::Debug for Event {
147} 148}
148 149
149fn main_loop_inner( 150fn main_loop_inner(
150 supports_decorations: bool, 151 options: InitializationOptions,
151 pool: &ThreadPool, 152 pool: &ThreadPool,
152 msg_sender: &Sender<RawMessage>, 153 msg_sender: &Sender<RawMessage>,
153 msg_receiver: &Receiver<RawMessage>, 154 msg_receiver: &Receiver<RawMessage>,
@@ -247,7 +248,9 @@ fn main_loop_inner(
247 && pending_libraries.is_empty() 248 && pending_libraries.is_empty()
248 && in_flight_libraries == 0 249 && in_flight_libraries == 0
249 { 250 {
250 show_message(req::MessageType::Info, "workspace loaded", msg_sender); 251 if options.show_workspace_loaded {
252 show_message(req::MessageType::Info, "workspace loaded", msg_sender);
253 }
251 // Only send the notification first time 254 // Only send the notification first time
252 send_workspace_notification = false; 255 send_workspace_notification = false;
253 } 256 }
@@ -256,7 +259,7 @@ fn main_loop_inner(
256 update_file_notifications_on_threadpool( 259 update_file_notifications_on_threadpool(
257 pool, 260 pool,
258 state.snapshot(), 261 state.snapshot(),
259 supports_decorations, 262 options.publish_decorations,
260 task_sender.clone(), 263 task_sender.clone(),
261 subs.subscriptions(), 264 subs.subscriptions(),
262 ) 265 )