microsoft / TypeScript-TmLanguage

TextMate grammar files for TypeScript for VS Code, Sublime Text, and Atom.
MIT License
398 stars 125 forks source link

VSCode Syntax highlighting broken when using TypeScript multiline generics in ES6 object function shorthand syntax #894

Open leonsilicon opened 2 years ago

leonsilicon commented 2 years ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create a typescript file with the following code:

    
    const obj = {
    fn<
        K extends string
    >(_: K) {
        const a = 'a';
    
        function _f() {
            const b = 'b';
            return b;
        }
    
        return a;
    },
    };

const obj2 = { fn(_: K) { const a = 'a';

    function _f() {
        const b = 'b';
        return b;
    }

    return a;
},

};


2. Notice how the syntax highlighting is broken in the first object declaration:
<img width="566" alt="image" src="https://user-images.githubusercontent.com/36966635/144325213-02cf52d0-669d-45a0-9bf8-d4f4dad18bba.png">