diff options
| -rw-r--r-- | queries/ecma/injections.scm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm index 00ff12c5a..011d953bf 100644 --- a/queries/ecma/injections.scm +++ b/queries/ecma/injections.scm @@ -17,9 +17,12 @@ (#lua-match? @injection.language "^[a-zA-Z][a-zA-Z0-9]*$") (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children) - (#not-eq? @injection.language "svg")) + ; Languages excluded from auto-injection due to special rules + ; - svg uses the html parser + ; - css uses the styled parser + (#not-any-of? @injection.language "svg" "css")) -; svg`...` or svg(`...`), which uses the html parser, so is not included in the previous query +; svg`...` or svg(`...`) (call_expression function: ((identifier) @_name @@ -57,6 +60,16 @@ ((glimmer_template) @injection.content (#set! injection.language "glimmer")) +; css`<css>`, keyframes`<css>` +(call_expression + function: (identifier) @_name + (#any-of? @_name "css" "keyframes") + arguments: + ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) + ; styled.div`<css>` (call_expression function: |
