-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
GDScript: Misc fixes and improvements for signature generation #75691
GDScript: Misc fixes and improvements for signature generation #75691
Conversation
BitMask
s and Variant
/void
BitField
s and Variant
/void
* Use type hints for `@GlobalScope` enums. * Use plain `int` for `BitMask<T>`. * Fix type hints for typed arrays. * Use `Variant` and `void` type hints. * Discard unnecessary class prefix.
bbfccff
to
9df96e9
Compare
BitField
s and Variant
/void
There is still room for improvements (add completion options to override script methods, discard unnecessary class prefix considering custom classes/scripts, etc.), but for now I'd rather stick with a small PR. Test project: test_signature_generation.zip. |
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.
The PR was reviewed by the GDScript team. This fixes an important issue that will help users to write better typed code.
As discussed, this autocomplete feature will only work, currently, with virtual native functions. So we don't have to worry, for now, to autocomplete typed functions for non-typed existing functions.
Thanks for your PR! Very appreciated.
Thanks! |
This PR fixes some type hints that are added to the function signature if the
text_editor/completion/add_type_hints
editor setting is enabled.@GlobalScope
enums (support added in Make global scope enums accessible as types in GDScript #73590).int
forBitMask<T>
as this is not currently supported in GDScript (see also DisplayBitField[Enum]
in docs to distinguish fromEnum
#74641).Variant
andvoid
type hints.Before
1.mp4
After
2.mp4
Closes #75311.
Closes #74593.