PowerShell / PowerShell/vscode-powershell

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

Offen
#5,003 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Area-Snippets Issue-Bug Up for Grabs
Vorherrschende Sprache
TypeScript
Sterne
1.9k
Forks
548
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem in Visual Studio Code, indem du "[PSCustom" eingibst und dann Tab drückst, und verfolge anschließend die Verarbeitung der IntelliSense-Vervollständigung der Erweiterung. Fertig ist die Aufgabe, wenn beim Vervollständigen des Typnamens keine zusätzliche schließende eckige Klammer eingefügt wird und das resultierende PowerShell syntaktisch gültig bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell, typescript, vscode
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.