Skip to content

Workaround when a module takes too long to run Get-Help #2737

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
PrzemyslawKlys opened this issue Jun 1, 2020 · 1 comment
Closed

Workaround when a module takes too long to run Get-Help #2737

PrzemyslawKlys opened this issue Jun 1, 2020 · 1 comment

Comments

@PrzemyslawKlys
Copy link
Contributor

PrzemyslawKlys commented Jun 1, 2020

Issue Description

I am experiencing a problem with... Get-Help taking very long time on some modules and impacting PowerShell extension.

Spawned from issue: #2627

Get-Help -Name Merge-CCBranchesBySquash -ErrorAction Ignore

As per @TylerLeonhardt quote:

This is taking like 20 seconds from the logs. (which is what we run to get more information about the command to display next to completions)

As per comment of @SeeminglyScience

It's part of it for sure, but as it turns out they have a pretty solid reason.

Honestly though, even if they had that Get-Help would still take just as long to run probably. Short of a complete overhaul of the completion API's to be based on entirely around static analysis, there's not much that can be done about that.

A workaround would need to consider that we (users) have no clue something is taking a too long time to load. So this would have to be detected and suggested to be ignored.

Possible solution by @TylerLeonhardt

I guess we could offer a setting to disable running Get-Help and just show syntax like we do if no help comes back... but that's sad :(

We could expose our exclusion list(s) via settings:

https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs#L20-L50

Which basically contain PowerShellGet and PackageManagement atm (to prevent PackageManagement from loading...)

Then you could exclude AWS's cmdlets/noun somehow.

Yeah we can possibly detect how long it takes and recommend ignoring a module...

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.19041
VSCode 1.45.1
PowerShell Extension Version 2020.6.0

PowerShell Information

Name Value
PSVersion 5.1.19041.1
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.19041.1
BuildVersion 10.0.19041.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
bracket-pair-colorizer-2 CoenraadS 0.1.4
code-settings-sync Shan 3.4.3
github-linker gimenete 0.2.3
gitlens eamodio 10.2.1
grammarly znck 0.12.1
markdown-all-in-one yzhang 3.0.0
material-icon-theme PKief 4.1.0
powershell-preview ms-vscode 2020.6.0
project-manager alefragnani 11.0.1
vscode-markdownlint DavidAnson 0.36.0
vscode-pull-request-github GitHub 0.16.0
vscode-toggle-quotes BriteSnow 0.3.2
vscode-wakatime WakaTime 4.0.0
xml DotJoshJohnson 2.5.0
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 1, 2020
@SydneyhSmith SydneyhSmith added Area-IntelliSense Issue-Performance Something's slow. and removed Needs: Triage Maintainer attention needed! labels Jun 2, 2020
@andyleejordan
Copy link
Member

Was this resolved @PrzemyslawKlys? Noticed it was closed.

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

No branches or pull requests

3 participants