Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powershell extension consumes full core of CPU when formatting #595

Closed
latkin opened this issue Mar 21, 2017 · 3 comments
Closed

Powershell extension consumes full core of CPU when formatting #595

latkin opened this issue Mar 21, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@latkin
Copy link

latkin commented Mar 21, 2017

System Details

  • Operating system name and version: Windows 10
  • VS Code version: 1.10.2
  • PowerShell extension version: 0.10.1
  • Output from $PSVersionTable:
Name                           Value
----                           -----
WSManStackVersion              3.0
CLRVersion
SerializationVersion           1.1.0.1
PSEdition                      Core
BuildVersion                   3.0.0.0
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
PSVersion                      6.0.0-alpha
GitCommitId                    v6.0.0-alpha.15

Issue Description

If I open a powershell script and make a few edits, I get a message "Formatting PowerShell document..." spinning forever in the footer of VS Code

image

Meanwhile, the powershell process which is powering the editor features consumes a cull core of CPU:

image

Attached Logs

EditorServices.log is over 300MB at this point, so hopefully something relevant in there. Do you have a suggested way to share? Or maybe I can just let it run for a few seconds to generate 5-10MB of logs.

@daviwil
Copy link
Contributor

daviwil commented Mar 21, 2017

Hmmm, it shouldn't get hung like that. Capturing a shorter log file would be helpful, you can e-mail it to me at daviwil at microsoft.com.

In the meantime, you could turn off editor.formatOnType for all languages or just for for PowerShell in your user settings:

"[powershell]": {
    "editor.formatOnType": false
}

@daviwil daviwil added the Issue-Bug A bug to squash. label Mar 21, 2017
@daviwil daviwil added this to the 0.12.0 milestone Mar 21, 2017
@latkin
Copy link
Author

latkin commented Mar 21, 2017

Just emailed logs from a short session. Issue repros 100% for me - CPU starts spinning when editing any ps1 script.

@daviwil
Copy link
Contributor

daviwil commented Mar 21, 2017

Got it! Thanks.

@daviwil daviwil modified the milestones: 0.12.0, Next Patch Update Mar 24, 2017
@daviwil daviwil modified the milestones: 0.12.0, Next Patch Update Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants