Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
javascriptreact filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbyars committed Jun 3, 2022
1 parent 9c5e5af commit 523707b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions queries/javascriptreact/nvimGPS.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
; inherits; javascript

; Hooks
;
; calling a hook -> useFoo()
((call_expression
function: (identifier) @hook-name (#match? @hook-name "^use")
) @scope-root)

; JSX
;
; tags -> `<Kachow></Kachow>`
((jsx_element open_tag: (jsx_opening_element name: (_) @tag-name)) @scope-root)

; self-closing tag -> `<Foo />`
((jsx_self_closing_element name: (_) @tag-name) @scope-root)

0 comments on commit 523707b

Please sign in to comment.