There is no shortcut for "add all missing imports" by default. So we need add it manually.
See this link from vscode official.
You can simulate the action using right clicking the source code and trigger the action. As you can see, it is an action from what they call "Source Action".
As introduced in the link, we can add the action as a shortcut. The article is using the key binding as ctrl+shift+i
but I used shift+cmd+i
instead since I'm using Mac in which the add missing import
shortcut for a single expression is cmd+i
.
[
{
"key": "shift+cmd+i",
"command": "editor.action.sourceAction",
"args": {
"kind": "source.addMissingImports",
"apply": "first"
}
}
]