Primal sense recognizes 'Type' and 'IPAddress' keywords

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 5 years and 3 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
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Primal sense recognizes 'Type' and 'IPAddress' keywords

Post by clum09 »

Product, version and build: 7.4.119
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64 bit

Primal Sense recognizes words "Type" and IPAddress as key words in PowerShell Editor.

PrimalScript changes the word 'Type' to have a lower case T as 'type' instead of leaving the T character as typed when I clicked on the word 'Type' or when I pasted this word onto the editor. PrimalScript only keeps the T character as as an uppercase character only when I use double quotes characters for the string as "Type", but with single quotes the word Type will be change to 'type'.

PrimalScript also changes the color of the word IPAddress to show as blue color instead of leaving it as being in black color.

This feature of PrimalScript has been so annoying me when I write a PowerShell script that I need to use the word Type and IPAddress as my property names. Also this new version of PrimalScript, (beside not keeping the editor's customization such Auto hide, etc), appears to show the column for the line numbers being very wide. See the attached picture.

PrimalScript7.4.119.jpg
PrimalScript7.4.119.jpg (24.52 KiB) Viewed 3458 times
Please correct these issues.

Thank you.

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

Re: Primal sense recognizes 'Type' and 'IPAddress' keywords

Post by Alexander Riedel »

2018-12-05_9-00-17.png
2018-12-05_9-00-17.png (6.92 KiB) Viewed 3454 times
Seems to keep the capital 'T' just fine. I would probably will need to see the complete script to find out why it would do that in your case.
As for the IPAddress thing, IPAddress is a valid .NET type name. https://docs.microsoft.com/en-us/dotnet/api/system.net.ipaddress?view=netframework-4.7.2
It has been requested by our users that we color type names in order to avoid accidental use of such names as identifiers. You can set the color of type names to just
the regular text color if you do not want to see this.
The size of the line number gutter is calculated based on scaling factors, font size and maximum line numbers.
I cannot really see anything wrong with it in this little snippet you sent.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Re: Primal sense recognizes 'Type' and 'IPAddress' keywords

Post by clum09 »

Have you tried to click on "Type' or highlight the word 'Type' with your mouse?

The moment you highlight the word 'Type' or click on it a few times with your mouse, it will turn into 'type'.
User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Re: Primal sense recognizes 'Type' and 'IPAddress' keywords

Post by clum09 »

IPAddress by itself should not be considered as a class. It should be a string unless it is used as PowerShell Type Accelerators which is enclosed with brackets like [IPAddress]. See the code snippet image I took from PowerShel Studio. In PowerShell Studio, IPAddress is treated as a string and the word Type stays as typed.

PStudio1.JPG
PStudio1.JPG (17.84 KiB) Viewed 3430 times
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Primal sense recognizes 'Type' and 'IPAddress' keywords

Post by Alexander Riedel »

I'll make sure it gets logged as as bug, thanks.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 5 years and 3 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.