Fix GDScriptDocGen not handling named enums properly - #122731
Closed
skorpnok wants to merge 1 commit into
Closed
Conversation
And related EditorHelpBit::_get_constant_help_data
Contributor
Author
|
While looking through other issues that seemed related I found other PR's that address the missing tooltip |
skorpnok
marked this pull request as draft
August 23, 2026 10:00
Contributor
Author
|
Closed for now. Upon further inspection removing the named enum constants from the parent class constants may not be a safe change as there are other bits that seem to already expect them there. I still think that having identical names that need filtering in the constants vector is a bad pattern but this needs discussion. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) does this PR solve?
Godot does not show enum values in code hover tooltips #122633 Enum key declaration has no tooltip #122584
Additional information
This PR changes/fixes how
GDScriptDocGenstores the constants of named enums.EnumDocnow stores its associated constants instead them being added to the parent class constants. This also fixes a bug that allowed named enums to shadow the doc data of constants of the same name in the parent class.It also adds a second code path in
EditorHelpBit::_get_constant_help_datato check if thep_class_namerefers to a named enum. This is a bit ugly but likely the easiest solution. Things could probably be reshuffled a bit to reduce the code duplication in the function but at the cost of being harder to follow.