-
Notifications
You must be signed in to change notification settings - Fork 520
Closed
Labels
Description
System Details
Windows 10 64-bit
code -v:
1.17.2
b813d12980308015bcd2b3a2f6efa5c810c33ba5
$pseditor.EditorServicesVersion:
Major Minor Build Revision
----- ----- ----- --------
1 5 0 0
code --list-extensions --show-versions:
jasonn-porch.gitlab-mr@1.3.0
ms-mssql.mssql@1.2.0
ms-vscode.PowerShell@1.5.0
$PSVersionTable:
Name Value
---- -----
PSVersion 5.1.16299.19
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.19
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
I am experiencing a problem with curly brackets auto-formatting in if and for blocks (could be other blocks affected as well): If there is a comment on a line where the block starts and the opening curly bracket is on the next line, the bracket is placed on the first line, after the comment, which breaks the block.
if ($true) # comment
{
echo 'OK'
}
foreach ($a in $b) #comment
{
echo $a
}
Expected Result
if ($true) { # comment
echo 'OK'
}
foreach ($a in $b) { #comment
echo $a
}
Actual Result
if ($true) # comment {
echo 'OK'
}
foreach ($a in $b) #comment {
echo $a
}