aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/main_loop.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-15 13:37:44 +0100
committerAleksey Kladov <[email protected]>2020-07-15 13:37:44 +0100
commita40e05dd5d8b2c5f74c61cd08efed9dc83124657 (patch)
tree0cd983f87b9328f683cf70b6207972241b2368cd /crates/rust-analyzer/src/main_loop.rs
parent6f3c8dc11d477a6d680ce018e93f007c31499bd5 (diff)
Don't drop flycheck messages during restart
closes #5386
Diffstat (limited to 'crates/rust-analyzer/src/main_loop.rs')
-rw-r--r--crates/rust-analyzer/src/main_loop.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 5afcc2d87..a41f7f564 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -5,7 +5,7 @@ use std::{
5 time::{Duration, Instant}, 5 time::{Duration, Instant},
6}; 6};
7 7
8use crossbeam_channel::{never, select, Receiver}; 8use crossbeam_channel::{select, Receiver};
9use lsp_server::{Connection, Notification, Request, Response}; 9use lsp_server::{Connection, Notification, Request, Response};
10use lsp_types::notification::Notification as _; 10use lsp_types::notification::Notification as _;
11use ra_db::VfsPath; 11use ra_db::VfsPath;
@@ -108,7 +108,7 @@ impl GlobalState {
108 recv(self.loader.receiver) -> task => 108 recv(self.loader.receiver) -> task =>
109 Some(Event::Vfs(task.unwrap())), 109 Some(Event::Vfs(task.unwrap())),
110 110
111 recv(self.flycheck.as_ref().map_or(&never(), |it| &it.receiver)) -> task => 111 recv(self.flycheck_receiver) -> task =>
112 Some(Event::Flycheck(task.unwrap())), 112 Some(Event::Flycheck(task.unwrap())),
113 } 113 }
114 } 114 }
@@ -292,7 +292,7 @@ impl GlobalState {
292 let state_changed = self.process_changes(); 292 let state_changed = self.process_changes();
293 if prev_status == Status::Loading && self.status == Status::Ready { 293 if prev_status == Status::Loading && self.status == Status::Ready {
294 if let Some(flycheck) = &self.flycheck { 294 if let Some(flycheck) = &self.flycheck {
295 flycheck.handle.update(); 295 flycheck.update();
296 } 296 }
297 } 297 }
298 298
@@ -441,7 +441,7 @@ impl GlobalState {
441 })? 441 })?
442 .on::<lsp_types::notification::DidSaveTextDocument>(|this, params| { 442 .on::<lsp_types::notification::DidSaveTextDocument>(|this, params| {
443 if let Some(flycheck) = &this.flycheck { 443 if let Some(flycheck) = &this.flycheck {
444 flycheck.handle.update(); 444 flycheck.update();
445 } 445 }
446 if let Ok(abs_path) = from_proto::abs_path(&params.text_document.uri) { 446 if let Ok(abs_path) = from_proto::abs_path(&params.text_document.uri) {
447 this.maybe_refresh(&[(abs_path, ChangeKind::Modify)]); 447 this.maybe_refresh(&[(abs_path, ChangeKind::Modify)]);