You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we have added code action kinds we could denote them to run on save. Similar to the new command a new setting could exists, e.g. editor.onSaveCodeaction: [quickfix.cleanup, etc.]
Reacted by Alkor San, Baptiste Darthenay, Alexander, Eli Goodman and Ahmed W.
I think I'd prefer option 1. We could help with the discoverability by adding the predefined code action kinds to the json-schema. It's also more similar to the keybindings story we have around code actions.
Activity
mjbvz commentedon Apr 16, 2018
A few potential designs for this feature:
editor.onSaveCodeactionUser SettingAdd a user setting that lists code action kinds that should be run on save.
Pro
Con
"[java]": { "editor.onSaveCodeaction": [...]})Add a new
CodeAction.runOnSavepropertyAdd a
runOnSaveproperty to theCodeActionclass. Use this property to determine which code actions to run on savePro
runOnSaveproperty could be controlled by a more explicit setting such as"typescript.organizeImports.runOnSave": trueCon
"typescript.organizeImports.runOnSave": trueOther open questions
jrieken commentedon Apr 17, 2018
I think I'd prefer option 1. We could help with the discoverability by adding the predefined code action kinds to the json-schema. It's also more similar to the keybindings story we have around code actions.
Add editor.codeActionsOnSave (#48086)