From 4d7c23fe815fb33cea707b3910af7393a5d56d74 Mon Sep 17 00:00:00 2001 From: BenBlueeeee <120208759+BenBlueeeee@users.noreply.github.com> Date: Tue, 3 Feb 2026 23:41:52 +0000 Subject: [PATCH] Statically type all function snippets (#958) This also updates snippet names of the type "[name] method of [class]" to correctly reference the class that defines them. For example, _draw() was labelled as "of Node" before, but it's actually CanvasItem which defines this function. --- configurations/snippets.json | 37 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/configurations/snippets.json b/configurations/snippets.json index 7eae779..929141f 100755 --- a/configurations/snippets.json +++ b/configurations/snippets.json @@ -15,63 +15,70 @@ "_ready method of Node": { "prefix": "ready", "body": [ - "func _ready():", + "func _ready() -> void:", "\t${1:pass}" ] }, "_init method of Object": { "prefix": "init", "body": [ - "func _init():", + "func _init() -> void:", "\t${1:pass}" ] }, "_process method of Node": { "prefix": "process", "body": [ - "func _process(delta):", + "func _process(delta: float) -> void:", "\t${1:pass}" ] }, "_physics_process method of Node": { "prefix": "physics", "body": [ - "func _physics_process(delta):", + "func _physics_process(delta: float) -> void:", "\t${1:pass}" ] }, "_input method of Node": { "prefix": "input", "body": [ - "func _input(event):", + "func _input(event: InputEvent) -> void:", "\t${1:pass}" ] }, - "_input_event method of Node": { - "prefix": "inpute", + "_input_event method of CollisionObject2D": { + "prefix": "inpute2D", "body": [ - "func _input_event(event):", + "func _input_event(viewport: Viewport, event: InputEvent, shape_idx: int) -> void:", + "\t${1:pass}" + ] + }, + "_input_event method of CollisionObject3D": { + "prefix": "inpute3D", + "body": [ + "func _input_event(camera: Camera3D, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) -> void:", "\t${1:pass}" ] }, "_unhandled_input method of Node": { "prefix": "uinput", "body": [ - "func _unhandled_input(event):", + "func _unhandled_input(event: InputEvent) -> void:", "\t${1:pass}" ] }, - "_draw method of Node": { + "_draw method of CanvasItem": { "prefix": "draw", "body": [ - "func _draw():", + "func _draw() -> void:", "\t${1:pass}" ] }, - "_gui_input method of Node": { + "_gui_input method of Control": { "prefix": "guii", "body": [ - "func _gui_input(event):", + "func _gui_input(event: InputEvent) -> void:", "\t${1:pass}" ] }, @@ -181,7 +188,7 @@ "# var a = 2", "# var b = \"textvar\"", "", - "func _ready():", + "func _ready() -> void:", "\t# Called every time the node is added to the scene.", "\t# Initialization here", "\tpass", @@ -282,4 +289,4 @@ ], "description": "Waits for a given amount of seconds" } -} \ No newline at end of file +}