Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/ecma/injections.scm')
| -rw-r--r-- | runtime/queries/ecma/injections.scm | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/runtime/queries/ecma/injections.scm b/runtime/queries/ecma/injections.scm index 71163c5c..af3aef10 100644 --- a/runtime/queries/ecma/injections.scm +++ b/runtime/queries/ecma/injections.scm @@ -7,26 +7,13 @@ (member_expression property: (property_identifier) @injection.language) ] - arguments: (template_string) @injection.content - (#any-of? @injection.language "html" "css" "json" "sql" "js" "ts" "bash")) - -; Parse the contents of $ template literals as shell commands - -(call_expression - function: [ - (identifier) @_template_function_name - (member_expression - property: (property_identifier) @_template_function_name) - ] - arguments: (template_string) @injection.content - (#eq? @_template_function_name "$") - (#set! injection.language "bash")) + arguments: (template_string) @injection.content) ; Parse the contents of gql template literals ((call_expression function: (identifier) @_template_function_name - arguments: (template_string (string_fragment) @injection.content)) + arguments: (template_string) @injection.content) (#eq? @_template_function_name "gql") (#set! injection.language "graphql")) @@ -47,18 +34,3 @@ (#set! injection.language "comment") (#match? @injection.content "^//")) -; Match string literals passed to standard browser API methods that expects a -; css selector as argument. -; - https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector -; - https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll -; - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest -; - https://developer.mozilla.org/en-US/docs/Web/API/Element/matches -; e.g. -; `const el = document.querySelector("div.user-panel.main input[name='login']");` -(call_expression - function: (member_expression - object: (identifier) @_object - property: (property_identifier) @_property (#any-of? @_property "querySelector" "querySelectorAll" "closest" "matches")) - arguments: (arguments - (string (string_fragment) @injection.content)) - (#set! injection.language "css")) |