diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-26 16:28:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-26 16:28:26 +0100 |
commit | 90fdb8bf98c2491bcbaf72e0b1b3c27bdd9415d5 (patch) | |
tree | b0ab4365f16a7ce628bf797d8ca8f0ee0c948791 | |
parent | a0a475546b6f50644a1fa2a1e8586afde1ec82eb (diff) | |
parent | 5a18734338518dbb749ec89a261dffc296a979dc (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.rs | 12 |
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 |
2 | use std::sync::Arc; | 2 | use std::{mem, sync::Arc}; |
3 | 3 | ||
4 | use crossbeam_channel::unbounded; | 4 | use crossbeam_channel::unbounded; |
5 | use flycheck::FlycheckHandle; | 5 | use flycheck::FlycheckHandle; |
@@ -14,12 +14,14 @@ use crate::{ | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | impl GlobalState { | 16 | impl 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 = { |