helix
helix copied to clipboard
Code Actions on save
Discussed in https://github.com/helix-editor/helix/discussions/1540
Originally posted by kevinsjoberg January 19, 2022
Helix currently supports running Code Actions manually by pressing <space>+a. Some language servers also supports running specific code actions on save, e.g., typescript-language-server and gopls.
Preferably, we extend the language server configuration to allow for specifying code actions to run on save. The actions themselves would then run asynchronously, similar to what we already do for auto formatting.
The VSCode config seems to be:
"[go]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
source.organizeImports and now source.sortImports (https://code.visualstudio.com/updates/v1_57#_sort-imports-source-action) seem to be the standardized name for this behavior and could be auto-enabled if the LSP offers them.
Really want to have this feature w
Any news on this? I rely heavily on removing unused imports on save when working on typescript projects.
That will be great to have for Typescript as well.