Skip to content

PowerShell 7.6.0-preview.4: $env: & $function: no longer tabbing #25299

@brian6932

Description

@brian6932

Prerequisites

Steps to reproduce

$script:+TAB & $+TAB seem to work though.

Expected behavior

PowerShell 7.6.0-preview.3 and below have no issues tabbing.

Actual behavior

Tabbing issues.

Error details

$env:PSModulePath = $null; pwsh -NoProfile
PowerShell 7.6.0-preview.4
PS C:\> Get-Error

Exception             :
    Type           : System.Management.Automation.MethodInvocationException
    ErrorRecord    :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Exception calling "CompleteInput" with "3" argument(s): "Object reference not set to an instance
of an object."
            HResult : -2146233087
        CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : NullReferenceException
        InvocationInfo        :
            ScriptLineNumber : 40
            OffsetInLine     : 16
            HistoryId        : 1
            Line             : return [System.Management.Automation.CommandCompletion]::CompleteInput(

            Statement        : [System.Management.Automation.CommandCompletion]::CompleteInput(
                               <#inputScript#>  $inputScript,
                               <#cursorColumn#> $cursorColumn,
                               <#options#>      $options)
            PositionMessage  : At line:40 char:16
                               + …      return [System.Management.Automation.CommandCompletion]::Complet …
                               +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            CommandOrigin    : Internal
        ScriptStackTrace      : at <ScriptBlock><End>, <No file>: line 40
                                at PSConsoleHostReadLine,
~\Documents\PowerShell\Modules\PSReadLine\2.2.0\PSReadLine.psm1: line 7
    TargetSite     :
        Name          : ConvertToMethodInvocationException
        DeclaringType : [System.Management.Automation.ExceptionHandlingOps]
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Message        : Exception calling "CompleteInput" with "3" argument(s): "Object reference not set to an instance
of an object."
    Data           :
        System.Management.Automation.Interpreter.InterpretedFrameInfo, System.Management.Automation, Version=7.6.0.4,
Culture=neutral, PublicKeyToken=31bf3856ad364e35 : <ScriptBlock><End> PSConsoleHostReadLine

    InnerException :
        Type       : System.NullReferenceException
        TargetSite :
            Name          : CompleteVariable
            DeclaringType : [System.Management.Automation.CompletionCompleters]
            MemberType    : Method
            Module        : System.Management.Automation.dll
        Message    : Object reference not set to an instance of an object.
        Source     : System.Management.Automation
        HResult    : -2147467261
        StackTrace :
   at System.Management.Automation.CompletionCompleters.CompleteVariable(CompletionContext context)
   at System.Management.Automation.CompletionAnalysis.GetResultHelper(CompletionContext completionContext, Int32&
replacementIndex, Int32& replacementLength)
   at System.Management.Automation.CompletionAnalysis.GetResults(PowerShell powerShell, Int32& replacementIndex, Int32&
replacementLength)
   at System.Management.Automation.CommandCompletion.CompleteInputImpl(Ast ast, Token[] tokens, IScriptPosition
positionOfCursor, Hashtable options)
   at CallSite.Target(Closure, CallSite, Type, String, Int32, Hashtable)
    Source         : System.Management.Automation
    HResult        : -2146233087
    StackTrace     :
   at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type
typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
   at CallSite.Target(Closure, CallSite, Type, String, Int32, Hashtable)
   at System.Management.Automation.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : NullReferenceException
InvocationInfo        :
    ScriptLineNumber : 40
    OffsetInLine     : 16
    HistoryId        : 1
    Line             : return [System.Management.Automation.CommandCompletion]::CompleteInput(

    Statement        : [System.Management.Automation.CommandCompletion]::CompleteInput(
                       <#inputScript#>  $inputScript,
                       <#cursorColumn#> $cursorColumn,
                       <#options#>      $options)
    PositionMessage  : At line:40 char:16
                       + …      return [System.Management.Automation.CommandCompletion]::Complet …
                       +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock><End>, <No file>: line 40
                        at PSConsoleHostReadLine,
~\Documents\PowerShell\Modules\PSReadLine\2.2.0\PSReadLine.psm1: line 7

Environment data

Name                           Value
----                           -----
PSVersion                      7.6.0-preview.4
PSEdition                      Core
GitCommitId                    7.6.0-preview.4
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions