Page 1 of 1

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

Posted: Tue Mar 15, 2016 3:32 am
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

$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

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

Posted: Wed Mar 16, 2016 8:30 am
by davidc
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

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

Posted: Thu Mar 17, 2016 1:36 am
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

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

Posted: Thu Mar 17, 2016 9:04 am
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

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

Posted: Thu Mar 31, 2016 2:35 am
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

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

Posted: Thu Mar 31, 2016 3:47 pm
by davidc
Thank you for the update!

David