You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IntelliSense slow or unresponsive forced to kill powershell to force it to work. #1256
Name Value
---- -----
PSVersion 5.1.16299.251
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.251
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
### Issue Description
IntelliSense is slow or unresponsive when using powershell in the editor.
To get it to work correctly again, I have to kill and restart powershell in Vscode to force it to work again.
### Attached Logs
Yes, killing the PIC does make Intellisense "work" again. However, really need variable and function lookup Intellisense provides when the PowerShell session is running. I really hope performance can dramatically improve.
Also, my workspace includes both a PowerShell module (1 PSM1) and a C# library. The PSM1 is ~2.8MB, and contains 33585 lines (~45% of those lines are blank).
I was having this problem consistently and found a possible cause.
I was developing a PowerShell Module for internal use. An old version of the module which I'd forgotten about was installed in C:\Users\cpdohert\Documents\WindowsPowerShell\Modules\MyModule\MyModule.psm1
I was also regularly running Import-Module C:\Users\cpdohert\Documents\repos\MyModule\MyModule.psm1 -Force in a PowerShell ISE window outside VS Code.
When I deleted the old C:\Users\cpdohert\Documents\WindowsPowerShell\Modules\MyModule\MyModule.psm1 file, IntelliSense began working speedily again.
Also, the slowdown only occurred once I upgraded to 1.8.2. Under 1.8.1 this configuration did not cause any problems.
We've been chipping away at performance issues recently, although there's still a lot of work to be done. But hopefully you'll experience some improvement in the next release. Here are the recent PRs:
The bigger performance gains are ones that require either changes in PSScriptAnalyzer or architectural changes in EditorServices, so we've been trying to fix those the "right" way, trying not to break too much.
It's probably easier to repro directly with something like:
Import-Module PSScriptAnalyzer -Version 1.18.1Invoke-Formatter-ScriptDefinition @'<script>'@# Or alternative gc -raw ./file.ps1 | invoke-formatter
Amongst a few other things, we're working on how to host PSScriptAnalyzer better and hope to see some improvements there. Unfortunately, PSScriptAnalyzer has a few rough spots that are hard for us to contain, but because it's part of the default experience, people expect it. I'm also contributing to PSSA when I find time, particularly in the performance area, so armed with the information you've provided I'm hoping we can find some real improvements here.
Hypernut we're planning to release the next preview extension version next week, which you should try to see whether it improves your intellisense experience. We're planning on stabilising that in January. There's a summary of the work going in here.
Activity
TylerLeonhardt commentedon Apr 3, 2018
Hi there, thanks for the report. Can you please attach the logs (instructions: https://github.com/powershell/vscode-powershell#2-capture-verbose-logs-and-send-them-to-us)
And also give me some details on how big your workspace is and how big your file is that's giving you slow intellisense?
ebmarquez commentedon Apr 3, 2018
it shows the logs are already attached.
logs.zip
My PSM1 file is 6704 lines
workspace size
All files which includes Jinja2, C#, Python, Powershell:
Powershell related files:
lushibi commentedon Apr 4, 2018
I have a problem that the intellisense does not work at all, until I exit the "PowerShell Integrated Console" which is opened by vscode automatically.
TylerLeonhardt commentedon Apr 10, 2018
Eric Marquez (@ebmarquez) oops missed the logs. Thanks for the extra info!
TylerLeonhardt commentedon Apr 10, 2018
This is one of the more important perf bugs that I've been hearing about.
rayholtz commentedon Apr 20, 2018
I also can confirm that killing the Powershell Integrated Console makes Intellisense work again. I have VScode v1.22.1.
ChrisLynchHPE commentedon Jun 1, 2018
Yes, killing the PIC does make Intellisense "work" again. However, really need variable and function lookup Intellisense provides when the PowerShell session is running. I really hope performance can dramatically improve.
Data points about my dev system:
Also, my workspace includes both a PowerShell module (1 PSM1) and a C# library. The PSM1 is ~2.8MB, and contains 33585 lines (~45% of those lines are blank).
cpdohert commentedon Aug 9, 2018
code -v
$pseditor.EditorServicesVersion
code --list-extensions --show-versions
$PSVersionTable
I was having this problem consistently and found a possible cause.
I was developing a PowerShell Module for internal use. An old version of the module which I'd forgotten about was installed in C:\Users\cpdohert\Documents\WindowsPowerShell\Modules\MyModule\MyModule.psm1
I was also regularly running Import-Module C:\Users\cpdohert\Documents\repos\MyModule\MyModule.psm1 -Force in a PowerShell ISE window outside VS Code.
When I deleted the old C:\Users\cpdohert\Documents\WindowsPowerShell\Modules\MyModule\MyModule.psm1 file, IntelliSense began working speedily again.
Also, the slowdown only occurred once I upgraded to 1.8.2. Under 1.8.1 this configuration did not cause any problems.
OneSpecialPeg commentedon Sep 18, 2018
Experiencing the same issues. Killing the terminal resolved the issue for me but I don't have old modules or packages.
rjmholt commentedon Sep 18, 2018
Two things that you can try for now are:
We've been chipping away at performance issues recently, although there's still a lot of work to be done. But hopefully you'll experience some improvement in the next release. Here are the recent PRs:
The bigger performance gains are ones that require either changes in PSScriptAnalyzer or architectural changes in EditorServices, so we've been trying to fix those the "right" way, trying not to break too much.
9 remaining items
rjmholt commentedon Jun 26, 2019
It's probably easier to repro directly with something like:
Amongst a few other things, we're working on how to host PSScriptAnalyzer better and hope to see some improvements there. Unfortunately, PSScriptAnalyzer has a few rough spots that are hard for us to contain, but because it's part of the default experience, people expect it. I'm also contributing to PSSA when I find time, particularly in the performance area, so armed with the information you've provided I'm hoping we can find some real improvements here.
Hypernut commentedon Dec 14, 2019
Any news on this issue? Its very annoying... Thanks!
rjmholt commentedon Dec 15, 2019
Hypernut we're planning to release the next preview extension version next week, which you should try to see whether it improves your intellisense experience. We're planning on stabilising that in January. There's a summary of the work going in here.
ebmarquez commentedon Dec 15, 2019
Yes, please make some progress on this. It's crazy how bad this experience really is. I restart vscode multiple times a day because its so bad.
rjmholt commentedon Dec 15, 2019
Eric Marquez (@ebmarquez) try out the powershell-preview extension if you'd like to evaluate the progress so far
SydneyhSmith commentedon Feb 6, 2020
Going to close this as a result of the major architectural changes we made in the omnisharp port.