powershell syntax @{} confuses code folding

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
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.
This topic is 1 year and 8 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
gmichaud
Posts: 108
Last visit: Fri Mar 10, 2023 9:05 am

powershell syntax @{} confuses code folding

Post by gmichaud »

Product: PrimalScript (64 Bit)
Build: v8.0.168
OS: Windows 10 Pro (64 Bit)
Build: v10.0.19044

This code shows the problem:

function TestFold
{
$hash = @{ }

$hash.Add("Item 1", '-')

}

The @ seems to hide the opening { so the accompanying } ends the function leaving the rest of the code as 'orphaned'.
Screenshot - 7_11_2022 , 12_08_57 PM_ver001.png
Screenshot - 7_11_2022 , 12_08_57 PM_ver001.png (53.35 KiB) Viewed 3345 times
Thanks,
Gerry
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: powershell syntax @{} confuses code folding

Post by Alexander Riedel »

Thank you for letting us know.
I'll get that to QA to line it up to get fixed.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: powershell syntax @{} confuses code folding

Post by Alexander Riedel »

The issue has been resolved and is in QA for testing. It should be fixed in the next service build.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
gmichaud
Posts: 108
Last visit: Fri Mar 10, 2023 9:05 am

Re: powershell syntax @{} confuses code folding

Post by gmichaud »

Alexander,
I just installed 8.0.169. Most instances of this bug are fixed, but there is one case left unresolved.

Screenshot - 7_26_2022 , 4_39_09 PM.png
Screenshot - 7_26_2022 , 4_39_09 PM.png (23.04 KiB) Viewed 2413 times

The highlighted clause in line 66 in the attached file causes the problem. If the entire line is removed, the code folds correctly.

BadFold.ps1
(11.45 KiB) Downloaded 95 times
Thanks,
Gerry
User avatar
gmichaud
Posts: 108
Last visit: Fri Mar 10, 2023 9:05 am

Re: powershell syntax @{} confuses code folding

Post by gmichaud »

I take that back. Removing line 66 gets it close, but it's still one curly bracket away from being right:
Screenshot - 7_26_2022 , 4_45_52 PM.png
Screenshot - 7_26_2022 , 4_45_52 PM.png (4.24 KiB) Viewed 2411 times
Thanks,
Gerry
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: powershell syntax @{} confuses code folding

Post by Alexander Riedel »

Thanks, I will look into it.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year and 8 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.