PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.71k stars 492 forks source link

Formatter ignores pipelineIndentationStyle #5044

Open github-account1111 opened 2 months ago

github-account1111 commented 2 months ago

Prerequisites

Summary

The setting in question says:

IncreaseIndentationAfterEveryPipeline: Indent more after the first pipeline and keep this indentation. Example:

foo |
    bar |
        baz

That does not happen. Instead, I get

foo |
bar |
baz

PowerShell Version

PSVersionTable : The term 'PSVersionTable' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ PSVersionTable; $Host
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (PSVersionTable:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Name             : ConsoleHost
Version          : 5.1.22621.4111
InstanceId       : 6fce9dd9-a19f-404e-9d8b-b724ba96b14c
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.92.2
fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
x64

Extension Version

ms-vscode.powershell@2024.2.2

Steps to Reproduce

Add "powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline", to settings.json.

Visuals

https://github.com/user-attachments/assets/76be17ae-6909-437d-9917-02606d995645

Logs

No response

andyleejordan commented 2 months ago

Have you tried PowerShell 7 instead of 5.1?