PowerShell / PowerShell/vscode-powershell

VS Code\PowerShell - "Formatting Document" Long Execution Time

Open
#984 30 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Code Formatting Issue-Performance
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

System Details
  • Operating system name and version: Windows 10 Ent x64
  • VS Code version: 1.14.2 (Latest)
  • PowerShell extension version: 1.4.1 (Latest)
  • Output from $PSVersionTable:

Name Value


PSVersion 5.1.15063.483
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.483
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v
1.14.2
cb82febafda0c8c199b9201ad274e25d9a76874e

$pseditor.EditorServicesVersion
Major Minor Build Revision


1 4 1 0

code --list-extensions --show-versions
ms-vscode.PowerShell@1.4.1

$PSVersionTable
v-toddle.microsoft.com.zip
Name Value


PSVersion 5.1.15063.483
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.483
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Issue Description

Hello! I posted this to VS Code and they referred me here (https://github.com/Microsoft/vscode/issues/31985#issuecomment-320095822)

I've noticed over the last couple days/week that VS Code is taking a very long time on "Formatting Document". I have my VS Code instance configured to format the document on every save, and I save constantly, so this is a real PITA. :( I have attached the contents of $env:APPDATA\Code\User to this report.

Steps to Reproduce

Steps to Reproduce:

Configure VS Code using my settings.json
Open up any Posh Script. I have encountered this on scripts with as few as 120 lines
Make a change
Save file
Blue bar at bottom of VS Code states "Formatting Document". VS Code is responsive, but Snippets and Intellisense do not function until it completes doing whatever it was doing.
Reproduces without extensions: No

Attached Logs

v-toddle.microsoft.com.zip

Follow the instructions in the README
about capturing and sending logs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the attached settings.json and log archives, then reproduce formatting on save with a PowerShell script in VS Code. Trace the extension's formatting path and verify that formatting completes promptly without blocking snippets or IntelliSense; confirm the behavior across the reported environment details.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.