Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS Syntax highlight broken for multiline generic arguments of function in object #1028

Open
wolflu05 opened this issue Apr 30, 2024 · 0 comments
Assignees

Comments

@wolflu05
Copy link

wolflu05 commented Apr 30, 2024

Type: Bug

When having a function with generic type params in an object and the generic type params wrap into multiple lines, the TS syntax highlighting is broken.

To reproduce, just paste the following code in a .ts file and see the broken output:

const myObj = {
  test<
    A extends Record<string, any>,
    C extends Record<string, any>,
    B extends Record<string, any>,
  >(a: A, b: B, c: C): Record<string, any>[] {
    if ('hello' in a) {
      console.log('Test');
    }
    return [a, b, c];
  },
};

For reference, I added the same function but outside of the object which shows the correct/broken highlight in comparison:
image

VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:42:52.765Z)
OS version: Darwin x64 22.6.0
Modes:

@mjbvz mjbvz transferred this issue from microsoft/vscode Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants