[FR] TypeScriptReact syntax highlighting (tsx)
See original GitHub issueCurrently, only .ts
extensions get syntax highlighting, whereas .tsx
files get none. Support for .tsx
files is built into language-typescript
, so it seems like this would be an easy one to add here https://github.com/refined-bitbucket/refined-bitbucket/blob/dev/src/syntax-highlight/language-ext.js#L65
Is adding support for .tsx
as simple as adding '.tsx': 'language-typescript',
after the line referenced above? And if so, would you accept a PR for this feature?
Thank you for this extension! We just started using it on our team and love it so far!
Issue Analytics
- State:
- Created 6 years ago
- Comments:21 (21 by maintainers)
Top Results From Across the Web
React JSX syntax highlighting for vim and Typescript - GitHub
Syntax highlighting and indentation for JSX in Typescript ( typescriptreact filetypes). vim-jsx-typescript works with the built-in typescript syntax ...
Read more >How to get TypeScript JSX (TSX) syntax highlighting in neovim
What is the simplest way to get syntax highlighting for tsx files? neovim · Share.
Read more >Modern TypeScript and React Development in Vim - Thoughtbot
Highlighting for large files. Sometimes syntax highlighting can get out of sync in large JSX and TSX files. This was happening too often...
Read more >Provide syntax highlighting for TypeScript React files - GitLab
I've opened an issue with (rouge)[https://github.com/jneen/rouge/issues/516] as well. Whilst #13372 added support for plain TypeScript files, ...
Read more >Vim for TypeScript and React in 2020 | by Vanya Yani - Medium
Syntax highlighting (*.ts and *.tsx files); Go to definition (open another file where a symbol is defined); Refactoring (context-aware find and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apologies, man! I read this and thought you wanted me to tell you how the TS highlighting could be improved. 🤭
I went back and checked again. I loaded the extension from your branch in one window, then opened a different window, disabled the extension from your branch and re-enabled the one from the store, then cleared my cache and loaded up a PR in that window. Refreshed a few times just to be sure, but your version is definitely an improvement and preferable over 3.5.0. It includes the fix I mentioned above with
Component<ComponentProps>
, and also added highlighting for elements within the JSX. You can see in the screenshots above that<React.Fragment>
and<div>
get highlighted. In 3.5.0, elements aren’t getting highlighted at all. (The issue I mentioned with<RadioPillBox
above I think is actually because the attributes are not on the same line, but that’s neither here nor there. 🙃)So, to answer your question, it looks like the new version of PrismJS is loaded correctly! Thanks again so much for your work on this! 😄
Looks great, @reyronald! Thanks again! 😊