Skip to content

IntelliSense slow or unresponsive forced to kill powershell to force it to work. #1256

Closed

Description

System Details

  • Operating system name and version:
Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.16299.0 Microsoft Windows NT 10.0.16299.0

  • VS Code version: 1.21.1
  • PowerShell extension version: 1.6.0
  • Output from $PSVersionTable:
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

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v

1.21.1
79b44aa704ce542d8ca4a3cc44cfca566e7720f1
x64

$pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      6      0      0

code --list-extensions --show-versions

$PSVersionTable

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

logs.zip

Activity

  1. TylerLeonhardt commented on Apr 3, 2018

    @TylerLeonhardt
    Member

    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?

  2. ebmarquez commented on Apr 3, 2018

    @ebmarquez
    Author

    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:

    (Get-ChildItem .\DeploymentToolKit\ -Recurse).count
    7914
    

    Powershell related files:

    ((Get-ChildItem .\DeploymentToolKit\ -Recurse -Filter "*.ps?1").FullName).count
    38
    
  3. lushibi commented on Apr 4, 2018

    @lushibi

    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.

    image

  4. TylerLeonhardt commented on Apr 10, 2018

    @TylerLeonhardt
    Member

    Eric Marquez (@ebmarquez) oops missed the logs. Thanks for the extra info!

  5. TylerLeonhardt commented on Apr 10, 2018

    @TylerLeonhardt
    Member

    This is one of the more important perf bugs that I've been hearing about.

  6. rayholtz commented on Apr 20, 2018

    @rayholtz

    I also can confirm that killing the Powershell Integrated Console makes Intellisense work again. I have VScode v1.22.1.

  7. added this to the 2.0.0 milestone on May 24, 2018
  8. ChrisLynchHPE commented on Jun 1, 2018

    @ChrisLynchHPE

    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:

    [PS] ...\MyDir> code -v
    1.23.1
    d0182c3417d225529c6d5ad24b7572815d0de9ac
    x64
    [PS] ...\MyDir> $pseditor.EditorServicesVersion
    [PS] ...\MyDir> code --list-extensions --show-versions
    alefragnani.Bookmarks@0.19.1
    alefragnani.pascal@0.11.0
    humao.rest-client@0.18.4
    idleberg.innosetup@1.0.3
    mechatroner.rainbow-csv@0.3.0
    mohsen1.prettify-json@0.0.3
    ms-python.python@2018.4.0
    ms-vscode.csharp@1.15.2
    ms-vscode.github-issues-prs@0.9.0
    ms-vscode.PowerShell@1.7.0
    robertohuertasm.vscode-icons@7.23.0
    Shan.code-settings-sync@2.9.2
    tariky.easy-snippet-maker@0.0.6
    tht13.html-preview-vscode@0.1.1
    wayou.vscode-todo-highlight@0.5.12
    [PS] ...\MyDir> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      5.1.17134.81
    PSEdition                      Desktop
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    BuildVersion                   10.0.17134.81
    CLRVersion                     4.0.30319.42000
    WSManStackVersion              3.0
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    

    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).

  9. cpdohert commented on Aug 9, 2018

    @cpdohert

    code -v

    1.25.1
    1dfc5e557209371715f655691b1235b6b26a06be
    x64
    

    $pseditor.EditorServicesVersion

    Major  Minor  Build  Revision
    -----  -----  -----  --------
    1      8      2      0
    

    code --list-extensions --show-versions

    $PSVersionTable

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

    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.

  10. OneSpecialPeg commented on Sep 18, 2018

    @OneSpecialPeg

    Experiencing the same issues. Killing the terminal resolved the issue for me but I don't have old modules or packages.

  11. rjmholt commented on Sep 18, 2018

    @rjmholt
    Contributor

    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.

  12. 9 remaining items

  13. rjmholt commented on Jun 26, 2019

    @rjmholt
    Contributor

    It's probably easier to repro directly with something like:

    Import-Module PSScriptAnalyzer -Version 1.18.1
    Invoke-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.

  14. Hypernut commented on Dec 14, 2019

    @Hypernut

    Any news on this issue? Its very annoying... Thanks!

  15. ghost added
    Needs: Maintainer Attention
    on Dec 14, 2019
  16. rjmholt commented on Dec 15, 2019

    @rjmholt
    Contributor

    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.

  17. ebmarquez commented on Dec 15, 2019

    @ebmarquez
    Author

    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.

  18. rjmholt commented on Dec 15, 2019

    @rjmholt
    Contributor

    Eric Marquez (@ebmarquez) try out the powershell-preview extension if you'd like to evaluate the progress so far

  19. SydneyhSmith commented on Feb 6, 2020

    @SydneyhSmith
    Collaborator

    Going to close this as a result of the major architectural changes we made in the omnisharp port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions