-
Notifications
You must be signed in to change notification settings - Fork 511
IntelliSense is occasionally slow when editing PowerShell scripts #647
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
Comments
Is it slow after working in a session for a while or only at the very beginning? |
Hey Jody, when you see this issue again, can you evaluate the |
Sorry, been a crazy couple of days. I can't seem to find a pattern as to when this happens, but I will keep a bit more attention to it. |
No problem! One more thing to try when you see this again, when IntelliSense becomes slow, try running these two commands in the Integrated Console and then try IntelliSense again to see if the speed improves:
This takes those two modules out of the session. I suspect that they may be causing the IntelliSense slowness. |
Linking this to an issue I created against the PackageManagement module since that is definitively the cause of this issue: |
intellisense for the PowerShellGet module is slow even in the regular shell. |
Yeah, that's because PowerShellGet loads PackageManagement, so loading either causes the slowdown. |
So I don't have either of those modules loaded, using a custom profile. After updating to VSCode 1.11.1 and the 0.12.1 release of the plugin seems to help once intellisense starts it becomes very responsive. not sure what may have triggered that but will need to try it on a couple of my other systems. |
You wouldn't have loaded them on purpose, the PowerShell extension causes them to be loaded when you type a string that causes a PackageManagement cmdlet to show up in the IntelliSense results ( |
Makes sense, I will keep an eye out. |
This change mitigates seemingly intermittent IntelliSense slowness by preventing Get-Command and Get-Help from being called on cmdlets from the PowerShellGet and PackageManagement modules. Something in the PackageManagement module is causing completions to be returned at 10x delay when that module is loaded. If the module is removed from the session, completions go back to their normal duration. By avoiding calling Get-Command on these cmdlets, we avoid loading PackageManagement when the user types a string like `Get-P` which incidentally happens to make VS Code see the `Get-Package` cmdlet and try to resolve its details. This fix is temporary and will be removed in the future once OneGet/oneget#275 is fixed. Related to PowerShell/vscode-powershell#647
i confirm this issue...currently this is the reason why i use ISE to write the code test and then paste into vscode for formatting and organization. In fact i have seen this behaviour on a couple of systems so its not isolated to just one machine I also ran the remove-module commands but none of the packagemgmt modules were loaded `
6/10/2017 5:51:39 AM [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1409 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs ` |
Is there something I can do to help identify the cause of this issue? I believe I'm also experiencing the same problem (Code version 1.14.2). I tried removing the PowerShellGet and PackageManagement modules from the Integrated PowerShell Console, but it seems those modules weren't loaded (see error output below). Thanks.
|
@mlalkaka can you capture verbose logs and attach them to the thread? |
Powershell Intellisense is occasionally really slow. Both regular and insider versions. Here is verbose logs from insiders version: |
Intellisense is always slow for me, however it's rapid in the ISE. |
I run into the same issue of slow intellisense as well. Running Powershell extension 1.7.0. It is the single reason I switch back to ISE at times, especially when anything more than simple editing to existing code/scripts. I always come back to VS Code though, for the Explorer pane to view/manage files and the source control (git) integration...even though I've built a few wrapper commands to push changes to my repo when I'm in the ISE. I've tried to 'get going' with Git a few times in the past, but using VS Code is what finally got me using it and eventually understanding it better. |
I've started experiencing this same issue since the last version or two of VSCode. I never experienced slow intellisense with powershell before then. Mindful the VSCode version could just be coincidence. |
I'm also having this problem, but for me it is always slow if I import a bunch of DSC modules. For instance try opening the dsc configuration that I pasted below, install the listed modules on your system and then test how long it takes to show code completion for a simple command like write-host. On my main dev machine (Core i7-6900K, 32 GB RAM, Windows 10, SSD) it takes about 20 seconds. `configuration DSCConfig{
} |
Believe slowness was caused by integrated console(terminal), kill the terminal recovers it after typing a few words, pwsh is busy (reaches 100% in mac), then have to wait a few min!! really inconvenient. |
@smartpcr are you using the stable or preview extension? If on stable, maybe try the preview; |
Same here.
PowerShell Information
|
If you're using the stable extension, it's worth giving the preview a try, since we've been investing in performance improvements there. If you're using the preview, please let us know. Also see #1256 (comment) |
Closing, if you have issues with the latest build please add your comment to #2522 |
At times it could take up to 90 seconds for Intellisense to finally come up, sometimes I have to manually initiate (Ctrl+Space), and other times it comes up very quickly.
System Details
$PSVersionTable
:Name Value
PSVersion 5.0.10586.672
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.672
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The text was updated successfully, but these errors were encountered: