-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix enum autocompletion for core classes #89382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm, that the changes solve the issue 👍
Still the location should get set correctly as well. Otherwise we might run into sorting problems.
Besides that it would be nice to have tests to ensure this working. Would be nice if you could add them. (The whole testing system for autocompletion, is quite new and might have some rough edges. So if you don't know how, feel free to ask, or just don't do it and I'll put the issue on my todo list.)
Sure thing! I'll be sure to add the locations and try to do some tests. |
@HolonProduction just to be sure I understood the autocompletion test syntax. A very simple test could look like this: enum_values_autocompletion.gd
enum_values_autocompletion.cfg
Please feel free to correct me, I'll be sure to fix anything before committing any new changes. |
That looks about right. I'd maybe add Also nitpick but in this case it might make sense to also test the location.
So see that the location is Also I am currently unsure why we have to fallthrough in the |
@HolonProduction sorry to bother again, but I'm not sure on how I should be testing the value of location. In my test, I'm autocompleting a node of type
In this case, the location of |
From the code Edit: It isn't |
Minor fix consisted in the use of [[fallthrough]] macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it another test and seems to work well with the sorting. Code makes sense as well and the tests seem to pass. LGTM
Still needs approval from the GDScript Core team though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! And congrats for your first merged Godot contribution 🎉 |
While writing a gdscript, autocompletion wouldn't suggest Enum names for core classes and also wouldn't suggest Enum Values even after the Enum name had been typed. This has now been fixed.
Now, while finding identifiers in a class, enumeration names are also fetched and enumeration constants are now suggested as well.
Fixes #88858.