From 48b89d4dcfde20aebb08a1d79aa14ab3fb559f30 Mon Sep 17 00:00:00 2001 From: Axlefublr <101342105+Axlefublr@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:59:03 +0800 Subject: [PATCH] fix: fish builtin functions are highlighted as such (#11792) * fix: fish builtin functions are highlighted as such * fix: single-character commands recognized as builtins ???? how did that query even happen * fix: update builtins to fish 3.7.1 * fix: add back `alias` and `isatty` they are builtins, but aren't reported by builtin -n for some reason --- runtime/queries/fish/highlights.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm index 4235cdd62..27d509a00 100644 --- a/runtime/queries/fish/highlights.scm +++ b/runtime/queries/fish/highlights.scm @@ -101,19 +101,19 @@ ] ) -; non-builtin command names -(command name: (word) @function) - -; derived from builtin -n (fish 3.2.2) +; derived from builtin -n (fish 3.7.1) (command name: [ - (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)$") - ] + (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") + ] ) (test_command "test" @function.builtin) +; non-builtin command names +(command name: (word) @function) + ;; Functions (function_definition ["function" "end"] @keyword.function)