From 8c53d405e4f22595ac80c58c207cbef256685bd6 Mon Sep 17 00:00:00 2001 From: Dylan Byars Date: Thu, 2 Jun 2022 23:15:49 -0400 Subject: [PATCH] `javascriptreact` filetype uses `javascript` queries --- queries/javascript/nvimGPS.scm | 16 +++++++++++++++- queries/javascriptreact/nvimGPS.scm | 17 ----------------- queries/reacthooks/nvimGPS.scm | 12 ------------ 3 files changed, 15 insertions(+), 30 deletions(-) delete mode 100644 queries/javascriptreact/nvimGPS.scm delete mode 100644 queries/reacthooks/nvimGPS.scm 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)