System Details
Manjaro Linux:
### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64
### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
### PSES version: 2.3.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Linux 5.12.2-1-MANJARO PowerShell/vscode-powershell#1 SMP PREEMPT Fri May 7 17:53:15 UTC 2021
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Windows 10 Enterprise:
### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64
### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
### PSES version: 2.4.1.0
### PowerShell version:
Name Value
---- -----
PSVersion 5.1.19041.906
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.906
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
When using IncreaseIndentationForFirstPipeline or IncreaseIndentationAfterEveryPipeline as multiline pipeline indentation style the code is formatted inproperly when inside a Scriptblock which also has pipeline indents.
Examples are with IncreaseIndentationForFirstPipeline and show some Pseudo-Powershell.
Expected Behaviour
# if OTBS and IncreaseIndentationForFirstPipeline is selected this code won't be reformatted as it is already "correct"
$Test = $SomeValues |
Select-Object Some, Values |
Sort-Object -Property Values
if ($Test) {
#Do stuff with test
}
# this should also be considered correct and not getting reformated
Test-Scriptblock -Scriptblock {
$Test = $SomeValues |
Select-Object Some, Values |
Sort-Object -Property Values
if ($Test) {
#Do stuff with test
}
} -PassThru |
Run-Scriptblock
Actual Behaviour
# as expected nothing was reformatted
$Test = $SomeValues |
Select-Object Some, Values |
Sort-Object -Property Values
if ($Test) {
#Do stuff with test
}
# but here the indentiation does not stop at sort-object (..) but rather indents everything that follows too
Test-Scriptblock -Scriptblock {
$Test = $SomeValues |
Select-Object Some, Values |
Sort-Object -Property Values
if ($Test) {
#Do stuff with test
}
} -PassThru |
Run-Scriptblock
# with IncreaseIndentationAfterEveryPipeline the same incorrect indentation will be applied
Test-Scriptblock -Scriptblock {
$Test = $SomeValues |
Select-Object Some, Values |
Sort-Object -Property Values
if ($Test) {
#Do stuff with test
}
} -PassThru |
Run-Scriptblock
Attached Logs
System Details
Manjaro Linux:
Windows 10 Enterprise:
Issue Description
When using
IncreaseIndentationForFirstPipelineorIncreaseIndentationAfterEveryPipelineas multiline pipeline indentation style the code is formatted inproperly when inside a Scriptblock which also has pipeline indents.Examples are with
IncreaseIndentationForFirstPipelineand show some Pseudo-Powershell.Expected Behaviour
Actual Behaviour
Attached Logs