-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Documentation generated by GDScript documentation comments disappears #72406
Comments
Since both those issues have been resolved, @eh-jogos would you be able to test on Beta 17 and see if the issue is still present? |
@anvilfolk just tested the MRP with beta 17 and it's still happening. |
Good to know! For whomever is looking at this: right now the Maybe someone from the documentation team can shine a little light :) |
Still happening in 4.0-stable |
I am revamping the documentation generation system in #72095 and have some leads on a fix for this one :) My understanding is that scripts are only loaded on-demand, so if you open a single script, then its documentation, and try to click a link to another script documentation page, that won't have been generated (because that script hasn't been opened, compiled, and docgen'd). I'll be trying to trigger script compilation/docgen when the user clicks a hyperlink in the help screen :) |
i can still replicate this issue in Steps to reproduce (Modified )
Api-.3.mp4Minimal reproduction project |
There were some conversations about how to fix this a while back. Godot already builds a mapping of global class names to the file they are declared in, so that when some script refers to a global class name, it knows what file to load. I suspect the best way to tackle this issue is to duplicate or reuse this functionality in order to register classes into the helper dialog so that they are at least found and shown on the list. |
Very slowly thinking my way through a solution for this. There are some annoyances:
I feel like compiling all of a project's scripts on editor startup so that documentation appears is a terrible idea for large projects. For discussing solutions, here are a couple of terms I'm introducing:
Possible solutions:
I'm most tempted by 3, even though I am still unhappy about adding a documentation generation API that loads scripts behind the scenes at the So approach 3 is more code and work because of all the extra caching stuff, but may also be the best compromise to keep the editor loading smoothly. It feels like the best trade-off to me. What do folks think? |
@anvilfolk Sounds like you want to have all script documentation cached, and only regenerated if the corresponding class was modified or if there is no cache at all. While this comes with all the drawbacks of having cache, that's the only way to provide all the documentation at startup, without having to generate it at each startup. |
It sounds like you're saying it's totally acceptable to cache the entire documentation (instead of just some stubs with relevant information for It does mean that at some point, we're asking all project scripts to get compiled, but that only happens once :) Does that sound right? |
We already cache the entire class reference. We don't cache extensions, but they instead always generate docs on load. So it seems fine to me to cache documentation from scripts. We may have to do the same for extensions, though detecting changes there may be trickier. One issue to deal with would be external updates to scripts when the editor is off. But we already handle that somehow? Probably using the last modified date on the file. |
Sweet, thanks for the information! I might try to get a crack at it then :) |
@anvilfolk, here is my perspective, as I am a heavy user of the code documentation. Thinking out loud:
Only thing I am not aware of hooks to start the documentation data creation process, during startup or when script files are saved. |
I'm running into this in v4.3.beta1.official [a4f2ea9], I noticed because the tooltips on the properties in the inspector won't show up until I force Godot to parse the script again by doing some change on it. |
How about beta3? Just to be sure |
Tested. I have the same behaviour in v4.3.beta3.official [82cedc8]. |
I just noticed this issue in 4.2.2-stable, but I don't have to reload the project twice for it to happen. I just have to reload once and no need to edit any other files. Meanwhile, a (crappy) workaround is to edit the affected files. Just add a space somewhere and save, and it will be listed in the docs again (and probably persist, at least until you delete the |
This PR adds a script documentation cache in the project folder. It is loaded at alongside native documentation caches. This makes scripts fully accessible through Search Help, including their members, etc, right from project start, without having to compile every single script. Fixes godotengine#72406, fixes godotengine#86577.
This PR adds a script documentation cache in the project folder. It is loaded at alongside native documentation caches. This makes scripts fully accessible through Search Help, including their members, etc, right from project start, without having to compile every single script. Fixes godotengine#72406, fixes godotengine#86577.
This PR adds a script documentation cache in the project folder. It is loaded at alongside native documentation caches. This makes scripts fully accessible through Search Help, including their members, etc, right from project start, without having to compile every single script. Fixes godotengine#72406, fixes godotengine#86577.
Is there any other way around this? This is an absolute nightmare when working on a addon with a fair amount of documented classes. Can I manually force Godot to recompile all scripts? |
I've been working on a fix (#95821). I've been dealing with a sick kid so haven't had time to incorporate the latest feedback but hopefully it will not be a problem for much longer! Super excited to see GDScript documentation become more and more useful, and more and more used! In the meantime, the PR does work, so you can always download it and compile yourself or use its build artifacts :) |
@anvilfolk Thank you for your great work. For now the tooltips in VSCode should too! I am also excited for your fix and improvements to this great feature! |
Godot version
4.0 beta16
System information
Manjaro Linux using i3, Foward+
Issue description
Lets's say you have a script using documentation comments, it will have it's own Documentation page generated in the editor.
If you close the editor, then open the editor again, work on another, unrelated script and save it, close the editor and open it again, the documentation page for your first script will be gone.
Searching for it will also give no results:
Then to get the documentation generated again, you have to open the first script, make some change to it and save it. The old trick of commenting/uncommenting any line and saving also works.
Steps to reproduce
Minimal reproduction project
gdscript_documentation_comments.zip
The text was updated successfully, but these errors were encountered: