Skip to content

Commit

Permalink
Auto merge of rust-lang#17177 - hermannm:fix-run-lens-config, r=Veykril
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed May 3, 2024
2 parents 25f59be + d226527 commit c80006a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit c80006a

Please sign in to comment.