Skip to content

formatting should allow brace indent to match contained code indent #462

Open
@LeeDailey

Description

System Details

  • Operating system name and version: win7x64
  • VS Code version: 1.8.2
  • PowerShell extension version: 0.9.0
  • Output from $PSVersionTable:
Name                           Value                                           
----                           -----                                           
PSVersion                      5.1.14409.1005                                  
PSEdition                      Desktop                                         
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
BuildVersion                   10.0.14409.1005                                 
CLRVersion                     4.0.30319.42000                                 
WSManStackVersion              3.0                                             
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1   

Issue Description

howdy y'all,

currently the code formatter indents the braces & sub-controls [elseif/else] to the same level as the control block. i want them indented to the same level as the code.

default ...

if ($TestBool -eq $True)    
{    
    Write-Output '$TestBool is TRUE.'    
}    
elseif ($TestBool -eq $False)    
{    
    Write-Output '$TestBool is FALSE.'    
}    
else    
{    
    Write-Output '$TestBool appears to be non-boolean.'    
}    

what i would prefer ...

if ($TestBool -eq $True)
    {
    Write-Output '$TestBool is TRUE.'
    }
    elseif ($TestBool -eq $False)
    {
    Write-Output '$TestBool is FALSE.'
    }
    else
    {
    Write-Output '$TestBool appears to be non-boolean.'
    }

yes, it fails to match your documented style. [sigh ...] however,it is far easier for me to read than the style you chose.

i would dearly like to be able to set that indent style. it's whitesmith, i believe.

take care,
lee

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