Fix language settings formatter regression - formatter list can be a single formatter not wrapped in an array (#33721)

Fixes a regression from #33635

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-07-01 11:47:19 -06:00 committed by GitHub
parent eb74df632b
commit 2ff155d5a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 72 additions and 52 deletions

View file

@ -1405,7 +1405,7 @@ impl LocalLspStore {
let formatters = match (trigger, &settings.format_on_save) {
(FormatTrigger::Save, FormatOnSave::Off) => &[],
(FormatTrigger::Save, FormatOnSave::List(formatters)) => formatters.as_slice(),
(FormatTrigger::Save, FormatOnSave::List(formatters)) => formatters.as_ref(),
(FormatTrigger::Manual, _) | (FormatTrigger::Save, FormatOnSave::On) => {
match &settings.formatter {
SelectedFormatter::Auto => {
@ -1417,7 +1417,7 @@ impl LocalLspStore {
std::slice::from_ref(&Formatter::LanguageServer { name: None })
}
}
SelectedFormatter::List(formatter_list) => formatter_list.as_slice(),
SelectedFormatter::List(formatter_list) => formatter_list.as_ref(),
}
}
};