Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/fish/highlights.scm')
-rw-r--r--runtime/queries/fish/highlights.scm39
1 files changed, 20 insertions, 19 deletions
diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm
index 225d2796..4235cdd6 100644
--- a/runtime/queries/fish/highlights.scm
+++ b/runtime/queries/fish/highlights.scm
@@ -4,13 +4,14 @@
"&&"
"||"
"|"
- "&|"
- "2>|"
"&"
+ "="
+ "!="
".."
"!"
(direction)
(stream_redirect)
+ (test_option)
] @operator
[
@@ -38,12 +39,12 @@
"case"
] @keyword.control.conditional)
-(else_clause
+(else_clause
[
"else"
] @keyword.control.conditional)
-(else_if_clause
+(else_if_clause
[
"else"
"if"
@@ -94,30 +95,25 @@
;; Commands
-(command name: (word) @function)
-
-(command
- name: (word) @function.builtin (#match? @function.builtin "^test$")
- argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$"))
-
-(command
- name: (word) @punctuation.bracket (#match? @punctuation.bracket "^\\[$")
- argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$"))
-
(command
argument: [
(word) @variable.parameter (#match? @variable.parameter "^-")
]
)
-; derived from builtin -n (fish 3.7.1)
+; non-builtin command names
+(command name: (word) @function)
+
+; derived from builtin -n (fish 3.2.2)
(command
name: [
- (word) @function.builtin
- (#any-of? @function.builtin "abbr" "alias" "and" "argparse" "begin" "bg" "bind" "block" "break" "breakpoint" "builtin" "case" "cd" "command" "commandline" "complete" "contains" "continue" "count" "disown" "echo" "else" "emit" "end" "eval" "exec" "exit" "false" "fg" "for" "function" "functions" "history" "if" "isatty" "jobs" "math" "not" "or" "path" "printf" "pwd" "random" "read" "realpath" "return" "set" "set_color" "source" "status" "string" "switch" "test" "time" "true" "type" "ulimit" "wait" "while")
- ]
+ (word) @function.builtin
+ (#match? @function.builtin "^(\.|:|_|alias|argparse|bg|bind|block|breakpoint|builtin|cd|command|commandline|complete|contains|count|disown|echo|emit|eval|exec|exit|fg|functions|history|isatty|jobs|math|printf|pwd|random|read|realpath|set|set_color|source|status|string|test|time|type|ulimit|wait)$")
+ ]
)
+(test_command "test" @function.builtin)
+
;; Functions
(function_definition ["function" "end"] @keyword.function)
@@ -125,7 +121,7 @@
(function_definition
name: [
(word) (concatenation)
- ]
+ ]
@function)
(function_definition
@@ -150,6 +146,11 @@
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(comment) @comment
+(test_option) @string
((word) @constant.builtin.boolean
(#match? @constant.builtin.boolean "^(true|false)$"))
+
+;; Error
+
+(ERROR) @error