on e4e8a39 help sign in
36 lines 971 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 multiline comments
27((comment) @injection.content
28 (#set! injection.language "jsdoc")
29 (#match? @injection.content "^/\\*+"))
31; Parse general tags in single line comments
33((comment) @injection.content
34 (#set! injection.language "comment")
35 (#match? @injection.content "^//"))