aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r--crates/ra_lsp_server/src/main_loop/mod.rs23
1 files changed, 15 insertions, 8 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/mod.rs b/crates/ra_lsp_server/src/main_loop/mod.rs
index db878e0aa..78d93741a 100644
--- a/crates/ra_lsp_server/src/main_loop/mod.rs
+++ b/crates/ra_lsp_server/src/main_loop/mod.rs
@@ -48,6 +48,7 @@ enum Task {
48pub fn main_loop( 48pub fn main_loop(
49 internal_mode: bool, 49 internal_mode: bool,
50 root: PathBuf, 50 root: PathBuf,
51 publish_decorations: bool,
51 msg_receiver: &Receiver<RawMessage>, 52 msg_receiver: &Receiver<RawMessage>,
52 msg_sender: &Sender<RawMessage>, 53 msg_sender: &Sender<RawMessage>,
53) -> Result<()> { 54) -> Result<()> {
@@ -67,6 +68,7 @@ pub fn main_loop(
67 let mut subs = Subscriptions::new(); 68 let mut subs = Subscriptions::new();
68 let main_res = main_loop_inner( 69 let main_res = main_loop_inner(
69 internal_mode, 70 internal_mode,
71 publish_decorations,
70 root, 72 root,
71 &pool, 73 &pool,
72 msg_sender, 74 msg_sender,
@@ -99,6 +101,7 @@ pub fn main_loop(
99 101
100fn main_loop_inner( 102fn main_loop_inner(
101 internal_mode: bool, 103 internal_mode: bool,
104 publish_decorations: bool,
102 ws_root: PathBuf, 105 ws_root: PathBuf,
103 pool: &ThreadPool, 106 pool: &ThreadPool,
104 msg_sender: &Sender<RawMessage>, 107 msg_sender: &Sender<RawMessage>,
@@ -210,6 +213,7 @@ fn main_loop_inner(
210 update_file_notifications_on_threadpool( 213 update_file_notifications_on_threadpool(
211 pool, 214 pool,
212 state.snapshot(), 215 state.snapshot(),
216 publish_decorations,
213 task_sender.clone(), 217 task_sender.clone(),
214 subs.subscriptions(), 218 subs.subscriptions(),
215 ) 219 )
@@ -416,6 +420,7 @@ impl<'a> PoolDispatcher<'a> {
416fn update_file_notifications_on_threadpool( 420fn update_file_notifications_on_threadpool(
417 pool: &ThreadPool, 421 pool: &ThreadPool,
418 world: ServerWorld, 422 world: ServerWorld,
423 publish_decorations: bool,
419 sender: Sender<Task>, 424 sender: Sender<Task>,
420 subscriptions: Vec<FileId>, 425 subscriptions: Vec<FileId>,
421) { 426) {
@@ -432,15 +437,17 @@ fn update_file_notifications_on_threadpool(
432 sender.send(Task::Notify(not)); 437 sender.send(Task::Notify(not));
433 } 438 }
434 } 439 }
435 match handlers::publish_decorations(&world, file_id) { 440 if publish_decorations {
436 Err(e) => { 441 match handlers::publish_decorations(&world, file_id) {
437 if !is_canceled(&e) { 442 Err(e) => {
438 error!("failed to compute decorations: {:?}", e); 443 if !is_canceled(&e) {
444 error!("failed to compute decorations: {:?}", e);
445 }
446 }
447 Ok(params) => {
448 let not = RawNotification::new::<req::PublishDecorations>(&params);
449 sender.send(Task::Notify(not))
439 } 450 }
440 }
441 Ok(params) => {
442 let not = RawNotification::new::<req::PublishDecorations>(&params);
443 sender.send(Task::Notify(not))
444 } 451 }
445 } 452 }
446 } 453 }