aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/gotmpl/injections.scm
blob: 3cfc26361a55e63576826a2f38d912f75b12accd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
((comment) @injection.content
  (#set! injection.language "comment"))

; {{"put" | printf "%s%s" "out" | printf "%q"}}
(function_call
  function: (identifier) @_function
  arguments: (argument_list
    .
    (interpreted_string_literal) @injection.content)
  (#eq? @_function "printf")
  (#set! injection.language "printf"))

; {{ js "var a = 1 + 1" }}
(function_call
  function: (identifier) @_function
  arguments: (argument_list
    .
    (interpreted_string_literal) @injection.content)
  (#eq? @_function "js")
  (#offset! @injection.content 0 1 0 -1)
  (#set! injection.language "javascript"))

; {{ html "<h1>hello</h1>" }}
(function_call
  function: (identifier) @_function
  arguments: (argument_list
    .
    (interpreted_string_literal) @injection.content)
  (#eq? @_function "html")
  (#offset! @injection.content 0 1 0 -1)
  (#set! injection.language "html"))