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.
This commit is contained in:
BenBlueeeee
2026-02-03 23:41:52 +00:00
committed by GitHub
parent 74b766726a
commit 4d7c23fe81

View File

@@ -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",