Reputation: 4084
I enter the following code:
function actionToAppState(action) {
switch (action) {
case START:
doSomething()
}
}
The doSomething()
line should be indented by one more tab. Indeed, I select the function and format it with Ctrl+K+F:
function actionToAppState(action) {
switch (action) {
case START:
doSomething()
}
}
Why isn't that line indented as I type? How can I fix it?
Upvotes: 0
Views: 3092
Reputation: 1209
You can try this code formatting shortcuts
VSCode on Windows - Shift + Alt + F
VSCode on MacOS - Shift + Option + F
VSCode on Ubuntu - Ctrl + Shift + I
You can also customize this shortcut using preference setting if needed.
Upvotes: 0
Reputation: 18472
Add this to "User Settings":
editor.formatOnType: true
Or more precisely, open File -> Preferences -> Settings, then search for "formatontype", then set editor.formatOnType
to true
.
Upvotes: 3