aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-26 16:28:26 +0100
committerGitHub <[email protected]>2020-06-26 16:28:26 +0100
commit90fdb8bf98c2491bcbaf72e0b1b3c27bdd9415d5 (patch)
treeb0ab4365f16a7ce628bf797d8ca8f0ee0c948791
parenta0a475546b6f50644a1fa2a1e8586afde1ec82eb (diff)
parent5a18734338518dbb749ec89a261dffc296a979dc (diff)
Merge #5079
5079: Fix config switching r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/rust-analyzer/src/reload.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs
index a1850b286..ec71f8b29 100644
--- a/crates/rust-analyzer/src/reload.rs
+++ b/crates/rust-analyzer/src/reload.rs
@@ -1,5 +1,5 @@
1//! Project loading & configuration updates 1//! Project loading & configuration updates
2use std::sync::Arc; 2use std::{mem, sync::Arc};
3 3
4use crossbeam_channel::unbounded; 4use crossbeam_channel::unbounded;
5use flycheck::FlycheckHandle; 5use flycheck::FlycheckHandle;
@@ -14,12 +14,14 @@ use crate::{
14}; 14};
15 15
16impl GlobalState { 16impl GlobalState {
17 pub(crate) fn update_configuration(&mut self, new_config: Config) { 17 pub(crate) fn update_configuration(&mut self, config: Config) {
18 self.analysis_host.update_lru_capacity(new_config.lru_capacity); 18 let old_config = mem::replace(&mut self.config, config);
19 if new_config.flycheck != self.config.flycheck { 19 if self.config.lru_capacity != old_config.lru_capacity {
20 self.analysis_host.update_lru_capacity(old_config.lru_capacity);
21 }
22 if self.config.flycheck != old_config.flycheck {
20 self.reload_flycheck(); 23 self.reload_flycheck();
21 } 24 }
22 self.config = new_config;
23 } 25 }
24 pub(crate) fn reload(&mut self) { 26 pub(crate) fn reload(&mut self) {
25 let workspaces = { 27 let workspaces = {