Skip to content

Commit f6f4973

Browse files
author
Jonas Schievink
committed
Add toggle for experimental diagnostics
1 parent bec5123 commit f6f4973

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct Config {
2323
pub client_caps: ClientCapsConfig,
2424

2525
pub publish_diagnostics: bool,
26+
pub experimental_diagnostics: bool,
2627
pub diagnostics: DiagnosticsConfig,
2728
pub lru_capacity: Option<usize>,
2829
pub proc_macro_srv: Option<(PathBuf, Vec<OsString>)>,
@@ -137,6 +138,7 @@ impl Config {
137138

138139
with_sysroot: true,
139140
publish_diagnostics: true,
141+
experimental_diagnostics: true,
140142
diagnostics: DiagnosticsConfig::default(),
141143
lru_capacity: None,
142144
proc_macro_srv: None,
@@ -187,6 +189,7 @@ impl Config {
187189

188190
self.with_sysroot = data.withSysroot;
189191
self.publish_diagnostics = data.diagnostics_enable;
192+
self.experimental_diagnostics = data.diagnostics_enableExperimental;
190193
self.diagnostics = DiagnosticsConfig {
191194
warnings_as_info: data.diagnostics_warningsAsInfo,
192195
warnings_as_hint: data.diagnostics_warningsAsHint,
@@ -405,6 +408,7 @@ config_data! {
405408
completion_postfix_enable: bool = true,
406409

407410
diagnostics_enable: bool = true,
411+
diagnostics_enableExperimental: bool = true,
408412
diagnostics_warningsAsHint: Vec<String> = Vec::new(),
409413
diagnostics_warningsAsInfo: Vec<String> = Vec::new(),
410414

editors/code/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,6 @@
200200
"type": "object",
201201
"title": "Rust Analyzer",
202202
"properties": {
203-
"rust-analyzer.diagnostics.enable": {
204-
"type": "boolean",
205-
"default": true,
206-
"markdownDescription": "Whether to show native rust-analyzer diagnostics."
207-
},
208203
"rust-analyzer.lruCapacity": {
209204
"type": [
210205
"null",
@@ -579,6 +574,16 @@
579574
"type": "boolean",
580575
"default": true
581576
},
577+
"rust-analyzer.diagnostics.enable": {
578+
"type": "boolean",
579+
"default": true,
580+
"markdownDescription": "Whether to show native rust-analyzer diagnostics."
581+
},
582+
"rust-analyzer.diagnostics.enableExperimental": {
583+
"type": "boolean",
584+
"default": true,
585+
"markdownDescription": "Whether to show experimental rust-analyzer diagnostics that might have more false positives than usual."
586+
},
582587
"rust-analyzer.diagnostics.warningsAsInfo": {
583588
"type": "array",
584589
"uniqueItems": true,

0 commit comments

Comments
 (0)