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": { "_ready method of Node": {
"prefix": "ready", "prefix": "ready",
"body": [ "body": [
"func _ready():", "func _ready() -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_init method of Object": { "_init method of Object": {
"prefix": "init", "prefix": "init",
"body": [ "body": [
"func _init():", "func _init() -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_process method of Node": { "_process method of Node": {
"prefix": "process", "prefix": "process",
"body": [ "body": [
"func _process(delta):", "func _process(delta: float) -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_physics_process method of Node": { "_physics_process method of Node": {
"prefix": "physics", "prefix": "physics",
"body": [ "body": [
"func _physics_process(delta):", "func _physics_process(delta: float) -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_input method of Node": { "_input method of Node": {
"prefix": "input", "prefix": "input",
"body": [ "body": [
"func _input(event):", "func _input(event: InputEvent) -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_input_event method of Node": { "_input_event method of CollisionObject2D": {
"prefix": "inpute", "prefix": "inpute2D",
"body": [ "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}" "\t${1:pass}"
] ]
}, },
"_unhandled_input method of Node": { "_unhandled_input method of Node": {
"prefix": "uinput", "prefix": "uinput",
"body": [ "body": [
"func _unhandled_input(event):", "func _unhandled_input(event: InputEvent) -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_draw method of Node": { "_draw method of CanvasItem": {
"prefix": "draw", "prefix": "draw",
"body": [ "body": [
"func _draw():", "func _draw() -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
"_gui_input method of Node": { "_gui_input method of Control": {
"prefix": "guii", "prefix": "guii",
"body": [ "body": [
"func _gui_input(event):", "func _gui_input(event: InputEvent) -> void:",
"\t${1:pass}" "\t${1:pass}"
] ]
}, },
@@ -181,7 +188,7 @@
"# var a = 2", "# var a = 2",
"# var b = \"textvar\"", "# var b = \"textvar\"",
"", "",
"func _ready():", "func _ready() -> void:",
"\t# Called every time the node is added to the scene.", "\t# Called every time the node is added to the scene.",
"\t# Initialization here", "\t# Initialization here",
"\tpass", "\tpass",
@@ -282,4 +289,4 @@
], ],
"description": "Waits for a given amount of seconds" "description": "Waits for a given amount of seconds"
} }
} }