Skip to content

Commit 1e7c467

Browse files
committed
Auto merge of rust-lang#17177 - hermannm:fix-run-lens-config, r=Veykril
Fix Run lens showing when lenses are disabled I have disabled Rust Analyzer lenses in my VSCode settings, but noticed that the `Run` lens still showed. This surprised me, as the docs for `lens.run.enable` [state that it only applies when `lens.enable` is set](https://github.com/rust-lang/rust-analyzer/blob/25f59be62f6b915b44a4c2ec2defca56a5f766c1/crates/rust-analyzer/src/config.rs#L353-L355). I then found that where we set `LensConfig::run`, we don't check `lens_enable` like for the other settings. [We did this previously](https://github.com/rust-lang/rust-analyzer/blob/eab385e1f64f8e3b861effe91432785f8030191b/crates/rust-analyzer/src/config.rs#L1649), so this seems like a regression from refactoring. This PR tries to fix that.
2 parents b05f906 + d09331c commit 1e7c467

File tree

1 file changed

+1
-1
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src

1 file changed

+1
-1
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ impl Config {
17761776

17771777
pub fn lens(&self) -> LensConfig {
17781778
LensConfig {
1779-
run: *self.lens_run_enable(),
1779+
run: *self.lens_enable() && *self.lens_run_enable(),
17801780
debug: *self.lens_enable() && *self.lens_debug_enable(),
17811781
interpret: *self.lens_enable() && *self.lens_run_enable() && *self.interpret_tests(),
17821782
implementations: *self.lens_enable() && *self.lens_implementations_enable(),

0 commit comments

Comments
 (0)