Update setup instructions for Zed 0.208.0+ (#20902)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
Justin Su 2025-10-16 03:39:48 -04:00 committed by GitHub
parent cb98933c50
commit fe4e3e2e75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -464,16 +464,9 @@ under the [`lsp.ruff.initialization_options.settings`](https://zed.dev/docs/conf
} }
``` ```
!!! note
Support for multiple formatters for a given language is only available in Zed version
`0.146.0` and later.
You can configure Ruff to format Python code on-save by registering the Ruff formatter You can configure Ruff to format Python code on-save by registering the Ruff formatter
and enabling the [`format_on_save`](https://zed.dev/docs/configuring-zed#format-on-save) setting: and enabling the [`format_on_save`](https://zed.dev/docs/configuring-zed#format-on-save) setting:
=== "Zed 0.146.0+"
```json ```json
{ {
"languages": { "languages": {
@ -495,8 +488,6 @@ and enabling the [`format_on_save`](https://zed.dev/docs/configuring-zed#format-
You can configure Ruff to fix lint violations and/or organize imports on-save by enabling the You can configure Ruff to fix lint violations and/or organize imports on-save by enabling the
`source.fixAll.ruff` and `source.organizeImports.ruff` code actions respectively: `source.fixAll.ruff` and `source.organizeImports.ruff` code actions respectively:
=== "Zed 0.146.0+"
```json ```json
{ {
"languages": { "languages": {
@ -504,14 +495,10 @@ You can configure Ruff to fix lint violations and/or organize imports on-save by
"language_servers": ["ruff"], "language_servers": ["ruff"],
"format_on_save": "on", "format_on_save": "on",
"formatter": [ "formatter": [
{
"code_actions": {
// Fix all auto-fixable lint violations // Fix all auto-fixable lint violations
"source.fixAll.ruff": true, { "code_action": "source.fixAll.ruff" },
// Organize imports // Organize imports
"source.organizeImports.ruff": true { "code_action": "source.organizeImports.ruff" }
}
}
] ]
} }
} }
@ -528,8 +515,6 @@ following `settings.json`:
ensure that the formatter takes care of any remaining style issues after the code actions have ensure that the formatter takes care of any remaining style issues after the code actions have
been applied. been applied.
=== "Zed 0.146.0+"
```json ```json
{ {
"languages": { "languages": {
@ -537,17 +522,9 @@ following `settings.json`:
"language_servers": ["ruff"], "language_servers": ["ruff"],
"format_on_save": "on", "format_on_save": "on",
"formatter": [ "formatter": [
{ { "code_action": "source.fixAll.ruff" },
"code_actions": { { "code_action": "source.organizeImports.ruff" },
"source.organizeImports.ruff": true, { "language_server": { "name": "ruff" } }
"source.fixAll.ruff": true
}
},
{
"language_server": {
"name": "ruff"
}
}
] ]
} }
} }