Skip to content

Powershell extension consumes full core of CPU when formatting #595

Closed
@latkin

Description

@latkin

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.

Activity

daviwil

daviwil commented on Mar 21, 2017

@daviwil
Contributor

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
}
added this to the 0.12.0 milestone on Mar 21, 2017
latkin

latkin commented on Mar 21, 2017

@latkin
Author

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

daviwil

daviwil commented on Mar 21, 2017

@daviwil
Contributor

Got it! Thanks.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @daviwil@latkin@kapilmb

      Issue actions

        Powershell extension consumes full core of CPU when formatting · Issue #595 · PowerShell/vscode-powershell