mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Add toggle for experimental diagnostics
This commit is contained in:
parent
bec5123b0a
commit
f6f49735e8
2 changed files with 14 additions and 5 deletions
|
@ -23,6 +23,7 @@ pub struct Config {
|
||||||
pub client_caps: ClientCapsConfig,
|
pub client_caps: ClientCapsConfig,
|
||||||
|
|
||||||
pub publish_diagnostics: bool,
|
pub publish_diagnostics: bool,
|
||||||
|
pub experimental_diagnostics: bool,
|
||||||
pub diagnostics: DiagnosticsConfig,
|
pub diagnostics: DiagnosticsConfig,
|
||||||
pub lru_capacity: Option<usize>,
|
pub lru_capacity: Option<usize>,
|
||||||
pub proc_macro_srv: Option<(PathBuf, Vec<OsString>)>,
|
pub proc_macro_srv: Option<(PathBuf, Vec<OsString>)>,
|
||||||
|
@ -137,6 +138,7 @@ impl Config {
|
||||||
|
|
||||||
with_sysroot: true,
|
with_sysroot: true,
|
||||||
publish_diagnostics: true,
|
publish_diagnostics: true,
|
||||||
|
experimental_diagnostics: true,
|
||||||
diagnostics: DiagnosticsConfig::default(),
|
diagnostics: DiagnosticsConfig::default(),
|
||||||
lru_capacity: None,
|
lru_capacity: None,
|
||||||
proc_macro_srv: None,
|
proc_macro_srv: None,
|
||||||
|
@ -187,6 +189,7 @@ impl Config {
|
||||||
|
|
||||||
self.with_sysroot = data.withSysroot;
|
self.with_sysroot = data.withSysroot;
|
||||||
self.publish_diagnostics = data.diagnostics_enable;
|
self.publish_diagnostics = data.diagnostics_enable;
|
||||||
|
self.experimental_diagnostics = data.diagnostics_enableExperimental;
|
||||||
self.diagnostics = DiagnosticsConfig {
|
self.diagnostics = DiagnosticsConfig {
|
||||||
warnings_as_info: data.diagnostics_warningsAsInfo,
|
warnings_as_info: data.diagnostics_warningsAsInfo,
|
||||||
warnings_as_hint: data.diagnostics_warningsAsHint,
|
warnings_as_hint: data.diagnostics_warningsAsHint,
|
||||||
|
@ -405,6 +408,7 @@ config_data! {
|
||||||
completion_postfix_enable: bool = true,
|
completion_postfix_enable: bool = true,
|
||||||
|
|
||||||
diagnostics_enable: bool = true,
|
diagnostics_enable: bool = true,
|
||||||
|
diagnostics_enableExperimental: bool = true,
|
||||||
diagnostics_warningsAsHint: Vec<String> = Vec::new(),
|
diagnostics_warningsAsHint: Vec<String> = Vec::new(),
|
||||||
diagnostics_warningsAsInfo: Vec<String> = Vec::new(),
|
diagnostics_warningsAsInfo: Vec<String> = Vec::new(),
|
||||||
|
|
||||||
|
|
|
@ -200,11 +200,6 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Rust Analyzer",
|
"title": "Rust Analyzer",
|
||||||
"properties": {
|
"properties": {
|
||||||
"rust-analyzer.diagnostics.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"markdownDescription": "Whether to show native rust-analyzer diagnostics."
|
|
||||||
},
|
|
||||||
"rust-analyzer.lruCapacity": {
|
"rust-analyzer.lruCapacity": {
|
||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
|
@ -579,6 +574,16 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"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": {
|
"rust-analyzer.diagnostics.warningsAsInfo": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"uniqueItems": true,
|
"uniqueItems": true,
|
||||||
|
|
Loading…
Reference in a new issue