Skip to content

Broken template literal type highlight without TypeScript Nightly extension #2074

@greentore

Description

@greentore

Describe the bug
infer T extends ... syntax within template literal types is highlighted incorrectly. It works fine in vanilla VSCode and VSCodium with TypeScript Nightly extension installed from open-vsx.

Please confirm that this problem is VSCodium-specific

  • This bug doesn't happen if I use Microsoft's Visual Studio Code. It only happens in VSCodium.

Please confirm that the issue/resolution isn't already documented

To Reproduce

type T0 = "100" extends `${infer T extends number}` ? T : never; // 100
type T1 = "100" extends `${infer T extends bigint}` ? T : never; // 100n
type T2 = "true" extends `${infer T extends boolean}` ? T : never; // true

Taken from microsoft/TypeScript#48094

Expected behavior
Template literal highlight shouldn't leak beyond the closing tick.

Screenshots
Broken
broken
Working
working

Desktop (please complete the following information):

  • OS: Windows 10
  • Architecture: x64
  • Version: 1.94.2.24286
  • App Manager: scoop
  • Sandboxed: no

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions