Skip to content
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

Formatter does not handle foreach method correctly #952

Closed
poshcodebear opened this issue Jul 12, 2017 · 3 comments
Closed

Formatter does not handle foreach method correctly #952

poshcodebear opened this issue Jul 12, 2017 · 3 comments

Comments

@poshcodebear
Copy link

poshcodebear commented Jul 12, 2017

System Details

  • Operating system name and version: Windows 10 RS2
  • VS Code version: 1.14.0
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:
1.14.0
b8cd5b9556d8b70ea560d35b903422363f6c5c40

Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

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

Issue Description

When using the foreach method on an array, the formatter does not indent or space correctly. For example, if you do something like this:

$items.foreach({
    # Do things
})

the formatter will format it like this:

$items.foreach( {
        # Do things
    })

It probably has something to do with having two open and two close braces right next to each other like that; when done this way, though, they should be treated as a single open and single close.

Attached Logs

I don't think this needs logs since it's not causing errors per se, but if you want them, I can produce them for you. Just let me know.

@kapilmb
Copy link

kapilmb commented Jul 12, 2017

We are tracking an identical issue at #576. Please subscribe to that issue for updates.

@poshcodebear
Copy link
Author

Thanks!

I looked through the formatter issues but didn't spot that one. Sorry for the duplicate.

@kapilmb
Copy link

kapilmb commented Jul 12, 2017

No problem at all!

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