diff options
| author | Lukas Wirth <me@lukaswirth.dev> | 2025-06-06 05:35:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-06 05:35:52 +0000 |
| commit | 98a4508e5727b431e59d520cef32902fbba05030 (patch) | |
| tree | 8ba667062033c2ee70f56cff7b8e26e1aedff0d2 /src | |
| parent | c8b0b081f4d961e808d6977cf1ea1ee92e0eb3ee (diff) | |
| parent | 0713466a2e7ce9a162de32f920700d81f2882eae (diff) | |
| download | rust-98a4508e5727b431e59d520cef32902fbba05030.tar.gz rust-98a4508e5727b431e59d520cef32902fbba05030.zip | |
Merge pull request #19935 from ChayimFriedman2/exp-diag-show-quickfix
fix: Always include quickfixes for diagnostics, even when diagnostics are disabled
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs | 10 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs index 96be6726ccb..5cbea9c2b3d 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs @@ -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() } diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs index 69983a67626..6d46ce68ed4 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs @@ -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, )?; |
