feat: query for only react tags in jsx,tsx

This commit is contained in:
Riley Bruins 2023-12-23 10:58:33 -08:00
parent dfac7cdeae
commit e78b01a647
3 changed files with 35 additions and 0 deletions

View file

@ -353,11 +353,13 @@ addition there are the following extra queries for certain languages:
- `rainbow-delimiters-react` Includes React support, set by default for
Javascript files
- `rainbow-parens` Only parentheses without React tags
- `rainbow-tags-react` Only React tags without parentheses
- `query`
- `rainbow-blocks` Highlight named nodes and identifiers in addition to
parentheses (useful for |:InspectTree|)
- `tsx`
- `rainbow-parens` Just Typescript highlighting without React tags
- `rainbow-tags-react` Only React tags without Typescript highlighting
- `typescript`
- `rainbow-parens` Just Typescript highlighting without React tags
- `verilog`

View file

@ -0,0 +1,29 @@
(jsx_element
open_tag: (jsx_opening_element
"<" @delimiter
name: (identifier) @delimiter
">" @delimiter)
close_tag: (jsx_closing_element
"</" @delimiter
name: (identifier) @delimiter
">" @delimiter @sentinel)) @container
(jsx_element
open_tag: (jsx_opening_element
"<" @delimiter
name: (member_expression) @delimiter
">" @delimiter)
close_tag: (jsx_closing_element
"</" @delimiter
name: (member_expression) @delimiter
">" @delimiter @sentinel)) @container
(jsx_self_closing_element
"<" @delimiter
name: (identifier) @delimiter
"/>" @delimiter @sentinel) @container
(jsx_self_closing_element
"<" @delimiter
name: (member_expression) @delimiter
"/>" @delimiter @sentinel) @container

View file

@ -0,0 +1,4 @@
; inherits: javascript
;;; This query exists for people who only want to highlight tags without
;;; parentheses.