2022-09-12 23:36:19 +03:00
|
|
|
(((comment) @_jsdoc_comment
|
2023-05-03 19:07:59 +09:00
|
|
|
(#lua-match? @_jsdoc_comment "^/[*][*][^*].*[*]/$")) @injection.content
|
|
|
|
|
(#set! injection.language "jsdoc"))
|
2022-09-12 23:36:19 +03:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
((comment) @injection.content
|
|
|
|
|
(#set! injection.language "comment"))
|
2021-03-09 23:14:27 +01:00
|
|
|
|
2023-03-18 21:59:44 +02:00
|
|
|
; html(`...`), html`...`, sql(...) etc
|
|
|
|
|
(call_expression
|
2023-05-03 19:07:59 +09:00
|
|
|
function: ((identifier) @injection.language)
|
2023-03-18 21:59:44 +02:00
|
|
|
arguments: [
|
|
|
|
|
(arguments
|
2023-05-03 19:07:59 +09:00
|
|
|
(template_string) @injection.content)
|
|
|
|
|
(template_string) @injection.content
|
2023-03-18 21:59:44 +02:00
|
|
|
]
|
2023-05-03 19:07:59 +09:00
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#not-eq? @injection.language "svg"))
|
2023-03-17 09:51:16 +02:00
|
|
|
|
2023-03-18 21:59:44 +02:00
|
|
|
; svg`...` or svg(`...`), which uses the html parser, so is not included in the previous query
|
2023-03-17 09:51:16 +02:00
|
|
|
(call_expression
|
2023-03-18 22:12:27 +02:00
|
|
|
function: ((identifier) @_name (#eq? @_name "svg"))
|
2023-03-18 21:59:44 +02:00
|
|
|
arguments: [
|
|
|
|
|
(arguments
|
2023-05-03 19:07:59 +09:00
|
|
|
(template_string) @injection.content)
|
|
|
|
|
(template_string) @injection.content
|
2023-03-18 21:59:44 +02:00
|
|
|
]
|
2023-05-03 19:07:59 +09:00
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "html"))
|
2023-03-18 22:12:27 +02:00
|
|
|
|
2023-03-17 09:51:16 +02:00
|
|
|
|
2021-03-09 23:14:27 +01:00
|
|
|
(call_expression
|
2021-07-25 15:35:17 +10:00
|
|
|
function: ((identifier) @_name
|
|
|
|
|
(#eq? @_name "gql"))
|
2023-05-03 19:07:59 +09:00
|
|
|
arguments: ((template_string) @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "graphql")))
|
2021-03-09 23:14:27 +01:00
|
|
|
|
|
|
|
|
(call_expression
|
2021-07-25 15:35:17 +10:00
|
|
|
function: ((identifier) @_name
|
|
|
|
|
(#eq? @_name "hbs"))
|
2023-05-03 19:07:59 +09:00
|
|
|
arguments: ((template_string) @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "glimmer")))
|
2021-07-25 15:35:17 +10:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
((glimmer_template) @injection.content
|
|
|
|
|
(#set! injection.language "glimmer"))
|
2022-10-23 14:26:48 -04:00
|
|
|
|
2021-07-25 16:10:58 +10:00
|
|
|
; styled.div`<css>`
|
2021-07-25 15:35:17 +10:00
|
|
|
(call_expression
|
|
|
|
|
function: (member_expression
|
2021-07-25 15:50:55 +10:00
|
|
|
object: (identifier) @_name
|
|
|
|
|
(#eq? @_name "styled"))
|
2023-05-03 19:07:59 +09:00
|
|
|
arguments: ((template_string) @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "css")))
|
2021-07-25 15:50:55 +10:00
|
|
|
|
2021-07-25 16:10:58 +10:00
|
|
|
; styled(Component)`<css>`
|
2021-07-25 15:50:55 +10:00
|
|
|
(call_expression
|
|
|
|
|
function: (call_expression
|
|
|
|
|
function: (identifier) @_name
|
|
|
|
|
(#eq? @_name "styled"))
|
2023-05-03 19:07:59 +09:00
|
|
|
arguments: ((template_string) @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "css")))
|
2021-04-06 20:33:41 +02:00
|
|
|
|
2021-07-25 16:10:58 +10:00
|
|
|
; styled.div.attrs({ prop: "foo" })`<css>`
|
|
|
|
|
(call_expression
|
|
|
|
|
function: (call_expression
|
|
|
|
|
function: (member_expression
|
|
|
|
|
object: (member_expression
|
|
|
|
|
object: (identifier) @_name
|
|
|
|
|
(#eq? @_name "styled"))))
|
2023-05-03 19:07:59 +09:00
|
|
|
arguments: ((template_string) @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "css")))
|
2021-07-25 16:10:58 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
; styled(Component).attrs({ prop: "foo" })`<css>`
|
|
|
|
|
(call_expression
|
|
|
|
|
function: (call_expression
|
|
|
|
|
function: (member_expression
|
|
|
|
|
object: (call_expression
|
|
|
|
|
function: (identifier) @_name
|
|
|
|
|
(#eq? @_name "styled"))))
|
2023-05-03 19:07:59 +09:00
|
|
|
arguments: ((template_string) @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "css")))
|
2021-07-25 16:10:58 +10:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
((regex_pattern) @injection.content
|
|
|
|
|
(#set! injection.language "regex"))
|
2022-06-05 05:50:48 -04:00
|
|
|
|
2023-04-15 19:52:23 -04:00
|
|
|
; ((comment) @_gql_comment
|
|
|
|
|
; (#eq? @_gql_comment "/* GraphQL */")
|
2023-05-03 19:07:59 +09:00
|
|
|
; (template_string) @injection.content
|
|
|
|
|
; (#set! injection.language "graphql"))
|
2022-06-05 05:50:48 -04:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
((template_string) @injection.content
|
|
|
|
|
(#lua-match? @injection.content "^`#graphql")
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "graphql"))
|
2022-10-13 18:04:04 +03:00
|
|
|
|
|
|
|
|
; el.innerHTML = `<html>`
|
|
|
|
|
; el.innerHTML = '<html>'
|
|
|
|
|
(assignment_expression
|
2023-05-03 19:07:59 +09:00
|
|
|
left:
|
|
|
|
|
(member_expression
|
|
|
|
|
property: (property_identifier) @_prop
|
|
|
|
|
(#any-of? @_prop "outerHTML" "innerHTML"))
|
|
|
|
|
right:
|
|
|
|
|
[
|
|
|
|
|
(template_string)
|
|
|
|
|
(string)
|
|
|
|
|
] @injection.content
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.language "html"))
|