about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhermannm <hermann.morkrid@gmail.com>2024-05-02 20:12:28 +0200
committerhermannm <hermann.morkrid@gmail.com>2024-05-02 20:14:41 +0200
commitd09331ce830bbae5953f02bd5b44f0076c998292 (patch)
tree2aa1fcf2f2d920ca9407d2e6fc4bafa0ec8aa9aa
parentb05f906a504c8ecfc5f9930508d79dac3ca25091 (diff)
downloadrust-d09331ce830bbae5953f02bd5b44f0076c998292.tar.gz
rust-d09331ce830bbae5953f02bd5b44f0076c998292.zip
Fix Run lens showing when lenses are disabled
The documentation for `lens.run.enable` states that it only applies
when `lens.enable` is set. However, the config setting whether to show
the Run lens did not check `lens.enable`, so the Run lens would show
even though lenses were disabled.
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
index 9b8fdd81061..e16595c992e 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
@@ -1776,7 +1776,7 @@ impl Config {
 
     pub fn lens(&self) -> LensConfig {
         LensConfig {
-            run: *self.lens_run_enable(),
+            run: *self.lens_enable() && *self.lens_run_enable(),
             debug: *self.lens_enable() && *self.lens_debug_enable(),
             interpret: *self.lens_enable() && *self.lens_run_enable() && *self.interpret_tests(),
             implementations: *self.lens_enable() && *self.lens_implementations_enable(),