From a40e05dd5d8b2c5f74c61cd08efed9dc83124657 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 15 Jul 2020 14:37:44 +0200 Subject: Don't drop flycheck messages during restart closes #5386 --- crates/rust-analyzer/src/global_state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/rust-analyzer/src/global_state.rs') diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 9a9a6547a..94973b90a 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -63,7 +63,9 @@ pub(crate) struct GlobalState { req_queue: ReqQueue, pub(crate) task_pool: Handle, Receiver>, pub(crate) loader: Handle, Receiver>, - pub(crate) flycheck: Option>>, + pub(crate) flycheck: Option, + pub(crate) flycheck_sender: Sender, + pub(crate) flycheck_receiver: Receiver, pub(crate) config: Config, pub(crate) analysis_host: AnalysisHost, pub(crate) diagnostics: DiagnosticCollection, @@ -103,12 +105,15 @@ impl GlobalState { }; let analysis_host = AnalysisHost::new(config.lru_capacity); + let (flycheck_sender, flycheck_receiver) = unbounded(); GlobalState { sender, req_queue: ReqQueue::default(), task_pool, loader, flycheck: None, + flycheck_sender, + flycheck_receiver, config, analysis_host, diagnostics: Default::default(), -- cgit v1.2.3