Primal sense recognizes 'Type' and 'IPAddress' keywords

Support for all customers who have purchased a PrimalScript product license. This forum does not offer a response time guarantee.
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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
clum09
Posts: 146
Joined: Thu Apr 24, 2008 9:11 am

Primal sense recognizes 'Type' and 'IPAddress' keywords

Post by clum09 » Wed Dec 05, 2018 9:52 am

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 207 times
Please correct these issues.

Thank you.

Thank you.

User avatar
Alexander Riedel
Posts: 6710
Joined: Tue May 29, 2007 4:43 pm

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

Post by Alexander Riedel » Wed Dec 05, 2018 10:11 am

2018-12-05_9-00-17.png
2018-12-05_9-00-17.png (6.92 KiB) Viewed 203 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: 146
Joined: Thu Apr 24, 2008 9:11 am

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

Post by clum09 » Wed Dec 05, 2018 12:26 pm

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: 146
Joined: Thu Apr 24, 2008 9:11 am

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

Post by clum09 » Wed Dec 05, 2018 2:26 pm

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 179 times