From b79c763c03a236833a60b4865b02412b3e4a9799 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Thu, 24 Nov 2022 01:23:08 +0100 Subject: [PATCH] fix(fish): update for upstream changes https://github.com/ram02z/tree-sitter-fish/pull/16 Co-authored-by: taekwombo --- queries/fish/highlights.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/queries/fish/highlights.scm b/queries/fish/highlights.scm index 10d54dff7..838251201 100644 --- a/queries/fish/highlights.scm +++ b/queries/fish/highlights.scm @@ -7,15 +7,21 @@ "||" "|" "&" - "=" - "!=" ".." "!" (direction) (stream_redirect) - (test_option) ] @operator +; match operators of test command +(command + name: (word) @function (#match? @function "^test$") + argument: (word) @operator (#match? @operator "^(!?\\=|-[a-zA-Z]+)$")) + +;; match operators of [ command +(test_command + argument: (word) @operator (#match? @operator "^(!?\\=|-[a-zA-Z]+)$")) + [ "not" "and" @@ -103,7 +109,7 @@ ] ) -(command_substitution_dollar "$" @punctuation.bracket) +(command_substitution "$" @punctuation.bracket) ; non-bultin command names (command name: (word) @function.call) @@ -116,7 +122,7 @@ ] ) -(test_command "test" @function.builtin) +(test_command (word) @function.builtin) ;; Functions @@ -150,7 +156,6 @@ [(integer) (float)] @number (comment) @comment (comment) @spell -(test_option) @string ((word) @boolean (#any-of? @boolean "true" "false"))