Skip to content

TypeScript lexer fails to highlight string literal generics #1009

@SKalt

Description

@SKalt

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In TypeScript, string constants are valid types. Here's an screenshot from the syntax highlighting in VSCode:
Screenshot from 2024-10-14 07-54-45

Contrast with the syntax highlighting in the most recent version of chroma:

Screenshot from 2024-10-14 07-56-33

Note that the syntax error with the comma was resolved in #1002.

To Reproduce

type T<U> = Complicated<U, "stuff">
//                         ^-----^
//    not highlighted as a literal

playground link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions