peitalin / vim-jsx-typescript

React JSX syntax highlighting for vim and Typescript
The Unlicense
305 stars 29 forks source link

Doesn't handle Fragment short syntax #8

Closed DuBistKomisch closed 5 years ago

DuBistKomisch commented 5 years ago

I'd love to use this plugin but we extensively use <></> as an empty element return and it breaks the highlighting for the rest of the file. It's relatively new syntax, see here: https://reactjs.org/docs/fragments.html#short-syntax. Works fine for my coworkers using VS Code of course. :stuck_out_tongue:

I was going to try fixing this myself but the regexes are pretty confusing. I notice this is kind of a fork of a fork of a fork, perhaps one of them has fixed it already and we can just pull in some updates?

peitalin commented 5 years ago

Thanks for the heads up, I've added some rules for fragments. image

DuBistKomisch commented 5 years ago

@peitalin good timing, was just trying it out, seems like a big improvement but it appears self-closing elements now mess up the typescript highlighting afterwards:

image

peitalin commented 5 years ago

Ok, let's see if it's working now: image

DuBistKomisch commented 5 years ago

Seems to be working here as well!