Skip to content

Intellisense sometimes doesn't work [idictionary] until session restart (preview) #3956

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
6 tasks done
PrzemyslawKlys opened this issue May 6, 2022 · 5 comments
Closed
6 tasks done
Labels
Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed!

Comments

@PrzemyslawKlys
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

I was editing some code when I wanted to type [idic] and wanted it to autocomplete but it didn't work. I've retried multiple times but couldn't get anything. This is on newest preview - i believe this happens in the log:

2022-05-06 17:43:36.731 +02:00 [DBG] Finished: Processing request textDocument/foldingRange 871 in 0ms
2022-05-06 17:43:36.732 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.732 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.732 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.733 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.733 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.733 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.733 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.734 +02:00 [VRB] Assembly resolve event fired for Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2022-05-06 17:43:36.734 +02:00 [VRB] IntelliSense completed in 23ms.

image

It May be related to:

I thought I would open this up as new one, since it's preview but feel free to move it to known issue.

1651843773-2f790ac8-0ae4-415b-9b55-0dc2007e19e31651843771853.zip

It's not reproducible on daily basis.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.22000.652
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22000.652
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.67.0
57fd6d0195bb9b9d1b49f6da5db789060795de47
x64

Extension Version

Steps to Reproduce

Not applicable

Visuals

No response

Logs

No response

@PrzemyslawKlys PrzemyslawKlys added the Issue-Bug A bug to squash. label May 6, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 6, 2022
@SeeminglyScience
Copy link
Collaborator

SeeminglyScience commented May 6, 2022

Type name completion can break pretty easily in 5.1 because they weren't catching JIT or type load time exceptions.

Check if it works in the console, if it doesn't then check $null = [AppDomain]::CurrentDomain.GetAssemblies().ForEach{ $_.GetTypes() } and see if you get any exceptions.

@PrzemyslawKlys
Copy link
Contributor Author

Ye, so basically the same thing, as in the earlier report. I'll close this one, hoping someday PS 5.1 workaround will be done or maybe PS 7 will be more common.

@SeeminglyScience
Copy link
Collaborator

You can give this a go:

https://github.com/SeeminglyScience/dotfiles/blob/eb62bb91eb889c290d607c8f57762a9ec1cedbe4/Documents/PowerShell/SetTypeCache.ps1

Also requires:

https://github.com/SeeminglyScience/dotfiles/blob/eb62bb91eb889c290d607c8f57762a9ec1cedbe4/Documents/PowerShell/Utility.psm1#L1510-L1587

It's what I used to use manually to reset it when there was a problem (and I still used 5.1 with some frequency). You'll have to run it a lot unfortunately. Also it's an atrocity that's definitely not supported, but might be helpful anyway.

@PrzemyslawKlys
Copy link
Contributor Author

Might be just easier to reset session.

@SeeminglyScience
Copy link
Collaborator

It is, but it's usually caused by a module that isn't shipping everything it's dependent on. So restarting will work, but you're gonna be doing that a lot in certain projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed!
Projects
None yet
Development

No branches or pull requests

2 participants