Skip to content
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

Autocompletion gives no results for $PSItem / $_ in Catch blocks #7828

Closed
vexx32 opened this issue Sep 20, 2018 · 3 comments · Fixed by #8020

Comments

@vexx32
Copy link
Contributor

commented Sep 20, 2018

Despite the fact that catch blocks should always receive an ErrorRecord object as the $_ or $PSItem value, there is no autocompletion / type inference performed for its properties, nor those of the Exception and/or InnerExceptions it contains.

Steps to reproduce

try {
    throw "nope"
}
catch {
    $PSItem.{tab}
}

Expected behavior

    $PSItem.CategoryInfo      # And cycle through list of ErrorRecord properties on subsequent presses

(I know there's a programmatic way to get completion results, but I'm not familiar enough with how it works to be able to put that together at present.)

Actual behavior

    $PSItem.                 # no completion results offered whatsoever

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Microsoft Windows 10.0.17134
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@iSazonov

This comment has been minimized.

Copy link
Collaborator

commented Sep 20, 2018

Related #3373

@BrucePay

This comment has been minimized.

Copy link
Collaborator

commented Sep 21, 2018

@iSazonov I'm not sure why this is marked as a question. It sounds like an enhancement request to me.

@iSazonov

This comment has been minimized.

Copy link
Collaborator

commented Sep 21, 2018

@BrucePay I do not know if it is possible to implement. If yes, then this is an enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.