Skip to content

Code formatting breaks the code by moving brace to a comment #1272

Closed
@Rogacz

Description

@Rogacz

System Details

  • Operating system name and version: Windows 10 1703
  • VS Code version: 1.22.2
  • PowerShell extension version: 1.6.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.15063.966
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.966
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem with code formatting.
I used default powershell.codeFormatting settings and have set:

"editor.formatOnPaste": true,
"editor.formatOnType": true,

If I paste a code with opening brace on second line it doesn't check if previous line finished with a comment and moves brace, breaking the code.

c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions