blob: fbbf4eece473c1f924a8420d43e81e7daeb481b4 (
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
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
|
[
"true"
"false"
] @boolean
[
"if"
"else"
] @keyword.conditional
[
"alias"
"set"
"shell"
"mod"
] @keyword
[
"import"
"export"
] @keyword.import
[
":="
"?"
"=="
"!="
"=~"
"@"
"="
"$"
"*"
"+"
"&&"
"@-"
"-@"
"-"
"/"
":"
] @operator
[
"("
")"
"["
"]"
"{{"
"}}"
"{"
"}"
] @punctuation.bracket
[
"`"
"```"
] @punctuation.special
"," @punctuation.delimiter
(shebang) @keyword.directive
(comment) @comment @spell
[
(string)
(external_command)
] @string
(escape_sequence) @string.escape
(module
(identifier) @module)
(assignment
(identifier) @variable)
(alias
(identifier) @variable)
(value
(identifier) @variable)
; Recipe definitions
(recipe_header
(identifier) @function)
(dependency
(identifier) @function.call)
(dependency_expression
(identifier) @function.call)
(parameter
(identifier) @variable.parameter)
(dependency_expression
(expression
(value
(identifier) @variable.parameter)))
; Fallback highlighting for recipe bodies
(recipe
(recipe_body) @string
(#set! priority 90))
; Ref: https://just.systems/man/en/chapter_26.html
;(setting (identifier) @error)
(setting
(identifier) @constant.builtin
(#any-of? @constant.builtin
"allow-duplicate-recipes" "dotenv-filename" "dotenv-load" "dotenv-path" "export" "fallback"
"ignore-comments" "positional-arguments" "tempdir" "windows-powershell" "windows-shell"))
(recipe
(attribute
(identifier) @attribute))
; https://just.systems/man/en/attributes.html
((recipe
(attribute
(identifier) @attribute.builtin))
(#any-of? @attribute.builtin
"confirm" "doc" "extension" "group" "linux" "macos" "no-cd" "no-exit-message" "no-quiet"
"openbsd" "positional-arguments" "private" "script" "unix" "windows" "working-directory"))
((recipe
(attribute
(identifier) @_doc
argument: (string) @string.documentation))
(#eq? @_doc "doc"))
((recipe
(attribute
(identifier) @_dir
argument: (string) @string.special.path))
(#eq? @_dir "working-directory"))
; Ref: https://just.systems/man/en/chapter_31.html
;(function_call (identifier) @error)
(function_call
(identifier) @function.call
(#any-of? @function.call
"arch" "num_cpus" "os" "os_family" "env_var" "env_var_or_default" "env" "invocation_directory"
"invocation_directory_native" "justfile" "justfile_directory" "just_executable" "quote"
"replace" "replace_regex" "trim" "trim_end" "trim_end_match" "trim_end_matches" "trim_start"
"trim_start_match" "trim_start_matches" "capitalize" "kebabcase" "lowercamelcase" "lowercase"
"shoutykebabcase" "shoutysnakecase" "snakecase" "titlecase" "uppercamelcase" "uppercase"
"absolute_path" "extension" "file_name" "file_stem" "parent_directory" "without_extension"
"clean" "join" "path_exists" "error" "sha256" "sha256_file" "uuid" "semver_matches"))
|