Skip to content

Generic parameters, e.g. in typeof foo<T1, T2> not recognized for typeof types #957

Closed

Description

@ryanrhee

TS and JS Grammar Extension version: 0.0.55 / latest

Code

// Please include a code snippet that demonstrates the issue

// this is similar to apollo-client's `useQuery` but simplified for the repro
function useQuery<TData, TVariables>(_vars: TVariables, _data: TData) {
  console.log('hello world')
}

export type UseQuery<TData, TVariables> = typeof useQuery<TData, TVariables>

image

Note the last > - it's red.

This syntax is valid. I believe it's valid as of TS 4.7, from microsoft/TypeScript#47607 .

I've also confirmed that the bug still happens for cases where there's only 1 generic parameter.

Activity

  1. adamschoenemann commented on Feb 8, 2023

    @adamschoenemann

    I'm seeing the same issue.

  2. adamschoenemann commented on Feb 9, 2023

    @adamschoenemann

    Nice! A stupid question: how can I update vscode to use the fixed tmLanguage definition?

  3. ryanrhee commented on Feb 9, 2023

    @ryanrhee
    Author

    same question here.

  4. sheetalkamat commented on Feb 9, 2023

    @sheetalkamat
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions