Code linter/formatter not setting cursor on correct line

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 2 years and 7 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
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Code linter/formatter not setting cursor on correct line

Post by PsCustomObject »

Product: PowerShell Studio 2021 (64 Bit)
Build: v5.8.192
OS: Windows 10 Pro (64 Bit)

I just updated this morning to the latest version and noticed that when using a switch statement with the following syntax:

Code: Select all

                        switch ($null)
                        {
                            { $isOnlineRoom -eq $true }
                            
                            # Cursors should be set here when hitting enter
                        }
                        # Cursor is automatically set here
I often use such switch cases and would have noticed the issue with previous product versions so this has been introduced with the latest version.

Let me know if I was unable to describe this and I'll send across steps on how to reproduce this.

Thanks!

Keep in mind if I put an open curly braces after the expression cursor is set on the correct position but the brace is not formatted according to my configuration (it should be set on a new line).
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 9:46 am
Answers: 39
Been upvoted: 30 times

Re: Code linter/formatter not setting cursor on correct line

Post by brittneyr »

Thank you for reporting. We are looking into this and will get back to you soon.
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 9:46 am
Answers: 39
Been upvoted: 30 times

Re: Code linter/formatter not setting cursor on correct line

Post by brittneyr »

I'm having issues reproducing this. Can you please provide a picture of your Editor and Formatting settings from Options:
SPS_OptionsFormatting.png
SPS_OptionsFormatting.png (30.74 KiB) Viewed 7382 times
SPS_OptionsEditor.png
SPS_OptionsEditor.png (31.76 KiB) Viewed 7382 times
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Code linter/formatter not setting cursor on correct line

Post by PsCustomObject »

Sure thing here they are.
Scrren_1.png
Scrren_1.png (30.52 KiB) Viewed 7262 times
Scrren_2.png
Scrren_2.png (30 KiB) Viewed 7262 times
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 9:46 am
Answers: 39
Been upvoted: 30 times

Re: Code linter/formatter not setting cursor on correct line

Post by brittneyr »

I have had no luck reproducing this behavior. You mentioned steps in your original post, can you please send those over to us?
Brittney
SAPIEN Technologies, Inc.
This topic is 2 years and 7 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.