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

Support for all customers who have purchased a SAPIEN PowerShell Studio 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
Bosparan
Posts: 282
Joined: Sun Mar 03, 2013 12:45 pm

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

Post by Bosparan » Tue Mar 15, 2016 3:32 am

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

$source = @"
using System;

namespace Test
{
public class Test
{
public string foo;
public int bar;
}
}
"@
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

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

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: 5889
Joined: Thu Aug 18, 2011 4:56 am

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

Post by davidc » Wed Mar 16, 2016 8:30 am

This issue will be resolved in the next service release.

Make sure you explicitly use the Path parameter:

Code: Select all

Add-Type -Path "C:\temp\test.dll"
David
David
SAPIEN Technologies, Inc.

User avatar
Bosparan
Posts: 282
Joined: Sun Mar 03, 2013 12:45 pm

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

Post by Bosparan » Thu Mar 17, 2016 1:36 am

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: 5889
Joined: Thu Aug 18, 2011 4:56 am

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

Post by davidc » Thu Mar 17, 2016 9:04 am

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.

User avatar
Bosparan
Posts: 282
Joined: Sun Mar 03, 2013 12:45 pm

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

Post by Bosparan » Thu Mar 31, 2016 2:35 am

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: 5889
Joined: Thu Aug 18, 2011 4:56 am

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

Post by davidc » Thu Mar 31, 2016 3:47 pm

Thank you for the update!

David
David
SAPIEN Technologies, Inc.