vscode-powershell: Auto-completion fails due to performance issues

System Details

System Details Output

### VSCode version: 1.42.1 c47d83b293181d9be64f27ff093689e8e7aed054 x64

### VSCode extensions:
abusaidm.html-snippets@0.2.1
bierner.github-markdown-preview@0.0.2
bierner.markdown-checkbox@0.1.3
bierner.markdown-emoji@0.0.9
bierner.markdown-preview-github-styles@0.1.6
bierner.markdown-yaml-preamble@0.0.4
DavidAnson.vscode-markdownlint@0.34.0
DotJoshJohnson.xml@2.5.0
eamodio.gitlens@10.2.1
EditorConfig.EditorConfig@0.14.4
eg2.tslint@1.0.44
Mikael.Angular-BeastCode@8.1.2
ms-dotnettools.csharp@1.21.13
ms-python.python@2020.2.64397
ms-vscode-remote.remote-containers@0.101.1
ms-vscode-remote.remote-ssh@0.49.0
ms-vscode-remote.remote-ssh-edit@0.49.0
ms-vscode-remote.remote-ssh-explorer@0.49.0
ms-vscode-remote.remote-wsl@0.42.3
ms-vscode-remote.vscode-remote-extensionpack@0.19.0
ms-vscode.cpptools@0.26.3
ms-vscode.powershell@2020.3.0
ms-vscode.vscode-typescript-tslint-plugin@1.2.3
msjsdiag.debugger-for-chrome@4.12.6
msjsdiag.debugger-for-edge@1.0.14
robinbentley.sass-indented@1.5.1
sibiraj-s.vscode-scss-formatter@1.4.3
SimonSiefke.svg-preview@2.8.3
twxs.cmake@0.0.17
vsls-contrib.gistfs@0.0.61
wayou.vscode-todo-highlight@1.0.4
yzhang.markdown-all-in-one@2.7.0


### PSES version:

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

Auto-complete was working for about 5 minutes into editing a small script (220 lines) but now it has wedged.

Expected Behaviour

Auto-complete should not ever stop working - in an ideal world. 😃

Actual Behaviour

I get the dreaded “Loading…” message for at least a minute before I give up:

VSCodePSAutoCompleteWedge.zip 1583432852-d0e516fc-13f8-444b-877f-cecf115455871583432271941.zip

Attached Logs

Follow the instructions in the troubleshooting docs about capturing and sending logs.

1583432852-d0e516fc-13f8-444b-877f-cecf115455871583432271941.zip

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 41 (7 by maintainers)

Most upvoted comments

This version is significantly better than before and have not needed to restart in the last 60+ minutes, which was unheard of with the current preview. I’ve been reworking the script I did yesterday which it would freeze on pretty regularly so things have definitely improved.

@TylerLeonhardt I’ve spend about 90 minutes typing functions (for testing I just duplicated existing functions into a dummy project) and auto-complete has worked perfectly so far. Good performance, with no crashes.

I will close this as we close issues when the fix is merged in and this has been merged in.

Awesome - this will be live in… about 10 or so minutes as the PowerShell Preview extension and then if it goes well, Stable will follow next week.

@TylerLeonhardt I’ve created a new issue: [Preview-2020.3.2] Enable Legacy Code Lens not working

Also, it looks like I will be able use 2020.3.2 and just ignore the warning. Won’t know until I give it a go. Tried on another project and it wouldn’t run the Pester tests. It just gave the warning:

Importing Pester module...
WARNING: Failed to import Pester version 5.0.0. You must install Pester module to run or 
debug Pester tests.       
WARNING: You can install Pester by executing: Install-Module Pester -MinimumVersion 5.0.0 
-Scope CurrentUser -Force

UPDATE: The tests will run if I manually import Pester (4.10.1) first.

@TylerLeonhardt I’ve done a brief test with v2020.3.2-preview. In this test intellisense was back to full speed! However, I would not be able to use this version full-time due to the dependency on Pester v5-beta. The ability to run single tests is excellent. Unfortunately it’s not yet stable enough, and I’m getting tests which fail, that don’t fail with Pester 4.10.1. Also, what looks like debug output. I’ll create an issue in the Pester repository.

I’ll try to do a longer test. After which I’ill need to revert to v2020.3.0 with it’s slow intellisense, but working Pester (I unit test most code). Is there a (simple) way to use Pester 4.10.1 with v2020.3.2-preview?

This issue has regressed for me with the latest preview release 2020.3.1. auto-complete doesn’t work at all anymore. Reverting the extension to 2020.3.0 has it working again.

Probably best to track in #2590 which i’ve just found.

@SeeminglyScience

> Import-Module PackageManagement -PassThru


ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     1.4.6                 PackageManagement                   {Find-Package, Find-PackageProvider, Get-…

I notice that, since changing the PSModulePath as you suggested above, a new version (1.3.1) of the PackageManagement module has appeared:

> Get-Module PackageManagement -list



    Directory: C:\program files\powershell\7\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.4.6                 PackageManagement                   Desk      {Find-Package, Get-Package, Get… 

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.3.1                 PackageManagement                   Desk      {Find-Package, Get-Package, Get… 
Binary     1.0.0.1               PackageManagement                   Desk      {Find-Package, Get-Package, Get…

I’ve got the following in my settings:

"powershell.developer.editorServicesLogLevel": "Diagnostic",
"powershell editor services.trace.server": "Verbose",

I’ll leave the extended logging on until I come across the issue. Then I’ll post the logs here.

@SeeminglyScience Thanks for the suggestion. I’ll give that a go and let you know how I get on.

That said, the slow down in auto-complete has only started recently. The PSModulePath has not changed for some time.

It may be worth considering including PackageManagement with the extension 😕

Hmmm, that’s an idea, although we’d need to import it differently the way the module path works.

That just encourages me to get back to work on PSScriptAnalyzer…

OK, now on PS 7 GA and have PSIC displaying. I had done some experimenting with settings a while back and apparently set showOnStartup to false. Fixed.

It’s probably defaulting to preview. Try switching to PowerShell (x64)