From 76c00934a653b0b66d4bb3f747dd95ade276c6a4 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Sat, 12 Sep 2020 18:32:48 -0500 Subject: Bash: update highlights Following some of our conventions and some bits from atom https://github.com/atom/language-shellscript/blob/master/grammars/tree-sitter-bash.cson: - Uppercase var are constants - `$` is a special symbol, not part of the name - Builtin constants and functions --- queries/bash/highlights.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'queries/bash') diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm index 783b149e8..187197dc3 100644 --- a/queries/bash/highlights.scm +++ b/queries/bash/highlights.scm @@ -63,13 +63,10 @@ "unset" ] @keyword -[ - (special_variable_name) - ("$" (special_variable_name)) - ] @constant +(special_variable_name) @constant -((word) @constant - (#vim-match? @constant "SIG(INT|TERM|QUIT|TIN|TOU|STP|HUP)")) +((word) @constant.builtin + (#vim-match? @constant.builtin "SIG(INT|TERM|QUIT|TIN|TOU|STP|HUP)")) ((word) @boolean (#vim-match? @boolean "true|false")) @@ -87,7 +84,10 @@ (function_definition name: (word) @function) -(command_name (word)) @function +(command_name (word) @function) + +((command_name (word) @function.builtin) + (#match? @function.builtin "^(cd|echo|eval|exit|getopts|pushd|popd|return|set|shift)$")) (command argument: [ @@ -106,6 +106,9 @@ (variable_name) @variable +((variable_name) @constant + (#match? @constant "^[A-Z][A-Z_0-9]*$")) + (case_item value: (word) @parameter) -- cgit v1.2.3-70-g09d2