vscode-pretty-formatter icon indicating copy to clipboard operation
vscode-pretty-formatter copied to clipboard

Bad formatting in Typescript when 2 template parameters in a class def

Open ShoryuKyzan opened this issue 2 years ago • 0 comments

Bad formatting in Typescript when 2 template parameters in a class def

Typescript Clean install of insiders, have installed additionally only your extension.

For some reason having a class extending a template with 2 template parameters causes 2nd function in the file to be shifted up a line.

Version: 1.65.0-insider (user setup)
Commit: 8440b8f47231147823ba9696913d642e5f2d9d58
Date: 2022-02-25T05:17:33.544Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

Extension version
v0.2.2

Bad format, not indented or anything.

class AClass extends Extended < TemplateParam1,
TemplateParam2 > {}

export const someFunction = () => {
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
    console.log("somecode");
};function anotherFunction() {
console.log("somecode");
console.log("somecode");
console.log("somecode");
console.log("somecode");
console.log("somecode");
console.log("somecode");
console.log("somecode");
console.log("somecode");
console.log("somecode");}anotherFunction();

USER SETTINGS:

{
    "editor.formatOnSave": true,
    "[typescript]": {
        "editor.defaultFormatter": "mblode.pretty-formatter"
    },
}

DEFAULT SETTINGS - should be same as clean install, too long to put here.

ShoryuKyzan avatar Feb 27 '22 14:02 ShoryuKyzan