Open AlessandroVol23 opened 6 months ago
I think there may be some missing pieces here preventing us from being able to do this through the editor (not entirely sure, to be honest), but a workaround would be to set up a custom formatting task and assign it to a keybinding.
Not sure if this counts as a workaround, but I'm executing this on save with the following:
"TypeScript": {
"code_actions_on_format": {
"source.organizeImports": true,
},
"format_on_save": {
"external": {
"command": "prettier",
"arguments": ["--stdin-filepath", "{buffer_path}"]
}
}
}
in the language_overrides section of my config file.
I would love to be able to add and "source.removeUnusedImports": true
too, but there's some bug that messes up the imports and some get duplicated.
Check for existing issues
Describe the feature
In VsCode I use the shortcut (CMD + SHIFT + O) for organizing imports a lot. I can't find the shortcut to set this one custom in the keymap.
I know I can do it with the lightning bolt or CMD + . Is there any way to set a shortcut for organizing imports directly as well?
If applicable, add mockups / screenshots to help present your vision of the feature
No response