Skip to content

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

Closed

Description

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

Activity

  1. iSazonov commented on Sep 20, 2018

    @iSazonov
    Collaborator

    Related #3373

  2. added
    Issue-Question
    on Sep 20, 2018
  3. BrucePay commented on Sep 21, 2018

    @BrucePay
    Collaborator

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

  4. iSazonov commented on Sep 21, 2018

    @iSazonov
    Collaborator

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

  5. added
    Issue-Enhancement
    on Oct 2, 2018
  6. added
    Resolution-Fixed
    and removed
    Issue-Question
    on Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementResolution-FixedWG-Interactive-IntelliSense

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions