1((comment) @injection.content
2 (#set! injection.language "comment")
3)
4
5(((comment) @_jsdoc_comment
6 (#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @injection.content
7 (#set! injection.language "jsdoc"))
8
9(((comment) @_reference
10 (#match? @_reference "^///\\s+<reference\\s+types=\"\\S+\"\\s*/>\\s*$")) @injection.content
11 (#set! injection.language "html"))
12
13((regex) @injection.content
14 (#set! injection.language "regex"))
15
16(call_expression
17 function: (identifier) @_name (#eq? @_name "css")
18 arguments: (template_string (string_fragment) @injection.content
19 (#set! injection.language "css"))
20)
21
22(call_expression
23 function: (member_expression
24 object: (identifier) @_obj (#eq? @_obj "styled")
25 property: (property_identifier))
26 arguments: (template_string (string_fragment) @injection.content
27 (#set! injection.language "css"))
28)
29
30(call_expression
31 function: (call_expression
32 function: (identifier) @_name (#eq? @_name "styled"))
33 arguments: (template_string (string_fragment) @injection.content
34 (#set! injection.language "css"))
35)
36
37(call_expression
38 function: (identifier) @_name (#eq? @_name "html")
39 arguments: (template_string) @injection.content
40 (#set! injection.language "html")
41)
42
43(call_expression
44 function: (identifier) @_name (#eq? @_name "js")
45 arguments: (template_string (string_fragment) @injection.content
46 (#set! injection.language "javascript"))
47)
48
49(call_expression
50 function: (identifier) @_name (#eq? @_name "json")
51 arguments: (template_string (string_fragment) @injection.content
52 (#set! injection.language "json"))
53)
54
55(call_expression
56 function: (identifier) @_name (#eq? @_name "sql")
57 arguments: (template_string (string_fragment) @injection.content
58 (#set! injection.language "sql"))
59)
60
61(call_expression
62 function: (identifier) @_name (#eq? @_name "ts")
63 arguments: (template_string (string_fragment) @injection.content
64 (#set! injection.language "typescript"))
65)
66
67(call_expression
68 function: (identifier) @_name (#match? @_name "^ya?ml$")
69 arguments: (template_string (string_fragment) @injection.content
70 (#set! injection.language "yaml"))
71)
72
73(call_expression
74 function: (identifier) @_name (#match? @_name "^g(raph)?ql$")
75 arguments: (template_string (string_fragment) @injection.content
76 (#set! injection.language "graphql"))
77)
78
79(call_expression
80 function: (identifier) @_name (#match? @_name "^g(raph)?ql$")
81 arguments: (arguments (template_string (string_fragment) @injection.content
82 (#set! injection.language "graphql")))
83)
84
85(call_expression
86 function: (identifier) @_name(#match? @_name "^iso$")
87 arguments: (arguments (template_string (string_fragment) @injection.content
88 (#set! injection.language "isograph")))
89)
90
91;; Angular Component template injection
92(call_expression
93 function: [
94 (identifier) @_decorator (#eq? @_decorator "Component")
95 (member_expression property: (property_identifier) @_decorator (#eq? @_decorator "Component"))
96 ]
97 arguments: (arguments (object
98 (pair
99 key: (property_identifier) @_prop (#eq? @_prop "template")
100 value: [
101 (string) @injection.content
102 (template_string) @injection.content
103 (template_string (string_fragment) @injection.content)
104 ]
105 )))
106 (#set! injection.language "angular"))
107
108;; Angular Component styles injection
109(call_expression
110 function: [
111 (identifier) @_decorator (#eq? @_decorator "Component")
112 (member_expression property: (property_identifier) @_decorator (#eq? @_decorator "Component"))
113 ]
114 arguments: (arguments (object
115 (pair
116 key: (property_identifier) @_prop (#eq? @_prop "styles")
117 value: [
118 (string) @injection.content
119 (template_string) @injection.content
120 (template_string (string_fragment) @injection.content)
121 (array (string) @injection.content)
122 (array (template_string) @injection.content)
123 (array (template_string (string_fragment)) @injection.content)
124 ]
125 )))
126 (#set! injection.language "css"))