Add toggle for experimental diagnostics

This commit is contained in:
Jonas Schievink 2020-07-24 17:39:16 +02:00
parent bec5123b0a
commit f6f49735e8
2 changed files with 14 additions and 5 deletions

View file

@ -23,6 +23,7 @@ pub struct Config {
pub client_caps: ClientCapsConfig,
pub publish_diagnostics: bool,
pub experimental_diagnostics: bool,
pub diagnostics: DiagnosticsConfig,
pub lru_capacity: Option<usize>,
pub proc_macro_srv: Option<(PathBuf, Vec<OsString>)>,
@ -137,6 +138,7 @@ impl Config {
with_sysroot: true,
publish_diagnostics: true,
experimental_diagnostics: true,
diagnostics: DiagnosticsConfig::default(),
lru_capacity: None,
proc_macro_srv: None,
@ -187,6 +189,7 @@ impl Config {
self.with_sysroot = data.withSysroot;
self.publish_diagnostics = data.diagnostics_enable;
self.experimental_diagnostics = data.diagnostics_enableExperimental;
self.diagnostics = DiagnosticsConfig {
warnings_as_info: data.diagnostics_warningsAsInfo,
warnings_as_hint: data.diagnostics_warningsAsHint,
@ -405,6 +408,7 @@ config_data! {
completion_postfix_enable: bool = true,
diagnostics_enable: bool = true,
diagnostics_enableExperimental: bool = true,
diagnostics_warningsAsHint: Vec<String> = Vec::new(),
diagnostics_warningsAsInfo: Vec<String> = Vec::new(),

View file

@ -200,11 +200,6 @@
"type": "object",
"title": "Rust Analyzer",
"properties": {
"rust-analyzer.diagnostics.enable": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to show native rust-analyzer diagnostics."
},
"rust-analyzer.lruCapacity": {
"type": [
"null",
@ -579,6 +574,16 @@
"type": "boolean",
"default": true
},
"rust-analyzer.diagnostics.enable": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to show native rust-analyzer diagnostics."
},
"rust-analyzer.diagnostics.enableExperimental": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to show experimental rust-analyzer diagnostics that might have more false positives than usual."
},
"rust-analyzer.diagnostics.warningsAsInfo": {
"type": "array",
"uniqueItems": true,