diff --git a/queries/brightscript/folds.scm b/queries/brightscript/folds.scm index 09c655dfb..56b7d575b 100644 --- a/queries/brightscript/folds.scm +++ b/queries/brightscript/folds.scm @@ -6,4 +6,3 @@ (if_statement) (try_statement) ] @fold - diff --git a/queries/brightscript/highlights.scm b/queries/brightscript/highlights.scm index 47fd874e6..63aedb56b 100644 --- a/queries/brightscript/highlights.scm +++ b/queries/brightscript/highlights.scm @@ -1,9 +1,11 @@ ; Identifiers (identifier) @variable -; Function and sub declarations +; Function declaration (function_statement name: (identifier) @function) + +; Sub declaration (sub_statement name: (identifier) @function) @@ -39,14 +41,23 @@ ; Statements (if_statement) @keyword.conditional + (conditional_compl) @keyword.conditional + (for_statement) @keyword.repeat + (while_statement) @keyword.repeat + (try_statement) @keyword.exception + (return_statement) @keyword.return + (throw_statement) @keyword.exception + (assignment_statement) @operator + (print_statement) @function.builtin + (constant) @constant ; Keywords @@ -83,24 +94,41 @@ ; Literals (boolean) @boolean + (number) @number + (string) @string + (invalid) @constant.builtin ; Comments (comment) @comment ; Punctuation -["(" ")" "[" "]" "{" "}" "." "," "?." "?["] @punctuation.delimiter +[ + "(" + ")" + "[" + "]" + "{" + "}" + "." + "," + "?." + "?[" +] @punctuation.delimiter ; Special highlights for library statements (library_statement) @keyword.import + (library_statement path: (string) @module) ; Array and associative array literals (array) @constructor + (assoc_array) @constructor + (assoc_array_element key: (identifier) @property) @@ -135,7 +163,13 @@ ] @keyword ; Special keywords (these might still need to be strings if not defined as separate nodes) -["then" "else" "else if" "#else" "#else if"] @keyword +[ + "then" + "else" + "else if" + "#else" + "#else if" +] @keyword ; Exit statements [ diff --git a/queries/brightscript/injections.scm b/queries/brightscript/injections.scm index 050826330..2f0e58eb6 100644 --- a/queries/brightscript/injections.scm +++ b/queries/brightscript/injections.scm @@ -1,4 +1,2 @@ -([ - (comment) -] @injection.content +((comment) @injection.content (#set! injection.language "comment"))