aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/config.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 2038ef89b..b5dc6f0fa 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -50,6 +50,8 @@ impl Default for LensConfig {
50} 50}
51 51
52impl LensConfig { 52impl LensConfig {
53 pub const NO_LENS: LensConfig = Self { run: false, debug: false, impementations: false };
54
53 pub fn any(&self) -> bool { 55 pub fn any(&self) -> bool {
54 self.impementations || self.runnable() 56 self.impementations || self.runnable()
55 } 57 }
@@ -224,9 +226,16 @@ impl Config {
224 set(value, "/completion/addCallParenthesis", &mut self.completion.add_call_parenthesis); 226 set(value, "/completion/addCallParenthesis", &mut self.completion.add_call_parenthesis);
225 set(value, "/completion/addCallArgumentSnippets", &mut self.completion.add_call_argument_snippets); 227 set(value, "/completion/addCallArgumentSnippets", &mut self.completion.add_call_argument_snippets);
226 set(value, "/callInfo/full", &mut self.call_info_full); 228 set(value, "/callInfo/full", &mut self.call_info_full);
227 set(value, "/lens/run", &mut self.lens.run); 229
228 set(value, "/lens/debug", &mut self.lens.debug); 230 let mut lens_enabled = true;
229 set(value, "/lens/implementations", &mut self.lens.impementations); 231 set(value, "/lens/enable", &mut lens_enabled);
232 if lens_enabled {
233 set(value, "/lens/run", &mut self.lens.run);
234 set(value, "/lens/debug", &mut self.lens.debug);
235 set(value, "/lens/implementations", &mut self.lens.impementations);
236 } else {
237 self.lens = LensConfig::NO_LENS;
238 }
230 239
231 log::info!("Config::update() = {:#?}", self); 240 log::info!("Config::update() = {:#?}", self);
232 241