-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Do not cache the doc information written by user in the script in Inspector #71843
Conversation
a8cb82c
to
0f464f6
Compare
Why do you say it fixes it partially but not completely? It looks like it works fully! |
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.
Since script classes aren't registered with ClassDB as far as I can tell, then this does exactly what it says on the tin. Stuff that is static, like native classes, can be cached. Scripts, on the other hand, will never be cached here and updated docs information will always be obtained.
This does mean more work with checking whether EditorHelp
's thread is running, but it should be negligible.
Highly recommend merging :)
godot/editor/plugins/script_text_editor.cpp Line 476 in a7276f1
godot/modules/gdscript/gdscript.cpp Lines 768 to 773 in a7276f1
godot/core/object/script_language.cpp Lines 609 to 611 in a7276f1
The call to |
Oh, interesting! I wonder whether this is related to the issue I'm trying to track down, where if you have two different scripts attached to nodes, and all have documentation, when opening the project tooltips work for one script but not for the other. I think this PR will fix the symptom though: empty docs lead to empty caches, but the script eventually should have docs registered in Very cool detective work, this also gives me some more information to follow up on. Basically the issue seems to be that some forms of loading/using exports do not rely on |
Yes, this PR hands over to other PRs the job of preparing the latest data for the document before calling
|
I believe this would fix #63997 as well. I feel like part of the linked issue here is a duplicate of that one? |
Yes, both are essentially caching issues. |
Just a quick thought - extension tends to refer to a file extension, like I keep trying to get someone to look into this one and merge in the chat but no luck so far. |
…pector The doc information of the edited object is cached to reuse it in the next `EditorInspector::update_tree()` call. This is not suitable for doc information written by users in the script because it is easily changed.
Now it seems to generate script doc information in godot/modules/gdscript/gdscript.cpp Lines 800 to 802 in ee86505
So in order to update the doc information of the script in the Inspector, we need to call |
Yes, I pulled out the documentation generation into its own class, which gets called in That feels like it could be a future PR though, doesn't need to be for this one! |
Thanks! |
Yessssssssssss, I am so happy!!! Everyone update their tooltips all the time now 🎉 🎉 🎉 Thanks @Rindbee! |
This helps to resolve (partially) #70217 , but doesn't completely resolve it.
The inspector will be updated when
*
appears after modification, and then the inspector will not be updated again after continuing to save.Fixed (partially) #63997.
Needs another PR to have the latest doc data ready before updating the tree for a full fix. See #71843 (comment).