aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-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 = {