diff options
| -rw-r--r-- | queries/ecma/injections.scm | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm index 7ea48dec4..ef3b9ba72 100644 --- a/queries/ecma/injections.scm +++ b/queries/ecma/injections.scm @@ -3,26 +3,27 @@ (comment) @comment -; html(`...`), sql(...) etc -(call_expression - function: ((identifier) @language) - arguments: (arguments - (template_string) @content - (#offset! @content 0 1 0 -1)) -) - -; html`...`, sql`...` etc -(call_expression +; html(`...`), html`...`, sql(...) etc +(call_expression function: ((identifier) @language) - arguments: ((template_string) @content - (#offset! @content 0 1 0 -1)) -) + arguments: [ + (arguments + (template_string) @content) + (template_string) @content + ] + (#offset! @content 0 1 0 -1) + (#not-eq? @content "svg")) -; svg`...`, which uses the html parser +; svg`...` or svg(`...`), which uses the html parser, so is not included in the previous query (call_expression - function: ((identifier) @_name (#eq? @_name "svg")) - arguments: ((template_string) @html - (#offset! @html 0 1 0 -1))) + function: ((identifier) @svg) + arguments: [ + (arguments + (template_string) @content) + (template_string) @content + ] + (#offset! @content 0 1 0 -1) + (#eq? @content "svg")) (call_expression function: ((identifier) @_name |
