aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/roc/injections.scm
blob: 5bc7576f815274eb8eecb06914796bd26751dc0e (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
;injection from function calls
(function_call_pnc_expr
  (variable_expr
    (identifier) @injection.language)
  (const
    [
      (multiline_string)
      (string)
    ] @injection.content)
  (#any-of? @injection.language
    "json" "toml" "yaml" "xml" "sql" "lua" "js" "html" "css" "http" "jq" "latex" "md" "nix" "regex"))

;injection from piping function calls
(bin_op_expr
  part: (const
    [
      (multiline_string)
      (string)
    ] @injection.content)
  part: (operator)
  part: (variable_expr
    (identifier) @injection.language)
  (#any-of? @injection.language
    "json" "toml" "yaml" "xml" "sql" "lua" "js" "html" "css" "http" "jq" "latex" "md" "nix" "regex"))

([
  (line_comment)
  (doc_comment)
] @injection.content
  (#set! injection.language "comment"))