forked from micro-editor/micro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile.yaml
More file actions
109 lines (91 loc) · 3.28 KB
/
Copy pathjustfile.yaml
File metadata and controls
109 lines (91 loc) · 3.28 KB
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
# For more information, see https://github.com/casey/just
filetype: 'justfile'
detect:
filename: "(\\.?[Jj]ustfile|\\.just)$"
header: "^#!.*/(env +)?[bg]?just --justfile"
rules:
- identifier: "^[a-zA-Z_][a-zA-Z0-9_-]*"
- symbol.brackets: "[\\{\\}]"
# Alias
- identifier: "^alias\\s+[a-zA-Z_][a-zA-Z0-9_-]*\\s*:=\\s*[a-zA-Z_][a-zA-Z0-9_-]*$"
- statement: "^(alias|export)\\b"
# Functions
- statement: "\\b(arch|os|os_family|invocation_directory|justfile|justfile_directory|just_executable|uuid)\\b"
# Env
- statement: "\\b(env|env_var|env_var_or_default)\\b"
# String manipulation
- statement: "\\b(quote|replace|replace_regex|trim_end_matches|trim_end_match|trim_end|trim_start_matches|trim_start_match|trim_start|trim|capitalize|uppercamelcase|lowercamelcase|lowercase|shoutykebabcase|shoutysnakecase|snakecase|titlecase|uppercase|kebabcase)\\b"
# Path manipulation
- statement: "\\b(absolute_path|extension|file_name|file_stem|parent_directory|without_extension|clean|join|path_exists)\\b"
# Other misc functions
- statement: "\\b(error|sha256|sha256_file|semver_matches)\\b"
- statement: "\\b(if|else)\\b"
- statement: "\\{\\{|\\}\\}"
# Infix operators only highlighted when surrounded by whitespace
# to reduce false positives
- symbol.operator: "\\s[/+]|==|!=\\s"
# Recipe
- identifier: "^\\S.*?:(\\s|$)"
- symbol.operator: "^\\s*[@-]*"
# Reset to default after recipe identifier
- default: "\\s.*:( |$)"
# Variadic parameters
- special: "\\s+[*+]\\$?[a-zA-Z_][a-zA-Z0-9_-]*"
# Environment variables
- special: "\\$[A-Za-z0-9_]+"
- symbol.operator: ":=?"
# Attribute
- symbol.brackets:
start: "^\\["
end: "\\]"
rules:
- symbol.tag: "\\b(no-cd|no-exit-message|linux|macos|unix|windows|private)\\b"
- statement: ","
# Built-in settings
- statement:
start: "^set\\b"
end: "$"
rules:
- default: ".*"
- identifier: "\\b(allow-duplicate-recipes|dotenv-filename|dotenv-load|dotenv-path|export|fallback|ignore-comments|positional-arguments|shell|tempdir|windows-powershell|windows-shell)\\b"
- statement: ":="
- bracket: "\\[|\\]"
- statement: ","
- constant.bool: "\\b(true|false)\\b"
# these are not perfect but they work for the simple cases
- constant.string: "\"\"\".*\"\"\""
- constant.string: "'''.*'''"
- constant.string: "\".*?\""
- constant.string: "'.*?'"
- constant.string:
start: "\"\"\""
end: "\"\"\""
rules: []
- constant.string:
start: "'''"
end: "'''"
rules: []
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# Command evaluation using backticks
- constant.string:
start: "`"
end: "`"
skip: "\\\\."
rules:
- symbol.operator: "\\|"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|FIXME):?"