[PSS 2016][Bug] No Primal Sense for custom types

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 7 years and 11 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.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2016][Bug] No Primal Sense for custom types

Post by Bosparan »

PSS Version: 2016 5.2.117
OS Version: Windows 10 x64
WMF Version: 5.0

Impact: Major inconvenience

Symptom:
PowerShell Studio will not provide Primal Sense for custom libraries of any complexity, when typing the type-name (In New-Object calls, when casting or when defining parameter types).

Reproducibility:
Create a simple custom type like this:
Code: [Select all] [Expand/Collapse] [Download] (CreateType.ps1)
  1. $source = @"
  2. using System;
  3.  
  4. namespace Test
  5. {
  6.     public class Test
  7.     {
  8.         public string foo;
  9.         public int bar;
  10.     }
  11. }
  12. "@
  13. Add-Type -TypeDefinition $source -OutputAssembly "C:\temp\test.dll"
then Add it under assemblies or add a line importing it explicitly in the script like this:
Code: [Select all] [Expand/Collapse] [Download] (ImportType.ps1)
  1. Add-Type "C:\temp\test.dll"
Finally try creating an object of that type (As usual, "|" is the current position of the cursor):
Code: [Select all] [Expand/Collapse] [Download] (TryReceivingPrimalSense.ps1)
  1. New-Object Test|
Now typing a dot (".") should cause PSS to provide primal sense, however, it produces nothing.

Additional Testing done:
- Restarting PSS after creating library and adding reference: The entry under "Assemblies" was gone, no PS given. Manually adding reference would do nothing.
- Adding a complex library with or without comments: No Success
- Adding library adding "System" namespaced types: No success
- PSS still recognizes valid types in brackets (when casting or declaring parameters)
-- PSS provides Primal Sense for Variables of custom types (after casting / parameter typing)
-- PSS provides Primal Sense for static methods and properties
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2016][Bug] No Primal Sense for custom types

Post by davidc »

This issue will be resolved in the next service release.

Make sure you explicitly use the Path parameter:
  1. Add-Type -Path "C:\temp\test.dll"
David
David
SAPIEN Technologies, Inc.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2016][Bug] No Primal Sense for custom types

Post by Bosparan »

Hi David,

Actually I did explicitly use the -Path parameter in our main library - just not in the example.
Figured some of it out on my own by now:
The reason I received no Primal Sense at all was due to an option that wasn't set after upgrade:
Editor > Primal Sense > "Enable word completion while typing"
This also returned the ability to receive primal sense for functions as I type them.

However!
For .NET types this doesn't work as it should. Specifically, even with this option set, I cannot navigate the namespaces for my custom libraries at all: When typing official libraries, I can type the first namespace segment (e.g.: "System.") and receive primal sense for all classes, enumerations, namespaces, etc. below it. For custom libraries it will only show me the class-names.
For a simple library with 2-3 classes that's ok, but in our case ... our main library alone has (currently) 344 classes in 28 nested namespaces. Going by name alone is very troublesome in this case - I need the namespace structure to navigate it properly.

Cheers,
Bosparan
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2016][Bug] No Primal Sense for custom types

Post by davidc »

Yes, there is a bug where the PrimalSense list does not show the custom types. This will be resolved in the next service release.

David
David
SAPIEN Technologies, Inc.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2016][Bug] No Primal Sense for custom types

Post by Bosparan »

Hi,

just installed Version 5.2.118 and can confirm that Primal Sense for custom types works again as desired, thanks :)

Cheers,
Bosparan
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2016][Bug] No Primal Sense for custom types

Post by davidc »

Thank you for the update!

David
David
SAPIEN Technologies, Inc.
This topic is 7 years and 11 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.