question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:10
  • Comments:30 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RickFlistcommented, Aug 21, 2017

Try these. They are pretty much the only two modules I’ve been working with over that time frame.

[Redacted]

1reaction
RickFlistcommented, Aug 19, 2017

yup. won’t be until EOD Monday probably

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode – PowerShell Formating - JordanTheITguy
If you've been writing in Powershell for any period of time, you've at some point encountered one of the various Powershell formatting ......
Read more >
PowerShell editing with Visual Studio Code
The extension works anywhere you can run VS Code and PowerShell 7 or higher. The extension also works for Windows PowerShell 5.1.
Read more >
5 Essential Features in VS Code for PowerShell | CBT Nuggets
All you need to do is press F5 on your keyboard to run the current PowerShell script in view in the VS Code...
Read more >
Here's How to Make VSCode Faster
Really slow. How are you supposed to be productive when the program is running at snail speed? I'm going to show you how...
Read more >
Understanding file encoding in VS Code and PowerShell
When using VS Code to create and edit PowerShell scripts, it's important that your files are saved using the correct character encoding format....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found