Skip to content

Fix GDScriptDocGen not handling named enums properly - #122731

Closed
skorpnok wants to merge 1 commit into
godotengine:masterfrom
skorpnok:GDScriptTooltipEnumFix
Closed

Fix GDScriptDocGen not handling named enums properly#122731
skorpnok wants to merge 1 commit into
godotengine:masterfrom
skorpnok:GDScriptTooltipEnumFix

Conversation

@skorpnok

@skorpnok skorpnok commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

Additional information

This PR changes/fixes how GDScriptDocGen stores the constants of named enums. EnumDoc now 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_data to check if the p_class_name refers 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.

And related EditorHelpBit::_get_constant_help_data
@skorpnok
skorpnok requested review from a team as code owners August 23, 2026 01:29
@skorpnok

skorpnok commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

While looking through other issues that seemed related I found other PR's that address the missing tooltip but none of the ones I found address the shadowing problem. #115942 looks like a lot nicer of a way of handling the EditorHelpBit part, however. if wanted I can adapt this PR to follow that approach for it.

@skorpnok
skorpnok marked this pull request as draft August 23, 2026 10:00
@skorpnok

skorpnok commented Aug 23, 2026

Copy link
Copy Markdown
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.

@skorpnok skorpnok closed this Aug 23, 2026
@skorpnok

skorpnok commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

The first half of the PR might still be relevant if refined given @dalexeev 's review comment in #113309
Might also be related to #87825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Named enum key tooltip does not show the value

2 participants