Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
Clean up JavaScript and JSX queries inherit patterns
Browse files Browse the repository at this point in the history
JSX queries are now defined in `jsx/parens.scm`.

JavaScript inherits from `ecma` and `jsx` (since nvim-treesitter uses the
`javascript` filetype for JSX file extensions).

TypeScript continues to inherit from `ecma`.

TSX continues to inherit from `ecma` and `jsx`.

This removes any duplication there were previously and leads to clean
query inheritance.
  • Loading branch information
Gelio authored and p00f committed Aug 7, 2022
1 parent 47102f3 commit 636523e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions queries/javascript/parens.scm
Original file line number Diff line number Diff line change
@@ -1,2 1 @@
; inherits: square,round,curly
"${" @left
; inherits: ecma,jsx
7 changes: 0 additions & 7 deletions queries/jsx/parens.scm
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
; inherits: square,round,curly

((jsx_opening_element
"<" @left-tag-start
name: _ @left
Expand All @@ -19,8 17,3 @@
name: _ @right
">" @right-tag-end
) (#jsx-extended-rainbow-mode? @right-tag-start @right-tag-end @right))

; [(jsx_element
; open_tag: (jsx_opening_element) @left
; close_tag: (jsx_closing_element) @right)
; (#jsx-extended-rainbow-mode?)]

0 comments on commit 636523e

Please sign in to comment.