Skip to content

Suggestions for parameter types not working #2743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PrzemyslawKlys opened this issue Jun 3, 2020 · 8 comments
Closed

Suggestions for parameter types not working #2743

PrzemyslawKlys opened this issue Jun 3, 2020 · 8 comments

Comments

@PrzemyslawKlys
Copy link
Contributor

Issue Description

I am experiencing a problem with... suggestions for parameter types not working.

ThisUsedToWork

image

In code:

image

This used to work. It's not working in production and preview. It's very useful in ISE.

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.19041
VSCode 1.45.1
PowerShell Extension Version 2020.6.0

PowerShell Information

Name Value
PSVersion 5.1.19041.1
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.19041.1
BuildVersion 10.0.19041.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
bracket-pair-colorizer-2 CoenraadS 0.1.4
code-settings-sync Shan 3.4.3
github-linker gimenete 0.2.3
gitlens eamodio 10.2.1
grammarly znck 0.12.1
markdown-all-in-one yzhang 3.0.0
material-icon-theme PKief 4.1.0
powershell-preview ms-vscode 2020.6.0
project-manager alefragnani 11.0.1
vscode-markdownlint DavidAnson 0.36.0
vscode-pull-request-github GitHub 0.16.0
vscode-toggle-quotes BriteSnow 0.3.2
vscode-wakatime WakaTime 4.0.0
xml DotJoshJohnson 2.5.0
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 3, 2020
@SeeminglyScience
Copy link
Collaborator

Works for me.

Windows PowerShell is really finicky with it's type completion because it didn't account for the fact that type discovery sometimes throws (like JIT and assembly resolution errors). Next time you see it try this directly in the console:

TabExpansion2 -inputScript ($s = '[IDictionary') -cursorColumn $s.Length

If that throws, there's a good chance that an assembly was loaded in the current session that type discovery doesn't handle well. Especially if you have an older version of .NET framework then pretty much any netstandard targeting assembly will cause it.

@PrzemyslawKlys
Copy link
Contributor Author

image

I can replicate it every single time.

@PrzemyslawKlys
Copy link
Contributor Author

Same machine in ISE doesn't have a problem. Not sure if that helps:

image

image

@SeeminglyScience
Copy link
Collaborator

After you get that error can you run this pls:

$e = $Error[0].Exception
while ($e -and $null -eq $e.LoaderExceptions) {
    $e = $e.InnerException
}

$e.LoaderExceptions | fl * -for

@PrzemyslawKlys
Copy link
Contributor Author

Message        : Method 'get_Line' in type 'EditorServicesCommandSuite.EditorServices.LspPosition' from assembly 'EditorServicesCommandSuite.EditorServices, Vers
                 ion=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
TypeName       : EditorServicesCommandSuite.EditorServices.LspPosition
Data           : {}
InnerException :
TargetSite     :
StackTrace     :
HelpLink       :
Source         :
HResult        : -2146233054

@PrzemyslawKlys
Copy link
Contributor Author

After I've removed module from loading - it works.

@SeeminglyScience
Copy link
Collaborator

Yep that's a JIT time exception for sure. FWIW that won't affect completion in PS7 since the type completion API now catches those exceptions during type discovery.

@TylerLeonhardt You know if there's any more breaking changes coming in the near future? (I know we've already discussed this one in particular, just trying to see if I should expect more shortly).

@PrzemyslawKlys
Copy link
Contributor Author

Thank you @SeeminglyScience, appreciate your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants