Unnamed repository; edit this file 'description' to name the repository.
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
; From <https://github.com/IndianBoy42/tree-sitter-just/blob/6c2f018ab1d90946c0ce029bb2f7d57f56895dff/queries-flavored/helix/highlights.scm>

; This file specifies how matched syntax patterns should be highlighted

[
  "export"
  "import"
] @keyword.control.import

"mod" @keyword.directive

[
  "alias"
  "set"
  "shell"
] @keyword

[
  "if"
  "else"
] @keyword.control.conditional

; Variables

(value
  (identifier) @variable)

(alias
  left: (identifier) @variable)

(assignment
  left: (identifier) @variable)

; Functions

(recipe_header
  name: (identifier) @function)

(dependency
  name: (identifier) @function)

(dependency_expression
  name: (identifier) @function)

(function_call
  name: (identifier) @function)

; Parameters

(parameter
  name: (identifier) @variable.parameter)

; Namespaces

(module
  name: (identifier) @namespace)

; Operators

[
  ":="
  "?"
  "=="
  "!="
  "=~"
  "@"
  "="
  "$"
  "*"
  "+"
  "&&"
  "@-"
  "-@"
  "-"
  "/"
  ":"
] @operator

; Punctuation

"," @punctuation.delimiter

[
  "{"
  "}"
  "["
  "]"
  "("
  ")"
  "{{"
  "}}"
] @punctuation.bracket

[ "`" "```" ] @punctuation.special

; Literals

(boolean) @constant.builtin.boolean

[
  (string)
  (external_command)
] @string

(escape_sequence) @constant.character.escape

; Comments

(comment) @comment.line

(shebang) @keyword.directive

; highlight known settings (filtering does not always work)
(setting
  left: (identifier) @keyword
  (#any-of? @keyword
    "allow-duplicate-recipes"
    "dotenv-filename"
    "dotenv-load"
    "dotenv-path"
    "export"
    "fallback"
    "ignore-comments"
    "positional-arguments"
    "shell"
    "tempdi"
    "windows-powershell"
    "windows-shell"))

; highlight known attributes (filtering does not always work)
(attribute
  (identifier) @attribute
  (#any-of? @attribute
    "private"
    "allow-duplicate-recipes"
    "dotenv-filename"
    "dotenv-load"
    "dotenv-path"
    "export"
    "fallback"
    "ignore-comments"
    "positional-arguments"
    "shell"
    "tempdi"
    "windows-powershell"
    "windows-shell"))

; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error