You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
While working on #125 I noticed that JSX elements are not highlighted in files with the jsx extension (filetype=javascriptreact).
Steps to reproduce
For a file test.jsx:
importstylesfrom"./App.module.css";constApp=()=>{return(<divclass={styles.App}data-comparison={1<2&&1>2}><headerclass={1+2*(1+2)&&styles.header}><span>I should be highlighted</span></header></div>);};exportdefaultApp;
with extended_mode enabled, the JSX tags are not highlighted by nvim-ts-rainbow. Parentheses are highlighted by nvim-ts-rainbow and have different colors.
Expected behavior
JSX tags are highlighted by nvim-ts-rainbow.
This works well for files with the tsx extension (see #125), but jsx extension is ignored.
Here is the expected look of this file (I did :set filetype=typescriptreact to achieve it):
The jsx-highlighting queries are defined for the jsx parser. It may be the case that the jsx parser is not used for the jsx files because it uses the javascript parser now.
Thus, I believe we should remove any code that references the jsx parser and instead add highlighting jsx to the javascript parser.
The text was updated successfully, but these errors were encountered:
While working on #125 I noticed that JSX elements are not highlighted in files with the
jsx
extension (filetype=javascriptreact
).Steps to reproduce
For a file
test.jsx
:with
extended_mode
enabled, the JSX tags are not highlighted bynvim-ts-rainbow
. Parentheses are highlighted bynvim-ts-rainbow
and have different colors.Expected behavior
JSX tags are highlighted by
nvim-ts-rainbow
.This works well for files with the
tsx
extension (see #125), butjsx
extension is ignored.Here is the expected look of this file (I did
:set filetype=typescriptreact
to achieve it):Investigation
I did some digging around and noticed that the
parsername
for thejavascriptreact
filetype isjavascript
. Fortsx
andtypescriptreact
, it istsx
.The jsx-highlighting queries are defined for the
jsx
parser. It may be the case that thejsx
parser is not used for thejsx
files because it uses thejavascript
parser now.Thus, I believe we should remove any code that references the
jsx
parser and instead add highlightingjsx
to thejavascript
parser.The text was updated successfully, but these errors were encountered: