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

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

Closed
ryanrhee opened this issue Jan 31, 2023 · 4 comments

Comments

@ryanrhee
Copy link

ryanrhee commented Jan 31, 2023

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.

@adamschoenemann
Copy link

I'm seeing the same issue.

@adamschoenemann
Copy link

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

@ryanrhee
Copy link
Author

ryanrhee commented Feb 9, 2023

same question here.

@sheetalkamat
Copy link
Member

https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next should pick it up

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

3 participants