Skip to content

whitespaceBeforeOpenBrace option makes weird formatting for array methods #1681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
t3mi opened this issue May 13, 2021 · 2 comments
Closed

Comments

@t3mi
Copy link

t3mi commented May 13, 2021

System Details

System Details Output

### VSCode version: 1.56.1 e713fe9b05fc24facbec8f34fb1017133858842b x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]

### PSES version: 2.3.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

I am experiencing a problem with PowerShell script formatting where array methods are present. By default, rule powershell.codeFormatting.whitespaceBeforeOpenBrace is enabled and its producing weird formatting for such scenario. Kindly ask to consider either disabling that inside the methods parentheses or have additional rule to make the formatting look even.

Expected Behaviour

Whitespaces should not be changed between different type of braces or should be even.

$a = @(0..3)
$a.ForEach({ $_ * $_ })

or

$a = @(0..3)
$a.ForEach( { $_ * $_ } )

Actual Behaviour

$a = @(0..3)
$a.ForEach( { $_ * $_ })
@SydneyhSmith SydneyhSmith transferred this issue from PowerShell/vscode-powershell May 18, 2021
@ghost ghost added the Needs: Triage 🔍 label May 18, 2021
@SydneyhSmith
Copy link
Collaborator

Thanks @t3mi this looks related to #1113

@ghost
Copy link

ghost commented May 19, 2021

This issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.

@ghost ghost closed this as completed May 19, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants