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

Permit use of trailing comma in generics in TSX lexer #1528

Merged

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented May 30, 2020

When TypeScript is used with React, the syntax for generics (<T>) causes conflicts. The solution is to include a trailing comma (<T,>). This PR updates the TSX lexer to support this use of a trailing comma.

This fixes #1363.

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label May 30, 2020
@pyrmont pyrmont self-assigned this May 30, 2020
@pyrmont pyrmont merged commit c09cb89 into rouge-ruby:master May 30, 2020
@pyrmont pyrmont deleted the bugfix.tsx-generics-trailing-comma branch May 30, 2020 19:40
@pyrmont
Copy link
Contributor Author

pyrmont commented May 30, 2020

@louisrli I did end up splitting this fix out from #1492 and putting it here. Sorry it's taken so long to get it all merged in! This will be part of the next release of Rouge, v3.20.0, that's scheduled for Tuesday 9 June.

@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label May 30, 2020
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 19, 2021
When TypeScript is used with React, the syntax for generics (`<T>`)
causes conflicts. The solution is to include a trailing comma (`<T,>`).
This commit updates the TSX lexer to support this use of a trailing
comma.
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.

TSX not highlighting parts
1 participant