diff --git a/queries/javascript/nvimGPS.scm b/queries/javascript/nvimGPS.scm index 9e26d4e..57fc87c 100644 --- a/queries/javascript/nvimGPS.scm +++ b/queries/javascript/nvimGPS.scm @@ -1,4 +1,18 @@ -; inherits: javascriptreact +; Hooks +; +; calling a hook -> useFoo() +((call_expression + function: (identifier) @hook-name (#match? @hook-name "^use") + ) @scope-root) + +; JSX +; +; tags -> `` +((jsx_element open_tag: (jsx_opening_element name: (_) @tag-name)) @scope-root) + +; self-closing tag -> `` +((jsx_self_closing_element name: (_) @tag-name) @scope-root) + ; Class ((class_declaration diff --git a/queries/javascriptreact/nvimGPS.scm b/queries/javascriptreact/nvimGPS.scm deleted file mode 100644 index 2fe69f7..0000000 --- a/queries/javascriptreact/nvimGPS.scm +++ /dev/null @@ -1,17 +0,0 @@ -; inherits; javascript - -; Hooks -; -; calling a hook -> useFoo() -((call_expression - function: (identifier) @hook-name (#match? @hook-name "^use") - ) @scope-root) - -; JSX -; -; tags -> `` -((jsx_element open_tag: (jsx_opening_element name: (_) @tag-name)) @scope-root) - -; self-closing tag -> `` -((jsx_self_closing_element name: (_) @tag-name) @scope-root) - diff --git a/queries/reacthooks/nvimGPS.scm b/queries/reacthooks/nvimGPS.scm deleted file mode 100644 index cfa353d..0000000 --- a/queries/reacthooks/nvimGPS.scm +++ /dev/null @@ -1,12 +0,0 @@ - -; React hook name -((call_expression - function: (identifier) @hook-name (#match? @hook-name "^use") - ) @scope-root) - -; React hook function name -((variable_declarator - name: (identifier) @function-name - value: (call_expression - function: (identifier) @hook-identifier (#match? @hook-identifier "^use") - )) @scope-root)