From 97cdf3eb0e766e375b04a0b9bc1184299e6f0404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 6 May 2022 09:46:02 +0300 Subject: [PATCH] Try not to invalidate our state when the proc macro preference didn't change --- crates/rust-analyzer/src/reload.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index c2a6a3fe30..c2a521bbf5 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -55,10 +55,13 @@ impl GlobalState { self.reload_flycheck(); } - // Apply experimental feature flags. - self.analysis_host - .raw_database_mut() - .set_enable_proc_attr_macros(self.config.expand_proc_attr_macros()); + if self.analysis_host.raw_database().enable_proc_attr_macros() + != self.config.expand_proc_attr_macros() + { + self.analysis_host + .raw_database_mut() + .set_enable_proc_attr_macros(self.config.expand_proc_attr_macros()); + } } pub(crate) fn current_status(&self) -> lsp_ext::ServerStatusParams {