2022-09-12 23:36:19 +03:00
|
|
|
(((comment) @_jsdoc_comment
|
|
|
|
|
(#match? @_jsdoc_comment "^/\\*\\*[^\\*].*\\*/")) @jsdoc)
|
|
|
|
|
|
2021-04-30 13:22:12 -05:00
|
|
|
(comment) @comment
|
2021-03-09 23:14:27 +01:00
|
|
|
|
2023-03-18 21:59:44 +02:00
|
|
|
; html(`...`), html`...`, sql(...) etc
|
|
|
|
|
(call_expression
|
2023-03-17 09:51:16 +02:00
|
|
|
function: ((identifier) @language)
|
2023-03-18 21:59:44 +02:00
|
|
|
arguments: [
|
|
|
|
|
(arguments
|
|
|
|
|
(template_string) @content)
|
|
|
|
|
(template_string) @content
|
|
|
|
|
]
|
|
|
|
|
(#offset! @content 0 1 0 -1)
|
|
|
|
|
(#not-eq? @content "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 21:59:44 +02:00
|
|
|
function: ((identifier) @svg)
|
|
|
|
|
arguments: [
|
|
|
|
|
(arguments
|
|
|
|
|
(template_string) @content)
|
|
|
|
|
(template_string) @content
|
|
|
|
|
]
|
|
|
|
|
(#offset! @content 0 1 0 -1)
|
|
|
|
|
(#eq? @content "svg"))
|
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"))
|
|
|
|
|
arguments: ((template_string) @graphql
|
|
|
|
|
(#offset! @graphql 0 1 0 -1)))
|
2021-03-09 23:14:27 +01:00
|
|
|
|
|
|
|
|
(call_expression
|
2021-07-25 15:35:17 +10:00
|
|
|
function: ((identifier) @_name
|
|
|
|
|
(#eq? @_name "hbs"))
|
|
|
|
|
arguments: ((template_string) @glimmer
|
|
|
|
|
(#offset! @glimmer 0 1 0 -1)))
|
|
|
|
|
|
2022-10-23 14:26:48 -04:00
|
|
|
((glimmer_template) @glimmer)
|
|
|
|
|
|
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"))
|
|
|
|
|
arguments: ((template_string) @css
|
|
|
|
|
(#offset! @css 0 1 0 -1)))
|
|
|
|
|
|
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"))
|
|
|
|
|
arguments: ((template_string) @css
|
|
|
|
|
(#offset! @css 0 1 0 -1)))
|
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"))))
|
|
|
|
|
arguments: ((template_string) @css
|
|
|
|
|
(#offset! @css 0 1 0 -1)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; styled(Component).attrs({ prop: "foo" })`<css>`
|
|
|
|
|
(call_expression
|
|
|
|
|
function: (call_expression
|
|
|
|
|
function: (member_expression
|
|
|
|
|
object: (call_expression
|
|
|
|
|
function: (identifier) @_name
|
|
|
|
|
(#eq? @_name "styled"))))
|
|
|
|
|
arguments: ((template_string) @css
|
|
|
|
|
(#offset! @css 0 1 0 -1)))
|
|
|
|
|
|
2021-04-06 20:33:41 +02:00
|
|
|
(regex_pattern) @regex
|
2022-06-05 05:50:48 -04:00
|
|
|
|
|
|
|
|
((comment) @_gql_comment
|
|
|
|
|
(#eq? @_gql_comment "/* GraphQL */")
|
|
|
|
|
(template_string) @graphql)
|
|
|
|
|
|
|
|
|
|
(((template_string) @_template_string
|
|
|
|
|
(#match? @_template_string "^`#graphql")) @graphql)
|
2022-10-13 18:04:04 +03:00
|
|
|
|
|
|
|
|
; el.innerHTML = `<html>`
|
|
|
|
|
(assignment_expression
|
|
|
|
|
left: (member_expression
|
|
|
|
|
property: (property_identifier) @_prop
|
2022-10-13 18:08:56 +03:00
|
|
|
(#match? @_prop "(out|inn)erHTML"))
|
2022-10-13 18:04:04 +03:00
|
|
|
right: (template_string) @html
|
|
|
|
|
(#offset! @html 0 1 0 -1))
|
2022-10-13 18:08:56 +03:00
|
|
|
|
2022-10-13 18:04:04 +03:00
|
|
|
; el.innerHTML = '<html>'
|
|
|
|
|
(assignment_expression
|
|
|
|
|
left: (member_expression
|
|
|
|
|
property: (property_identifier) @_prop
|
2022-10-13 18:08:56 +03:00
|
|
|
(#match? @_prop "(out|inn)erHTML"))
|
2022-10-13 18:04:04 +03:00
|
|
|
right: (string) @html
|
|
|
|
|
(#offset! @html 0 1 0 -1))
|