Page 1 of 1

Primal sense recognizes 'Type' and 'IPAddress' keywords

Posted: Wed Dec 05, 2018 9:52 am
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 818 times
Please correct these issues.

Thank you.

Thank you.

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

Posted: Wed Dec 05, 2018 10:11 am
by Alexander Riedel
2018-12-05_9-00-17.png
2018-12-05_9-00-17.png (6.92 KiB) Viewed 814 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.

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

Posted: Wed Dec 05, 2018 12:26 pm
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'.

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

Posted: Wed Dec 05, 2018 2:26 pm
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 790 times

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

Posted: Mon Dec 17, 2018 6:15 am
by Alexander Riedel
I'll make sure it gets logged as as bug, thanks.