-
Notifications
You must be signed in to change notification settings - Fork 6k
Deprecate code actions on format setting #39983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b24c95c to
3c28ff0
Compare
probably-neb
added a commit
that referenced
this pull request
Oct 10, 2025
Closes #ISSUE
Release Notes:
- settings: Deprecated `code_actions_on_format` in favor of specifying
code actions to run on format inline in the `formatter` array.
Previously, you would configure code actions to run on format like this:
```json
{
"code_actions_on_format": {
"source.organizeImports": true,
"source.fixAll.eslint": true
}
}
```
This has been migrated to the new format:
```json
{
"formatter": [
{
"code_action": "source.organizeImports"
},
{
"code_action": "source.fixAll.eslint"
}
]
}
```
This change will be automatically migrated for you. If you had an
existing `formatter` setting, the code actions are prepended to your
formatter array (matching the existing behavior). This migration applies
to both global settings and language-specific settings
probably-neb
added a commit
that referenced
this pull request
Oct 11, 2025
probably-neb
added a commit
that referenced
this pull request
Oct 11, 2025
…0040) Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
This was referenced Oct 13, 2025
probably-neb
added a commit
that referenced
this pull request
Oct 13, 2025
Follow up for: #39983 and #40040 (comment) Previously it was possible to have formatting done using prettier or language server using `"formatter": "auto"` and specify code actions to apply on format using the `"code_actions_on_format"` setting. However, post #39983 this is no longer possible due to the removal of the `"code_actions_on_format"` setting. To rectify this regression, this PR makes it so that the `"auto"` and `"language_server"` strings that were previously only allowed as top level values on the `"formatter"` key, are now allowed as format steps like so: ```json { "formatter": ["auto", "language_server"] } ``` Therefore to replicate the previous behavior using `"auto"` and `"code_actions_on_format"` you can use the following configuration: ```json { "formatter": [{"code_action": ...}, "auto"] } ``` Release Notes: - N/A *or* Added/Fixed/Improved ...
probably-neb
added a commit
that referenced
this pull request
Oct 13, 2025
Follow up for: #39983 and #40040 (comment) Previously it was possible to have formatting done using prettier or language server using `"formatter": "auto"` and specify code actions to apply on format using the `"code_actions_on_format"` setting. However, post #39983 this is no longer possible due to the removal of the `"code_actions_on_format"` setting. To rectify this regression, this PR makes it so that the `"auto"` and `"language_server"` strings that were previously only allowed as top level values on the `"formatter"` key, are now allowed as format steps like so: ```json { "formatter": ["auto", "language_server"] } ``` Therefore to replicate the previous behavior using `"auto"` and `"code_actions_on_format"` you can use the following configuration: ```json { "formatter": [{"code_action": ...}, "auto"] } ``` Release Notes: - N/A *or* Added/Fixed/Improved ...
probably-neb
added a commit
that referenced
this pull request
Oct 16, 2025
This reverts commit 3ba4b84. Co-authored-by: Cole Miller <[email protected]>
probably-neb
added a commit
that referenced
this pull request
Oct 16, 2025
Closes #40334 This reverts the change made in #39983, and includes a replacement migration that will transform formatter settings values consisting of only `code_action` format steps into the previously deprecated `code_actions_on_format` in an attempt to restore the behavior to what it was before the migration that deprecated `code_actions_on_format`. This PR will result in a modified order in the `code_actions_on_format` setting if it existed, however the decision was made to explicitly ignore this for now, as this PR is primarily targeting users who have already had the deprecation migration run, and no longer have the `code_actions_on_format` key Release Notes: - Fixed an issue with a settings migration that deprecated the `code_actions_on_format` setting. The `code_actions_on_format` setting has been un-deprecated, and affected users will have the bad migration rolled back with an updated migration --------- Co-authored-by: Cole Miller <[email protected]> Co-authored-by: Mikayla Maki <[email protected]> Co-authored-by: HactarCE <[email protected]>
probably-neb
added a commit
that referenced
this pull request
Oct 16, 2025
Closes #40334 This reverts the change made in #39983, and includes a replacement migration that will transform formatter settings values consisting of only `code_action` format steps into the previously deprecated `code_actions_on_format` in an attempt to restore the behavior to what it was before the migration that deprecated `code_actions_on_format`. This PR will result in a modified order in the `code_actions_on_format` setting if it existed, however the decision was made to explicitly ignore this for now, as this PR is primarily targeting users who have already had the deprecation migration run, and no longer have the `code_actions_on_format` key Release Notes: - Fixed an issue with a settings migration that deprecated the `code_actions_on_format` setting. The `code_actions_on_format` setting has been un-deprecated, and affected users will have the bad migration rolled back with an updated migration --------- Co-authored-by: Cole Miller <[email protected]> Co-authored-by: Mikayla Maki <[email protected]> Co-authored-by: HactarCE <[email protected]>
probably-neb
added a commit
that referenced
this pull request
Oct 16, 2025
Closes #40334 This reverts the change made in #39983, and includes a replacement migration that will transform formatter settings values consisting of only `code_action` format steps into the previously deprecated `code_actions_on_format` in an attempt to restore the behavior to what it was before the migration that deprecated `code_actions_on_format`. This PR will result in a modified order in the `code_actions_on_format` setting if it existed, however the decision was made to explicitly ignore this for now, as this PR is primarily targeting users who have already had the deprecation migration run, and no longer have the `code_actions_on_format` key Release Notes: - Fixed an issue with a settings migration that deprecated the `code_actions_on_format` setting. The `code_actions_on_format` setting has been un-deprecated, and affected users will have the bad migration rolled back with an updated migration --------- Co-authored-by: Cole Miller <[email protected]> Co-authored-by: Mikayla Maki <[email protected]> Co-authored-by: HactarCE <[email protected]>
probably-neb
added a commit
that referenced
this pull request
Oct 16, 2025
Closes #40334 This reverts the change made in #39983, and includes a replacement migration that will transform formatter settings values consisting of only `code_action` format steps into the previously deprecated `code_actions_on_format` in an attempt to restore the behavior to what it was before the migration that deprecated `code_actions_on_format`. This PR will result in a modified order in the `code_actions_on_format` setting if it existed, however the decision was made to explicitly ignore this for now, as this PR is primarily targeting users who have already had the deprecation migration run, and no longer have the `code_actions_on_format` key Release Notes: - Fixed an issue with a settings migration that deprecated the `code_actions_on_format` setting. The `code_actions_on_format` setting has been un-deprecated, and affected users will have the bad migration rolled back with an updated migration --------- Co-authored-by: Cole Miller <[email protected]> Co-authored-by: Mikayla Maki <[email protected]> Co-authored-by: HactarCE <[email protected]>
xipeng-jin
pushed a commit
to xipeng-jin/zed
that referenced
this pull request
Oct 17, 2025
Closes zed-industries#40334 This reverts the change made in zed-industries#39983, and includes a replacement migration that will transform formatter settings values consisting of only `code_action` format steps into the previously deprecated `code_actions_on_format` in an attempt to restore the behavior to what it was before the migration that deprecated `code_actions_on_format`. This PR will result in a modified order in the `code_actions_on_format` setting if it existed, however the decision was made to explicitly ignore this for now, as this PR is primarily targeting users who have already had the deprecation migration run, and no longer have the `code_actions_on_format` key Release Notes: - Fixed an issue with a settings migration that deprecated the `code_actions_on_format` setting. The `code_actions_on_format` setting has been un-deprecated, and affected users will have the bad migration rolled back with an updated migration --------- Co-authored-by: Cole Miller <[email protected]> Co-authored-by: Mikayla Maki <[email protected]> Co-authored-by: HactarCE <[email protected]>
P1n3appl3
pushed a commit
to P1n3appl3/zed
that referenced
this pull request
Oct 18, 2025
…ndustries#40113) Follow up for: zed-industries#39983 and zed-industries#40040 (comment) Previously it was possible to have formatting done using prettier or language server using `"formatter": "auto"` and specify code actions to apply on format using the `"code_actions_on_format"` setting. However, post zed-industries#39983 this is no longer possible due to the removal of the `"code_actions_on_format"` setting. To rectify this regression, this PR makes it so that the `"auto"` and `"language_server"` strings that were previously only allowed as top level values on the `"formatter"` key, are now allowed as format steps like so: ```json { "formatter": ["auto", "language_server"] } ``` Therefore to replicate the previous behavior using `"auto"` and `"code_actions_on_format"` you can use the following configuration: ```json { "formatter": [{"code_action": ...}, "auto"] } ``` Release Notes: - N/A *or* Added/Fixed/Improved ...
P1n3appl3
pushed a commit
to P1n3appl3/zed
that referenced
this pull request
Oct 18, 2025
Closes zed-industries#40334 This reverts the change made in zed-industries#39983, and includes a replacement migration that will transform formatter settings values consisting of only `code_action` format steps into the previously deprecated `code_actions_on_format` in an attempt to restore the behavior to what it was before the migration that deprecated `code_actions_on_format`. This PR will result in a modified order in the `code_actions_on_format` setting if it existed, however the decision was made to explicitly ignore this for now, as this PR is primarily targeting users who have already had the deprecation migration run, and no longer have the `code_actions_on_format` key Release Notes: - Fixed an issue with a settings migration that deprecated the `code_actions_on_format` setting. The `code_actions_on_format` setting has been un-deprecated, and affected users will have the bad migration rolled back with an updated migration --------- Co-authored-by: Cole Miller <[email protected]> Co-authored-by: Mikayla Maki <[email protected]> Co-authored-by: HactarCE <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #ISSUE
Release Notes:
code_actions_on_formatin favor of specifying code actions to run on format inline in theformatterarray.Previously, you would configure code actions to run on format like this:
{ "code_actions_on_format": { "source.organizeImports": true, "source.fixAll.eslint": true } }This has been migrated to the new format:
{ "formatter": [ { "code_action": "source.organizeImports" }, { "code_action": "source.fixAll.eslint" } ] }This change will be automatically migrated for you. If you had an existing
formattersetting, the code actions are prepended to your formatter array (matching the existing behavior). This migration applies to both global settings and language-specific settings