mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
eb231d0449
This fixes #8992 and solves a problem that ESLint/Prettier/... users have been running into: They want to format _only_ with ESLint, which is *not* a primary language server (so `formatter: language server` does not help) and it is not a formatter. What they want to use is what they get when they have configured something like this: ```json { "languages": { "JavaScript": { "code_actions_on_format": { "source.fixAll.eslint": true } } } } ``` BUT they don't want to run the formatter. So what this PR does is to add a new formatter type: `code_actions`. With that, users can only use code actions to format: ```json { "languages": { "JavaScript": { "formatter": { "code_actions": { "source.fixAll.eslint": true } } } } } ``` This means that when formatting (via `editor: format` or on-save) only the code actions that are specified are being executed, no formatter. Release Notes: - Added a new `formatter`/`format_on_save` option: `code_actions`. When configured, this uses language server code actions to format a buffer. This can be used if one wants to, for example, format a buffer with ESLint and *not* run prettier or another formatter afterwards. Example configuration: `{"languages": {"JavaScript": {"formatter": {"code_actions": {"source.fixAll.eslint": true}}}}}` ([#8992](https://github.com/zed-industries/zed/issues/8992)). --------- Co-authored-by: JH Chabran <jh@chabran.fr> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-GPL |