Add "code_actions_on_format" (#7860)

This lets Go programmers configure `"code_actions_on_format": {
  "source.organizeImports": true,
}` so that they don't have to manage their imports manually

I landed on `code_actions_on_format` instead of `code_actions_on_save`
(the
VSCode version of this) because I want to run these when I explicitly
format
(and not if `format_on_save` is disabled).

Co-Authored-By: Thorsten <thorsten@zed.dev>

Release Notes:

- Added `"code_actions_on_format"` to control additional formatting
steps on format/save
([#5232](https://github.com/zed-industries/zed/issues/5232)).
- Added a `"code_actions_on_format"` of `"source.organizeImports"` for
Go ([#4886](https://github.com/zed-industries/zed/issues/4886)).

Co-authored-by: Thorsten <thorsten@zed.dev>
This commit is contained in:
Conrad Irwin 2024-02-15 14:19:57 -07:00 committed by GitHub
parent e1ae0d46da
commit ea322e1d1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 221 additions and 13 deletions

View file

@ -482,6 +482,7 @@
"deno": {
"enable": false
},
"code_actions_on_format": {},
// Different settings for specific languages.
"languages": {
"Plain Text": {
@ -492,7 +493,10 @@
},
"Go": {
"tab_size": 4,
"hard_tabs": true
"hard_tabs": true,
"code_actions_on_format": {
"source.organizeImports": true
}
},
"Markdown": {
"soft_wrap": "preferred_line_length"