Godot: Auto-completion not working for arguments of signal connections

Created on 13 Jul 2016  Â·  10Comments  Â·  Source: godotengine/godot

Operating system or device - Godot version:

Issue description (what happened, and what was expected):
func _on_Area2D_body_enter( body ):
body.

no functions listed after . typed.

Steps to reproduce:

Link to minimal example project (optional but very welcome):

enhancement editor

Most helpful comment

I don't recall completion working for arguments of signal connections. Was this working on a previous version?

All 10 comments

Godot version? Since there were some changes to code completion in the current master branch since 2.0.3 even 2.0.4.

2.0.3 and 2.1

I don't recall completion working for arguments of signal connections. Was this working on a previous version?

Since GdScript is duck typed there's no way the Editor can know what type is body. To solve this you need static typing (or a way to hint the type) i usually add a line body = RigidBody.new() at the start and try not to forget to comment it later...

We'll add type hints for 2.2
On Jul 14, 2016 3:47 PM, "Mariano Javier Suligoy" [email protected]
wrote:

Since GdScript is duck typed there's no way the Editor can know what type
is body. To solve this you need static typing (or a way to hint the type) i
usually add a line body = RigidBody.new() at the start and try not to
forget to comment it later...

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/5672#issuecomment-232756527,
or mute the thread
https://github.com/notifications/unsubscribe/AF-Z2zxYAsL5oIaU64aQUclootl5MPcmks5qVoRBgaJpZM4JLSqf
.

Also onready var node = get_node("mynode") is a very handy feature,
but get_node have no hint for the node name as write var node = get_node("mynode") in _ready()

As mentioned in https://github.com/godotengine/godot/issues/15718#issuecomment-446207371, this is now solved thanks to optional typing in 3.1.

@vnen Do you think we should go one step further and automatically set the type hint when connecting signals?

@akien-mga that is already the case if you have the option enabled in Editor Settings.

Nice, closing then.

@akien-mga that is already the case if you have the option enabled in Editor Settings.
cool, is this feature enabled by default? it should imho

Was this page helpful?
0 / 5 - 0 ratings