microsoft / vscode-typescript-next

Enables typescript@next as VS Code's built-in TypeScript version
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next
MIT License
224 stars 41 forks source link

Incorrect syntax highlighting of object property type with inline comments #109

Closed alexjurkiewicz closed 8 months ago

alexjurkiewicz commented 8 months ago

Tested with v5.4.20240202 ("Last released 2024-02-03, 08:13:15")

Minimal repro:

export type foo = {
  bar:
    | string // comment breaks subsequent highlighting of type
    | string;
};

The renders correctly on Github. In vscode, types for bar after the first // comment are broken. Image (taken with Codesnap extension): syntax issue

The breakage isn't total. [ brackets ] still partially work. The brackets themselves render correctly, and null is coloured (incorrectly) within. I didn't dig into the details though.

Thank you for a great extension!

alexjurkiewicz commented 8 months ago

Duplicate of https://github.com/microsoft/TypeScript-TmLanguage/issues/989, sorry