Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion of animation names stops working when type hints are added to AnimationPlayer, AnimatedSprite2D and AnimatedSprite3D variables in GDScript #92219

Open
RayJJ opened this issue May 21, 2024 · 5 comments · May be fixed by #92263

Comments

@RayJJ
Copy link

RayJJ commented May 21, 2024

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

@RayJJ
Copy link
Author

RayJJ commented May 21, 2024

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.

@matheusmdx
Copy link
Contributor

Bisecting points to commit 6f8cc1b (added in #85784) / #79386 as the culprit:

image

@dalexeev
Copy link
Member

^^ CC @HolonProduction

@HolonProduction
Copy link
Contributor

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

@RayJJ
Copy link
Author

RayJJ commented May 23, 2024

Thank you everyone. That was a really impressive turnaround time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Fix pending review
Development

Successfully merging a pull request may close this issue.

4 participants