Reputation: 31171
In the JavaScript editor of Visual Studio Code, I would like to add a white space between the function name and the open bracket (when function
is defined).
function name () // <- whitespace before brackets
{
...
}
But when I press [Enter]
the white space is automatically removed.
Is it possible to keep it (or to auto-instert one white space), without disabling the auto-formatter?
I know I can use [Ctrk + Z]
to remove the last auto-formatting but I'd like to avoid that.
Upvotes: 1
Views: 2233
Reputation: 162
Add this to your settings.json
and format the file using Shift + Alt + F
"javascript.format.insertSpaceBeforeFunctionParenthesis": true
Or set it in settings menu
Works in VSCode 1.64
Upvotes: 2
Reputation: 168
function name () {
...
}
Is this code you need? Just use the shortcut: Shift + Alt + F
Upvotes: 2