Skip to content

Possible powershell.codeFormatting.whitespaceAroundOperator bug #1237

@AWahlqvist

Description

@AWahlqvist

Issue Description

Not sure if this is an actual bug or not, but consider this example when setting powershell.codeFormatting.whitespaceAroundOperator to true:

$numberOfDaysToSubtract = 10
(Get-Date).AddDays(-$numberOfDaysToSubtract)

When using the "auto-formatter", VSCode changes it to:

$numberOfDaysToSubtract = 10
(Get-Date).AddDays( - $numberOfDaysToSubtract)

Is that the expected behavior? It does work of course, but I've never seen it written like that ever, so wanted to confirm if it's intented.

Thanks!

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