-
Notifications
You must be signed in to change notification settings - Fork 511
pipelineIndentationStyle feature causes premature un-indentation #1840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Formatting in the PowerShell is provided by PSScriptAnalyzer. This regression was identified and fixed in that project in PowerShell/PSScriptAnalyzer#1191. It will be available with the next PSScriptAnalzyer release, which should fix this problem when installed on your module path. We actually deliberately set the default in the extension to lessen the impact of this regression. |
Verified the fix. described by @rjmholt . After running |
@geeeyetee thanks for verifying! |
I'm still seeing premature un-indentation when the pipeline includes script blocks like in the case of ForEach-Object. |
System Details
System Details Output
Issue Description
Setting powershell.codeFormatting.pipelineIndentationStyle to "IncreaseIndentationForFirstPipeline" or "IncreaseIndentationAfterEveryPipeline" causes every line after a single-line pipeline to be un-indented by an extra level. Setting the value to the default "NoIndentation" value, pipelines are ignored and indentation behaviour returns to that which was provided in the previous release of vscode-PowerShell.
Use this code for example:
Expected Behaviour
If a line contains a complete pipeline (i.e., one that does not continue on the following line), the following line should be at the same indentation level unless it closes a code or evaluation block as per normal indentation rules:
Actual Behaviour
Each complete, single-line pipeline removes one indentation level for all lines following it, in addition to normal end-block un-indentation:
Attached Logs
Logs will be send directly.
The text was updated successfully, but these errors were encountered: