Fix formatter: "auto" to skip language servers that can't format#50661
Conversation
When multiple language servers are registered for a language (e.g., Tombi and Dependi for TOML), the `Current` specifier blindly picked the first server. If that server didn't support formatting, Zed silently did nothing instead of trying the next server. Add a `server_supports_formatting` helper that checks document formatting and range formatting capabilities, and update the `Current` arm to use `find` instead of `first` so it selects a server that actually advertises formatting support. Closes zed-industries#50631
|
Hi @SomeoneToIgnore, could you please rerun the |
|
Seems like the Windows CI failure is unrelated to this PR's changes, It's a flaky timeout on On All other 3347 tests pass, including on Linux and macOS. What you think, @SomeoneToIgnore? |
|
|
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Great, thank you for this.
Closes #50631
Before you mark this PR as ready for review, make sure that you have:
Release Notes:
formatter: "auto"silently doing nothing when the first language server for a language doesn't support formatting (e.g., Dependi before Tombi forTOML).