HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
533 stars 39 forks source link

[Feat]: React & Framer Motion support #39

Closed Dosx001 closed 1 year ago

Dosx001 commented 1 year ago

It would be nice if there were improvements to JSX queries to support Framer Motion.

This is how rainbow-delimiters.nvim renders with React and Framer Motion.

rainbow-delimiters

This is how it looked on p00f/nvim-ts-rainbow. It also included the "<" and ">" symbols, it would also be nice if that functionality could be duplicated.

full color

HiPhish commented 1 year ago

Next time please include the code snippet so I can copy and paste it instead of having to type the code in myself off a screenshot.

This is unrelated to Framer, it's a parser issue. Normally the name inside the tag is parsed as an identifier node, but in your example there is a dot inside the tag, which causes the parser to parse it as ``

(member_expression
  (identifier)
  (property_identifier))

I can highlight the entire expression or only the part before the dot. Which do you think makes more sense?

HiPhish commented 1 year ago

Screenshots for comparison:

Screenshot_20230928_150247

Screenshot_20230928_150320

Dosx001 commented 1 year ago

@HiPhish The second image looks good. Thanks for the good work!

HiPhish commented 1 year ago

Check the current master branch.