mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 10:58:02 +00:00
Merge pull request #19935 from ChayimFriedman2/exp-diag-show-quickfix
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Always include quickfixes for diagnostics, even when diagnostics are disabled
This commit is contained in:
commit
cad9cc97e2
2 changed files with 12 additions and 2 deletions
|
|
@ -1597,6 +1597,16 @@ impl Config {
|
||||||
term_search_borrowck: self.assist_termSearch_borrowcheck(source_root).to_owned(),
|
term_search_borrowck: self.assist_termSearch_borrowcheck(source_root).to_owned(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn diagnostic_fixes(&self, source_root: Option<SourceRootId>) -> DiagnosticsConfig {
|
||||||
|
// We always want to show quickfixes for diagnostics, even when diagnostics/experimental diagnostics are disabled.
|
||||||
|
DiagnosticsConfig {
|
||||||
|
enabled: true,
|
||||||
|
disable_experimental: false,
|
||||||
|
..self.diagnostics(source_root)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn expand_proc_attr_macros(&self) -> bool {
|
pub fn expand_proc_attr_macros(&self) -> bool {
|
||||||
self.procMacro_enable().to_owned() && self.procMacro_attributes_enable().to_owned()
|
self.procMacro_enable().to_owned() && self.procMacro_attributes_enable().to_owned()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1439,7 +1439,7 @@ pub(crate) fn handle_code_action(
|
||||||
};
|
};
|
||||||
let assists = snap.analysis.assists_with_fixes(
|
let assists = snap.analysis.assists_with_fixes(
|
||||||
&assists_config,
|
&assists_config,
|
||||||
&snap.config.diagnostics(Some(source_root)),
|
&snap.config.diagnostic_fixes(Some(source_root)),
|
||||||
resolve,
|
resolve,
|
||||||
frange,
|
frange,
|
||||||
)?;
|
)?;
|
||||||
|
|
@ -1530,7 +1530,7 @@ pub(crate) fn handle_code_action_resolve(
|
||||||
|
|
||||||
let assists = snap.analysis.assists_with_fixes(
|
let assists = snap.analysis.assists_with_fixes(
|
||||||
&assists_config,
|
&assists_config,
|
||||||
&snap.config.diagnostics(Some(source_root)),
|
&snap.config.diagnostic_fixes(Some(source_root)),
|
||||||
AssistResolveStrategy::Single(assist_resolve),
|
AssistResolveStrategy::Single(assist_resolve),
|
||||||
frange,
|
frange,
|
||||||
)?;
|
)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue