From e6597bc9927c73800d31d4a45dc695a4abe77ec8 Mon Sep 17 00:00:00 2001 From: Erasin Wang Date: Mon, 6 Mar 2023 02:41:18 +0800 Subject: Update queries for godot4 (#6186) --- runtime/queries/gdscript/highlights.scm | 88 +++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 27 deletions(-) (limited to 'runtime/queries/gdscript/highlights.scm') diff --git a/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm index f36f4e35..88f2a187 100644 --- a/runtime/queries/gdscript/highlights.scm +++ b/runtime/queries/gdscript/highlights.scm @@ -1,7 +1,8 @@ ; Identifier naming conventions -((identifier) @constant - (#match? @constant "^[A-Z][A-Z_]*$")) +( + (identifier) @constant + (#match? @constant "^[A-Z][A-Z\\d_]+$")) ; class (class_name_statement (name) @type) @@ -11,32 +12,35 @@ ; Function calls (attribute_call (identifier) @function) - (base_call (identifier) @function) - (call (identifier) @function) ; Function definitions (function_definition (name) @function) - (constructor_definition "_init" @function) + ;; Literals -(integer) @constant.numeric.integer -(float) @constant.numeric.float (comment) @comment (string) @string -(escape_sequence) @constant.character.escape -(identifier) @variable + (type) @type +(expression_statement (array (identifier) @type)) +(binary_operator (identifier) @type) -;; Literals +(variable_statement (identifier) @variable) +(get_node) @label + +(const_statement (name) @constant) +(integer) @constant.numeric.integer +(float) @constant.numeric.float +(escape_sequence) @constant.character.escape [ (true) (false) - (null) -] @constant.builtin +] @constant.builtin.boolean +(null) @constant.builtin [ "+" @@ -62,37 +66,67 @@ "~" "<<" ">>" - "and" - "or" - "not" ] @operator +(annotation (identifier) @keyword.storage.modifier) + [ - (static_keyword) - (remote_keyword) - (tool_statement) - "var" - "func" - "setget" - "in" - "is" - "as" "if" "else" "elif" +] @keyword.control.conditional + +[ "while" "for" +] @keyword.control.repeat + +[ "return" + "pass" "break" "continue" - "pass" +] @keyword.control.return + +[ + "func" +] @keyword.control.function + +[ + "export" +] @keyword.control.import + +[ + "in" + "is" + "as" "match" + "and" + "or" + "not" +] @keyword.operator + +[ + "var" "class" "class_name" "enum" +] @keyword.storage.type + + +[ + (remote_keyword) + (static_keyword) + "const" "signal" + "@" +] @keyword.storage.modifier + +[ + "setget" "onready" - "export" "extends" - "const" + "set" + "get" ] @keyword + -- cgit v1.2.3-70-g09d2