Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/gdscript/highlights.scm')
| -rw-r--r-- | runtime/queries/gdscript/highlights.scm | 118 |
1 files changed, 29 insertions, 89 deletions
diff --git a/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm index fee67dc9..f36f4e35 100644 --- a/runtime/queries/gdscript/highlights.scm +++ b/runtime/queries/gdscript/highlights.scm @@ -1,8 +1,7 @@ ; Identifier naming conventions -( - (identifier) @constant - (#match? @constant "^[A-Z][A-Z\\d_]+$")) +((identifier) @constant + (#match? @constant "^[A-Z][A-Z_]*$")) ; class (class_name_statement (name) @type) @@ -12,57 +11,32 @@ ; Function calls (attribute_call (identifier) @function) + (base_call (identifier) @function) + (call (identifier) @function) -(lambda (name) @function) ; Function definitions -(function_definition - name: (name) @function - parameters: (parameters) @variable.parameter ) -(constructor_definition "_init" @function) -(lambda (parameters) @variable.parameter) +(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) -(enum_definition (name) @type.enum) -(enumerator (identifier) @type.enum.variant) -[ - (null) - (underscore) -] @type.builtin - - -(variable_statement (identifier) @variable) -(attribute - (identifier) - (identifier) @variable.other.member) -(attribute - (identifier) @type.builtin - (#match? @type.builtin "^(AABB|Array|Basis|bool|Callable|Color|Dictionary|float|int|NodePath|Object|Packed(Byte|Color|String)Array|PackedFloat(32|64)Array|PackedInt(32|64)Array|PackedVector(2|3)Array|Plane|Projection|Quaternion|Rect2([i]{0,1})|RID|Signal|String|StringName|Transform(2|3)D|Variant|Vector(2|3|4)([i]{0,1}))$")) - -[ - (string_name) - (node_path) - (get_node) -] @label -(signal_statement (name) @label) -(const_statement (name) @constant) -(integer) @constant.numeric.integer -(float) @constant.numeric.float -(escape_sequence) @constant.character.escape +;; Literals [ (true) (false) -] @constant.builtin.boolean + (null) +] @constant.builtin [ "+" @@ -88,71 +62,37 @@ "~" "<<" ">>" - ":=" - ":" + "and" + "or" + "not" ] @operator -(annotation (identifier) @keyword.storage.modifier) - [ + (static_keyword) + (remote_keyword) + (tool_statement) + "var" + "func" + "setget" + "in" + "is" + "as" "if" "else" "elif" - "match" - "when" -] @keyword.control.conditional - -[ "while" "for" -] @keyword.control.repeat - -[ "return" - "pass" "break" "continue" -] @keyword.control.return - -[ - "func" -] @keyword.control.function - -[ - "export" -] @keyword.control.import - -[ - "in" - "is" - "as" - "and" - "or" - "not" -] @keyword.operator - -[ - "var" + "pass" + "match" "class" "class_name" "enum" -] @keyword.storage.type - - -[ - (remote_keyword) - (static_keyword) - "const" "signal" - "@" -] @keyword.storage.modifier - -[ - "setget" "onready" + "export" "extends" - "set" - "get" - "await" + "const" ] @keyword - |