vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Formatter ignores pipelineIndentationStyle

Open github-account1111 opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all open and closed issues to ensure it has not already been reported.
  • [X] I have read the troubleshooting guide.
  • [X] I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • [ ] I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • [ ] If this is a security issue, I have read the security issue reporting guidance.

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

[email protected]

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

github-account1111 avatar Sep 16 '24 14:09 github-account1111

Have you tried PowerShell 7 instead of 5.1?

andyleejordan avatar Sep 16 '24 19:09 andyleejordan

This issue has been labeled as needing feedback and has not had any activity a week. It has been closed for housekeeping purposes.

github-actions[bot] avatar Mar 04 '25 21:03 github-actions[bot]