mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 06:24:56 +00:00
## What Changed - compute range-format support from formatter configuration and language-server capabilities - show `Format Selections` only when at least one selected buffer has a range-capable formatter - keep Prettier-supported range formatting available without depending on LSP support - hide the action for formatter modes that cannot honor selections, such as external-command and code-action formatters - keep the action handler safe by rechecking support and returning early when range formatting is unavailable - restrict capability checks to the servers actually registered for the current buffer - add regression coverage for supported, unsupported, and mixed-server cases - document when `Format Selections` is available in both action docs and user docs Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #25796 Release Notes: - Improved `Format Selections` so it is only shown when the active formatter supports range formatting. Testing I did: Here are the formatters I used: <img width="829" height="434" alt="Screenshot_20260405_102047" src="https://github.com/user-attachments/assets/cae4a238-277e-4188-873f-189e9f098699" /> Note: I've chosen three formatters: 1. Prettier, which supports range formatting 2. clangd (LSP) which also supports range formatting 3. gopls which do not support range formatting [Screencast_20260405_102431.webm](https://github.com/user-attachments/assets/69ce3f95-0b73-46a0-853d-3b5be6329dde) --------- Signed-off-by: Pratik Karki <pratik@prertik.com> Co-authored-by: Kirill Bulatov <kirill@zed.dev> |
||
|---|---|---|
| .. | ||
| ai | ||
| collaboration | ||
| development | ||
| extensions | ||
| languages | ||
| migrate | ||
| reference | ||
| all-actions.md | ||
| appearance.md | ||
| authentication.md | ||
| command-palette.md | ||
| completions.md | ||
| configuring-languages.md | ||
| configuring-zed.md | ||
| debugger.md | ||
| dev-containers.md | ||
| development.md | ||
| diagnostics.md | ||
| editing-code.md | ||
| environment.md | ||
| extensions.md | ||
| finding-navigating.md | ||
| getting-started.md | ||
| git.md | ||
| globs.md | ||
| helix.md | ||
| icon-themes.md | ||
| installation.md | ||
| key-bindings.md | ||
| languages.md | ||
| linux.md | ||
| macos.md | ||
| modelines.md | ||
| multibuffers.md | ||
| outline-panel.md | ||
| performance.md | ||
| quick-start.md | ||
| remote-development.md | ||
| repl.md | ||
| roles.md | ||
| running-testing.md | ||
| semantic-tokens.md | ||
| snippets.md | ||
| SUMMARY.md | ||
| tab-switcher.md | ||
| tasks.md | ||
| telemetry.md | ||
| terminal.md | ||
| themes.md | ||
| toolchains.md | ||
| troubleshooting.md | ||
| uninstall.md | ||
| update.md | ||
| vim.md | ||
| visual-customization.md | ||
| windows.md | ||
| worktree-trust.md | ||