Skip to content

Code formatter should keep indentation for multi-line pipelines v2 #969

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
dargmuesli opened this issue Jul 23, 2017 · 1 comment
Closed
Labels

Comments

@dargmuesli
Copy link

System Details

  • Operating System: Windows 10 v1703
  • VS Code version: 1.14.2
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.15063.483
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.483
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Related to #448.

Currently for a block of code like this:

Get-ItemProperty -Path $RegPath |
    ForEach-Object {
        Process {
            If (Test-PropertyExist -Object $PSItem -PropertyName "DisplayName") {
                $PSItem
            }
        }
    }

the code formatter gives this output:

Get-ItemProperty -Path $RegPath |
    ForEach-Object {
    Process {
        If (Test-PropertyExist -Object $PSItem -PropertyName "DisplayName") {
            $PSItem
        }
    }
}

It should at least retain the proper indentation or fix it if we notice that the following lines in the pipeline are indented.

Sorry for stealing the description pattern ;)
Also: @kapilmb could you please have a look at this as you fixed the related issue mentioned above. That would be great!

Thanks in advance :)

@SydneyhSmith
Copy link
Collaborator

Closing this as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants