Closed
Description
System Details
### VSCode version: 1.38.1 b37e54c98e1a74ba89e03073e5a3761284e3ffb0 x64
### VSCode extensions:
aaghabeiki.gitdiffer@0.0.3
akamud.vscode-theme-onelight@2.1.0
amos402.scope-bar@0.2.1
axlan.multiline-find-and-replace@0.0.1
cake-build.cake-vscode@0.12.0
DotJoshJohnson.xml@2.5.0
eamodio.gitlens@10.0.1
GrapeCity.gc-excelviewer@2.1.32
Hyzeta.vscode-theme-github-light@7.9.2
jbockle.jbockle-format-files@3.0.0
jmrog.vscode-nuget-package-manager@1.1.6
ms-azuretools.vscode-azurefunctions@0.18.1
ms-mssql.mssql@1.6.0
ms-vscode.azure-account@0.8.4
ms-vscode.csharp@1.21.4
ms-vscode.powershell@2019.9.0
ms-vscode.vs-keybindings@0.2.0
qub.qub-msbuild@0.6.3
tintoy.msbuild-project-tools@0.2.55
Tyriar.shell-launcher@0.3.0
yzhang.markdown-all-in-one@2.4.2
### PSES version: 1.13.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 5.1.17763.592
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.592
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
Consider the following ps code:
function Get-BuildTelemetry([Parameter(Mandatory)]$Build)
{
@{
tasks = (Invoke-RestMethod $Build._links.timeline.href -UseDefaultCredentials).records | Where-Object {
$_.type -eq 'task'
} | Sort-Object 'startTime'
dimensions = @{
id = $Build.id
}
}
}
Formatting the code transforms it to:
function Get-BuildTelemetry([Parameter(Mandatory)]$Build)
{
@{
tasks = (Invoke-RestMethod $Build._links.timeline.href -UseDefaultCredentials).records | Where-Object {
$_.type -eq 'task'
} | Sort-Object 'startTime'
dimensions = @{
id = $Build.id
}
}
}
Which is wrong.
My user settings are:
{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true
}
I am forced to disable auto formatting at all.