Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/just/highlights.scm')
-rw-r--r--runtime/queries/just/highlights.scm169
1 files changed, 22 insertions, 147 deletions
diff --git a/runtime/queries/just/highlights.scm b/runtime/queries/just/highlights.scm
index 77ab454a..1026f654 100644
--- a/runtime/queries/just/highlights.scm
+++ b/runtime/queries/just/highlights.scm
@@ -1,158 +1,33 @@
-; This file specifies how matched syntax patterns should be highlighted
+(assignment (NAME) @variable)
+(alias (NAME) @variable)
+(value (NAME) @variable)
+(parameter (NAME) @variable)
+(setting (NAME) @keyword)
+(setting "shell" @keyword)
-[
- "export"
- "import"
- "unexport"
-] @keyword.control.import
+(call (NAME) @function)
+(dependency (NAME) @function)
+(depcall (NAME) @function)
+(recipeheader (NAME) @function)
-"mod" @keyword.directive
+(depcall (expression) @variable.parameter)
+(parameter) @variable.parameter
+(variadic_parameters) @variable.parameter
-[
- "alias"
- "set"
- "shell"
-] @keyword
+["if" "else"] @keyword.control.conditional
-[
- "if"
- "else"
-] @keyword.control.conditional
+(string) @string
-[
- "&&"
- "||"
-] @operator
+(boolean ["true" "false"]) @constant.builtin.boolean
-; Variables
+(comment) @comment
-(value
- (identifier) @variable)
+; (interpolation) @string
-(alias
- alias_name: (identifier) @variable)
+(shebang interpreter:(TEXT) @keyword ) @comment
-(assignment
- name: (identifier) @variable)
+["export" "alias" "set"] @keyword
-(shell_variable_name) @variable
+["@" "==" "!=" "+" ":="] @operator
-(unexport
- name: (identifier) @variable)
-
-; Functions
-
-(recipe
- name: (identifier) @function)
-
-(recipe_dependency
- name: (identifier) @function.call)
-
-(function_call
- name: (identifier) @function.builtin)
-
-; Parameters
-
-(recipe_parameter
- name: (identifier) @variable.parameter)
-
-; Namespaces
-
-(mod
- name: (identifier) @namespace)
-
-(module_path
- name: (identifier) @namespace)
-
-; Paths
-
-(mod
- (path) @string.special.path)
-
-(import
- (path) @string.special.path)
-
-; Shebangs
-
-(shebang_line) @keyword.directive
-(shebang_line
- (shebang_shell) @string.special)
-
-
-(shell_expanded_string
- [
- (expansion_short_start)
- (expansion_long_start)
- (expansion_long_middle)
- (expansion_long_end)
- ] @punctuation.special)
-
-; Operators
-
-[
- ":="
- "?"
- "=="
- "!="
- "=~"
- "!~"
- "@"
- "="
- "$"
- "*"
- "+"
- "&&"
- "@-"
- "-@"
- "-"
- "/"
- ":"
-] @operator
-
-; Punctuation
-
-"," @punctuation.delimiter
-
-[
- "{"
- "}"
- "["
- "]"
- "("
- ")"
- "{{"
- "}}"
-] @punctuation.bracket
-
-[ "`" "```" ] @punctuation.special
-
-; Literals
-
-; Booleans are not allowed anywhere except in settings
-(setting
- (boolean) @constant.builtin.boolean)
-
-[
- (string)
- (external_command)
-] @string
-
-[
- (escape_sequence)
- (escape_variable_end)
-] @constant.character.escape
-
-; Comments
-
-(comment) @comment.line
-
-; highlight known settings
-(setting
- name: (_) @keyword.function)
-
-; highlight known attributes
-(attribute
- name: (identifier) @attribute)
-
-; Numbers are part of the syntax tree, even if disallowed
-(numeric_error) @error
+[ "(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket