Skip to content

Commit

Permalink
fix(queries): mv jsx queries queries/ecma -> queries/jsx
Browse files Browse the repository at this point in the history
Fixes: #361
  • Loading branch information
tmillr committed Aug 7, 2024
1 parent d2b8230 commit e57805c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 0 additions & 22 deletions queries/ecma/highlights.scm

This file was deleted.

22 changes: 22 additions & 0 deletions queries/jsx/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
;; extends

; These fix an nvim-treesitter bug where the `Abc` in `Abc.Xyz` is captured as a
; builtin tag. They also change the capture for `Xyz` to `@variable.member`
; instead of e.g. `@tag` (which gives the property a different color).
(jsx_opening_element
name: (member_expression
; If the tag name contains a dot (operator), it must always be a custom
; tag? Therefore, we're not even going to try matching a `@tag.builtin`
; here.
object: (identifier) @tag (#set! "priority" 115)
property: (property_identifier) @variable.member (#set! "priority" 115)))

(jsx_closing_element
name: (member_expression
object: (identifier) @tag (#set! "priority" 115)
property: (property_identifier) @variable.member (#set! "priority" 115)))

(jsx_self_closing_element
name: (member_expression
object: (identifier) @tag (#set! "priority" 115)
property: (property_identifier) @variable.member (#set! "priority" 115)))

0 comments on commit e57805c

Please sign in to comment.