Open
Description
Hello
I am looking for a improvment on the current formatting tools by adding a whitespace after open bracket and before closing non empty curly brackets like :
#Actual
$emptyHash = @{ } # an empty Hash
$myHash = @{foo = "bar"}
#Expected
$emptyHash = @{} # an empty Hash
$myHash = @{ foo = "bar" } #whitespace after `{ `and before ` }`
Additional information:
-
I use the PowerShell extension on VS Code to format automaticaly my code on save.
-
My settings.json file:
{
"editor.formatOnSave": true,
"powershell.codeFormatting.preset": "Custom",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.newLineAfterCloseBrace": true,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
"powershell.scriptAnalysis.enable": true,
"files.trimTrailingWhitespace": true,
}
This feature exist on other language :
microsoft/TypeScript#9613 (comment)
Regards,