Editor: Fix documentation for built-in scripts #92280
Open
+40
−18
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.
Fixes the following bugs:
1. Standard tooltip is displayed instead of doc tooltip
I couldn't reproduce this, but it is apparently caused by the check:
godot/editor/connections_dialog.cpp
Lines 875 to 879 in b947c53
godot/editor/connections_dialog.cpp
Line 1520 in b947c53
2. Doc tooltip is empty for built-in classes and their members
This is because the Script Editor handles editing/saving external and built-in scripts inconsistently. As a result,
Script.reload()
was never called for built-in scripts (this method causes documentation to be regenerated in GDScript).I'm not familiar with the Script Editor, so I tried to make minimal changes. I'm not sure about this part, please review and test carefully.
2.1. Documentation missing for built-in scripts
This is the real reason why tooltips didn't work. This fix may be inconvenient for some people, but we cannot make tooltips work without registering the built-in scripts documentation globally. Instead, we might add filters in the future (see godotengine/godot-proposals#4285).
After the fix:
3. EditorHelp does not handle
::
in class names correctlyAdded parsing instead of
get_slice(":", index)
.