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

fix: Always include quickfixes for diagnostics, even when diagnostics are disabled
This commit is contained in:
Lukas Wirth 2025-06-06 05:35:52 +00:00 committed by GitHub
commit cad9cc97e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -1597,6 +1597,16 @@ impl Config {
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 {
self.procMacro_enable().to_owned() && self.procMacro_attributes_enable().to_owned()
}

View file

@ -1439,7 +1439,7 @@ pub(crate) fn handle_code_action(
};
let assists = snap.analysis.assists_with_fixes(
&assists_config,
&snap.config.diagnostics(Some(source_root)),
&snap.config.diagnostic_fixes(Some(source_root)),
resolve,
frange,
)?;
@ -1530,7 +1530,7 @@ pub(crate) fn handle_code_action_resolve(
let assists = snap.analysis.assists_with_fixes(
&assists_config,
&snap.config.diagnostics(Some(source_root)),
&snap.config.diagnostic_fixes(Some(source_root)),
AssistResolveStrategy::Single(assist_resolve),
frange,
)?;