You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Autocompletion of animation names stops working when type hints are added to AnimationPlayer, AnimatedSprite2D and AnimatedSprite3D variables in GDScript
#92219
Closed
RayJJ opened this issue
May 21, 2024
· 5 comments
· Fixed by #92263
Reproducible in 4.2.2.stable and 4.3.dev6. Was present before 4.2.2 but first appearance not established. Occurs in both MacOS 14 and Windows 11.
System information
Godot v4.2.2.stable - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)
Issue description
Adding type hints to variables referencing AnimationPlayer, AnimatedSprite2D and AnimatedSprite3D prevents autocompletion from showing available animation names when editing their respective play() functions. This is true if the type hints are added manually and also if added automatically by Godot when 'add_type_hints' is set true in Editor Settings.
Inferring types with ":=" and using dynamic typing does not prevent autocompletion.
Steps to reproduce
Add an AnimationPlayer, AnimatedSprite2D and AnimatedSprite3D to an empty scene.
Assign the node to an @onready variable.
Add a line of code in any GDScript function to call the play() function of the instantiated node.
Note the presence / absence of autocompletion lists of animation names when the @onready declaration assumes a dynamic type or infers a type compared with when it has a type hint.
Added note: For anyone that has been puzzled, as I was, by the lack of, or disappearance of, autocompletion lists on these nodes, the workaround for me was simple: just delete their type hints and autocomplete works as expected.
This is the second regression on this PR, it's haunting me T_T
To suggest argument options, we need the value of the get node literal but since #79386 we drop it all together if a type was annotated. This should probably only happen if the value has a different type
Tested versions
Reproducible in 4.2.2.stable and 4.3.dev6. Was present before 4.2.2 but first appearance not established. Occurs in both MacOS 14 and Windows 11.
System information
Godot v4.2.2.stable - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)
Issue description
Adding type hints to variables referencing AnimationPlayer, AnimatedSprite2D and AnimatedSprite3D prevents autocompletion from showing available animation names when editing their respective play() functions. This is true if the type hints are added manually and also if added automatically by Godot when 'add_type_hints' is set true in Editor Settings.
Inferring types with ":=" and using dynamic typing does not prevent autocompletion.
Steps to reproduce
Add an AnimationPlayer, AnimatedSprite2D and AnimatedSprite3D to an empty scene.
Assign the node to an @onready variable.
Add a line of code in any GDScript function to call the play() function of the instantiated node.
Note the presence / absence of autocompletion lists of animation names when the @onready declaration assumes a dynamic type or infers a type compared with when it has a type hint.
Minimal reproduction project (MRP)
automplete_problem_test.zip
The text was updated successfully, but these errors were encountered: