Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion data/parsing_test.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ var setget_property: float = 3.2:


func _init() -> void:
pass
super()
super.other()
self.property.x = 20
method_call(self)


func _process(delta: float) -> void:
position += velocity * delta
rotation = velocity.angle()


func _not_implemented() -> void:
pass


class InnerClass extends RefCounted:
func _init(arg: int) -> void:
pass
16 changes: 12 additions & 4 deletions languages/gdscript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
; but a = 10 has 'a matching nothing.
; This is to keep consistency, and is like 'text_editor/theme/highlighting/text_color' in Godot Editor Settings
(identifier) @variable
; Self reference in class.
((identifier) @variable.builtin
(#eq? @variable.builtin "self"))


; Class
Expand All @@ -12,8 +15,16 @@

; Function calls
(attribute_call (identifier) @function.method)
(base_call (identifier) @function.builtin)
(base_call (identifier) @function.method)
(call (identifier) @function)
; Super calls have two forms:
; - super() to call this method's parent implementation,
; - super.other() to call another method's parent implementation.
((identifier) @function.builtin
(#eq? @function.builtin "super"))
(call (identifier) @function.builtin
(#eq? @function.builtin "super"))


; Setget
(setget
Expand Down Expand Up @@ -221,9 +232,6 @@
"extends"
] @keyword

((identifier) @variable.language
(#match? @variable.language "^(self|super)$"))

; Identifier naming conventions
; This needs to be at the very end in order to override earlier queries

Expand Down