Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop VSCode auto formatting from deleting spaces inside parentheses?

for example, when I write

foo( bar ){}  

it will be formatted to

foo(bar){}  

how do I make it keep the 2 spaces?

Edit:
This is a different question from How to change indentation in Visual Studio Code?

like image 633
David C Avatar asked Sep 06 '25 02:09

David C


1 Answers

Putting

 "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true

in the settings json solved the problem.

like image 80
David C Avatar answered Sep 09 '25 17:09

David C