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

Support generics syntax in JSX with TS #7073

Closed

Conversation

lukehaas
Copy link
Contributor

Currently, a function that uses generics will look like this when the mode is JSX with TypeScript.

Screenshot 2023-10-25 at 17 15 14

With this fix, it will now be highlighted correctly:

Screenshot 2023-10-25 at 17 17 19

@marijnh
Copy link
Member

marijnh commented Oct 26, 2023

Why does this assume there will be a trailing comma in the type parameter list? Is that a thing people use to work around this ambiguity in TSX code?

@lukehaas
Copy link
Contributor Author

@marijnh yes, it tells the typescript compiler to recognize that it's a type, not a JSX tag.

marijnh added a commit that referenced this pull request Oct 27, 2023
@marijnh
Copy link
Member

marijnh commented Oct 27, 2023

Merged as bcb8626, followed up by adc4282 to make false-positives a bit less likely.

@marijnh marijnh closed this Oct 27, 2023
@Evike23
Copy link

Evike23 commented Dec 19, 2023

main

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

Successfully merging this pull request may close these issues.

None yet

3 participants