on 0b8a00a help sign in
28 lines 770 B history raw
1; Parse the contents of tagged template literals using
2; a language inferred from the tag.
4(call_expression
5 function: [
6 (identifier) @injection.language
7 (member_expression
8 property: (property_identifier) @injection.language)
9 ]
10 arguments: (template_string) @injection.content)
12; Parse the contents of gql template literals
14((call_expression
15 function: (identifier) @_template_function_name
16 arguments: (template_string) @injection.content)
17 (#eq? @_template_function_name "gql")
18 (#set! injection.language "graphql"))
20; Parse regex syntax within regex literals
22((regex_pattern) @injection.content
23 (#set! injection.language "regex"))
25 ; Parse JSDoc annotations in comments
27((comment) @injection.content
28 (#set! injection.language "jsdoc"))