p00f / nvim-ts-rainbow

Rainbow parentheses for neovim using tree-sitter. Use https://sr.ht/~p00f/nvim-ts-rainbow instead
Apache License 2.0
869 stars 67 forks source link

Fix JSX highlighting for jsx files #128

Closed Gelio closed 2 years ago

Gelio commented 2 years ago

Building up on #127 , I've added a bunch of tests for JSX and JavaScript files, and then fixed the problems that were there.

The main issues were:

  1. Improper query inheritance. ecma was not used but defined some useful patterns. javascript reimplemented some of ecma.
  2. Missing jsx node types in javascript levels

Read commit messages for more context on these changes.

I've cleaned up the code and fixed these problems. Now the inheritance should be cleaner and there should not unused files in the inheritance hierarchy.

This fixes #126

Real-life results in JS(X?) files

extended.jsx

image

extended.js

image

Test results

All tests are passing :rocket:

image

p00f commented 2 years ago

Thanks!