PowerShell / PowerShell/vscode-powershell

Format on save hangs with PowerShell v7.5.0, runs fine with v7.4.7

Offen
#5,134 14 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Issue-Bug
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

Format on save hangs with PowerShell v7.5.0, it never completes. Works fine with PowerShell v7.4.7.

I've tried with v7.5.0 managed by mise (ref: https://github.com/PowerShell/vscode-powershell/issues/5123#issuecomment-2612568256), and downloaded and unzipped v7.5.0 ZIP myself.

  • Windows 11 x64 24H2
  • VSCode v1.96.4
  • vscode-powershell v2025.0.0
    • Also tried with preview version v2025.1.0
PowerShell Version

v7.5.0 x64 Windows

Name             : Visual Studio Code Host
Version          : 2025.1.0
InstanceId       : dd17a949-7d42-4f49-b509-b842f6923341
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : nb-NO
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
1.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
x64
Extension Version
ms-vscode.powershell@2025.0.0
Steps to Reproduce
  • Use PowerShell v7.5.0
  • Configure format on save for PowerShell in VSCode
  • Open PS1 file, do changes, CTRL + S to save
  • VSCode hangs, formatting never happens
Visuals
Image
Logs

I've added following config:

{
  "powershell editor services.trace.server": "Verbose",
  "powershell.developer.editorServicesLogLevel": "Trace"
}

I see no relevant log events.

  • Is "powershell editor services.trace.server" relevant anymore?

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

Beginne damit, die Formatierung beim Speichern mit PowerShell v7.5.0 zu reproduzieren, und vergleiche sie mit v7.4.7 unter Verwendung der aufgeführten VS Code- und Erweiterungsversionen. Überprüfe beim Speichern einer PS1-Datei die Trace- und editor-services-Protokolle der Erweiterung; abgeschlossen ist die Arbeit, wenn die Formatierung beendet wird, anstatt VS Code hängen zu lassen, und die Regression durch einen geeigneten Test abgedeckt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell, typescript, vscode
Bereich
developer-experience, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

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