Formatting of code within parenthesis not correctly indented

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
jasnic02
Posts: 7
Joined: Thu Jul 28, 2011 7:53 am

Formatting of code within parenthesis not correctly indented

Post by jasnic02 » Thu Apr 14, 2016 12:19 pm

Product, version and build: PowerShell Studio 2016 build 5.2.118
32 or 64 bit version of product: 64 bit
Operating system: Windows 8.1
32 or 64 bit OS: 64
PowerShell Version: 5.0

When PSStudio formats the code, the code within the parenthesis are not indented properly. Unless I'm missing an option somewhere? If not, is this something that could be corrected in the formatting rules?

Code: Select all

#For example:
$test = $(
    if ($true) {
        'this is true'
    }
    else {
        'this is not true'
    }
)

#becomes:
$test = $(
if ($true) {
    'this is true'
}
else {
    'this is not true'
}
)

#and this:
$arr = @(
    'one',
    'two',
    'three'
)

#becomes:
$arr = @(
'one',
'two',
'three'
)

#As expected, this indents properly:
$test = $(if ($true) {
    'this is true'
}
else {
    'this is not true'
})

#However, this does not:
$arr = @('one',
'two',
'three'
)

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Formatting of code within parenthesis not correctly indented

Post by davidc » Thu Apr 14, 2016 3:38 pm

Indentation is only calculated by curly brackets and doesn't not include parenthesis. However I will add in a feature request and pass it along to the team.

David
David
SAPIEN Technologies, Inc.