aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rust-analyzer/src/config.rs')
-rw-r--r--crates/rust-analyzer/src/config.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 3ddb9e19a..247bfe71e 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -147,6 +147,9 @@ config_data! {
147 /// Whether to show `Method References` lens. Only applies when 147 /// Whether to show `Method References` lens. Only applies when
148 /// `#rust-analyzer.lens.enable#` is set. 148 /// `#rust-analyzer.lens.enable#` is set.
149 lens_methodReferences: bool = "false", 149 lens_methodReferences: bool = "false",
150 /// Whether to show `References` lens. Only applies when
151 /// `#rust-analyzer.lens.enable#` is set.
152 lens_references: bool = "false",
150 153
151 /// Disable project auto-discovery in favor of explicitly specified set 154 /// Disable project auto-discovery in favor of explicitly specified set
152 /// of projects.\n\nElements must be paths pointing to `Cargo.toml`, 155 /// of projects.\n\nElements must be paths pointing to `Cargo.toml`,
@@ -221,6 +224,7 @@ pub struct LensConfig {
221 pub debug: bool, 224 pub debug: bool,
222 pub implementations: bool, 225 pub implementations: bool,
223 pub method_refs: bool, 226 pub method_refs: bool,
227 pub refs: bool, // for Struct, Enum, Union and Trait
224} 228}
225 229
226impl LensConfig { 230impl LensConfig {
@@ -237,7 +241,7 @@ impl LensConfig {
237 } 241 }
238 242
239 pub fn references(&self) -> bool { 243 pub fn references(&self) -> bool {
240 self.method_refs 244 self.method_refs || self.refs
241 } 245 }
242} 246}
243 247
@@ -593,6 +597,7 @@ impl Config {
593 debug: self.data.lens_enable && self.data.lens_debug, 597 debug: self.data.lens_enable && self.data.lens_debug,
594 implementations: self.data.lens_enable && self.data.lens_implementations, 598 implementations: self.data.lens_enable && self.data.lens_implementations,
595 method_refs: self.data.lens_enable && self.data.lens_methodReferences, 599 method_refs: self.data.lens_enable && self.data.lens_methodReferences,
600 refs: self.data.lens_enable && self.data.lens_references,
596 } 601 }
597 } 602 }
598 pub fn hover(&self) -> HoverConfig { 603 pub fn hover(&self) -> HoverConfig {