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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 7 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
jasnic02
Posts: 7
Last visit: Tue Feb 21, 2017 10:20 am

Formatting of code within parenthesis not correctly indented

Post by jasnic02 »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Formatting of code within parenthesis not correctly indented

Post by davidc »

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.
This topic is 7 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.