@@ -1745,74 +1745,6 @@ WARNING: `{buffer_path}` should not be used to direct your formatter to read fro
Here `rust-analyzer` will be used first to format the code, followed by a call of sed.
If any of the formatters fails, the subsequent ones will still be executed.
-## Code Actions On Format--- Description: The code actions to perform with the primary language server when formatting the buffer.-- Setting: `code_actions_on_format`-- Default: `{}`, except for Go it's `{ "source.organizeImports": true }`--**Examples**--<!---TBD: Add Python Ruff source.organizeImports example--->--1. Organize imports on format in TypeScript and TSX buffers:--```json-{- "languages": {- "TypeScript": {- "code_actions_on_format": {- "source.organizeImports": true- }- },- "TSX": {- "code_actions_on_format": {- "source.organizeImports": true- }- }- }-}-```--2. Run ESLint `fixAll` code action when formatting:--```json-{- "languages": {- "JavaScript": {- "code_actions_on_format": {- "source.fixAll.eslint": true- }- }- }-}-```--3. Run only a single ESLint rule when using `fixAll`:--```json-{- "languages": {- "JavaScript": {- "code_actions_on_format": {- "source.fixAll.eslint": true- }- }- },- "lsp": {- "eslint": {- "settings": {- "codeActionOnSave": {- "rules": ["import/order"]- }- }- }- }-}-```-
## Auto close
- Description: Whether to automatically add matching closing characters when typing opening parenthesis, bracket, brace, single or double quote characters.
@@ -49,8 +49,8 @@ You can configure Zed to format code using `eslint --fix` by running the ESLint
{
"languages": {
"JavaScript": {
- "code_actions_on_format": {- "source.fixAll.eslint": true
+ "formatter": {
+ "code_action": "source.fixAll.eslint"
}
}
}
@@ -63,8 +63,8 @@ You can also only execute a single ESLint rule when using `fixAll`:
{
"languages": {
"JavaScript": {
- "code_actions_on_format": {- "source.fixAll.eslint": true
+ "formatter": {
+ "code_action": "source.fixAll.eslint"
}
}
},