Code Folding Broken with Powershell

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 17 years and 2 weeks 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
kevin.rappold@us.army.mil
Posts: 5
Last visit: Wed Nov 05, 2008 3:08 am

Code Folding Broken with Powershell

Post by kevin.rappold@us.army.mil »

I don't know if you have had this reported, but the code folding feature does not seem to work reliably in PowerShell scripts. I haven't seen the problem in other code types but I haven't looked hard. I have a Powershell script that adds a number of functions to my profile. Many of the functions have code folding but a few do not. They simply show up as full sections of code.
A side effect of this is the same functions that do not have folding, also do not show up in the Function/Method List dropdown either. Maybe that is the real problem?
I am using PrimalScript 4.1.535 Enterprise.
Kevin
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Code Folding Broken with Powershell

Post by Alexander Riedel »

That most likely means that PrimalScript's parser does not correctly parse the syntax of such a particular function. Since PowerShell's grammar is pretty new and fairly complex that is entirely possible.
The best way for us to fix that fast is to send a sample with such functions to support@sapien.com. We can adjust the parser and roll it into a service release.
Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
kevin.rappold@us.army.mil
Posts: 5
Last visit: Wed Nov 05, 2008 3:08 am

Code Folding Broken with Powershell

Post by kevin.rappold@us.army.mil »

I will send up my profile script file. It is a little ugly because it is a work in progress but you can plainly see where the code folding doesn't work well.

Kevin
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Code Folding Broken with Powershell

Post by Alexander Riedel »

Thanks for sending the file. We'll roll the fix into the next service build.
The issues are pretty minor and you can work around them by
1. typing 'function' always in all lowercase
2. add a delimiting space between a function name and the { of the
function body.

That should make it all better until we roll the next build out.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
kevin.rappold@us.army.mil
Posts: 5
Last visit: Wed Nov 05, 2008 3:08 am

Code Folding Broken with Powershell

Post by kevin.rappold@us.army.mil »

Great. Thanks for the quick response and the workaround.
This topic is 17 years and 2 weeks 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.