Skip to content

powershell.codeFormatting.whitespaceBetweenParameters removes more than just whitespace #1613

@ghvanderweg

Description

@ghvanderweg
  • VS Code 1.50.1
  • ms-vscode.powershell v2020.6.0
  • Tested with both PowerShell 7.0.3 and 5.1
  • Windows 10.0.19041

Enabling the powershell.codeFormatting.whitespaceBetweenParameters setting causes the formatter to remove more than just whitespace in some cases.

For example, if you use an inline hashtable as the argument for a parameter, it will remove the = characters from the hashtable:

formatter

I also found a case where it removed an apostrophe, breaking a Pester test:

formatter2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions