You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatting of code breaks, not closing the indentation where it is logical. The conditions are highlighted in the Steps to reproduce section but it seems to be related to using both the pipe | and parenthesis () in multiple lines.
PowerShell Version
Name Value---- -----PSVersion 7.4.1PSEdition CoreGitCommitId 7.4.1OS Microsoft Windows 10.0.19045Platform Win32NTPSCompatibleVersions {1.0, 2.0, 3.0, 4.0.}PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1WSManStackVersion 3.0
Visual Studio Code Version
1.86.2x64
Extension Version
ms-vscode.powershell@2024.3.0
Steps to Reproduce
Open a new file and paste this code:
1|Select-Object (
$_|Write-Host
)
Write-Host'Indentation is broken'
Format the document
Write-Host is now indented at the same level as the closed parenthesis:
1|Select-Object (
$_|Write-Host
)
Write-Host'Indentation is broken'
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
I can confirm I can repro with this specific setting. The thing with using different non-default settings for pipelineIndentationStyle is that your mileage might vary, it can achieve it in most cases but there are lots of edge cases that is still doesn't get, hence why it's not the default. Still great to raise it so maybe I can later look at seeing whether we can fix that. I've been doing that for a few years now but due to PowerShell's generic nature it's hard to write generic code covering all cases...
Prerequisites
Summary
The formatting of code breaks, not closing the indentation where it is logical. The conditions are highlighted in the
Steps to reproduce
section but it seems to be related to using both the pipe|
and parenthesis()
in multiple lines.PowerShell Version
Visual Studio Code Version
Extension Version
ms-vscode.powershell@2024.3.0
Steps to Reproduce
Write-Host
is now indented at the same level as the closed parenthesis:Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: