Skip to content

Formatting .where and .foreach methods is incorrect #1168

Open
@DarkLite1

Description

@DarkLite1

When using the methods .where and .foreach in VS Code there's an incorrect indentation of the closing brackets and a space is added after the method.

Expected behavior

@().foreach({

})

Actual behavior

@().foreach( {

    })

image

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.14409.1018
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1018
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.17.1

Related to an issue in the PowerShell repo.

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