Closed
Description
System Details
- Operating system name and version: Windows 10 Pro
- VS Code version: 1.10.2
- PowerShell extension version: 0.10
- Output from
$PSVersionTable
:
Name Value
---- -----
PSVersion 5.1.14393.953
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.953
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
Each open brace or paren on the same line is being counted as in indent trigger resulting in too many indents. ValidateScript is the best example:
param (
[Parameter(Mandatory, Position = 0, ValueFromPipeline)]
[ValidateScript({
if ($_ -is [System.IO.FileInfo] -or $_ -is [string]) {
if ([System.IO.Path]::GetExtension($_) -ne '.xml' -and [System.IO.Path]::GetExtension($_) -ne '.gz') {
throw 'Invalid file extension specified for the InputObject parameter.'
}
}
else {
throw 'Invalid input object specified.'
}
$true
})]
[Object[]]$InputObject
)
becomes:
param (
[Parameter(Mandatory, Position = 0, ValueFromPipeline)]
[ValidateScript({
if ($_ -is [System.IO.FileInfo] -or $_ -is [string]) {
if ([System.IO.Path]::GetExtension($_) -ne '.xml' -and [System.IO.Path]::GetExtension($_) -ne '.gz') {
throw 'Invalid file extension specified for the InputObject parameter.'
}
}
else {
throw 'Invalid input object specified.'
}
$true
})]
[Object[]]$InputObject
)
Note the closing '})]' is also indented. I believe the brace/paren characters should only be counted once for indent calculations if they are on the same line?