Godot-proposals: Make signals generate static typed parameters and returns

Created on 26 Oct 2020  路  2Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
3D rougelike

Describe the problem or limitation you are having in your project:
Functions generated by signals are just really hard to know what they contain without pulling up the docs since they are treated as variants

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
When signals generate functions they should also generate static typed parameters and returns

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
something like this..

func _on_Player_input(event:InputEvent)->void:
    pass

If this enhancement will not be used often, can it be worked around with a few lines of script?:
yes it can be added but static typing should be encouraged as works well with auto complete

Is there a reason why this should be core and not an add-on in the asset library?:
because it helps people know what members it has and also encourages good code

archived core

Most helpful comment

Editor Settings -> Text Editor -> Completion -> Add Type Hints

All 2 comments

Editor Settings -> Text Editor -> Completion -> Add Type Hints

@KoBeWi ty so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SpyrexDE picture SpyrexDE  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

lupoDharkael picture lupoDharkael  路  3Comments

IllusiveS picture IllusiveS  路  3Comments

wijat picture wijat  路  3Comments