Skip to content

Intellisense for "[PSCustomObject]" leaves an extra close square bracket causing a syntax error #5003

Open
@JLambEJG

Description

@JLambEJG

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Using Intellisesnse while typing-out [PSCustomObject], before I type the closing square brackets, an extra square bracket is appended, causing a syntax error.

PowerShell Version

$psversiontable ;host

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.20348
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2024.2.2
InstanceId       : 795c2dfd-55fe-4258-b089-29937135df2b
UI               : System.Management.Automation.Internal.Host.InternalHos 
                   tUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy     
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

code --version
1.90.0
89de5a8d4d6205e5b11647eb6a74844ca23d2573
x64

Extension Version

code --list-extensions --show-versions | select-string powershell

ms-vscode.powershell@2024.2.2

Steps to Reproduce

Type "[PSCustom" and then press the tab key

Visuals

Pressing TAB at this point:
image

Causes this extra square bracket at this point:
image

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions