-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Import Godot docs for builtin types #584
Comments
I assume we'd be reading the XML files from the engine repo? I don't think any of the current dependencies are well-suited to the task of parsing XML. roxmltree seems like a reasonable place to start looking? Not updated recently, but XML hasn't changed much lol. |
|
I'm looking at the json serialization stuff, are we currently just skipping over docs in json for the most part? It looks like we're basically just using What/where are the flags for getting documentation from the extension_api? |
At the moment, docs are not part of the JSON, but yes, the deserialization logic would skip it anyway.
On the Godot executable, The caveat is that the output is much bigger (which can e.g. matter, since we store prebuilt artifacts with the JSON file, and might later publish those to crates.io). Also, the doc dump wasn't available since 4.0, we'd need to conditionally support it. |
What would be the alternative to storing the larger JSON, I guess keep it locally but not publish it? Would this be a separate feature flag or just a version cfg? I'd imagine the latter? |
I would only consider making this more complex if we run into actual issues with the size. Or if we see that the JSON doesn't contain all the information we require, and we need the separate XML docs anyway. |
Looks like many items have a I don't think a single custom deserializer for a
It's hard to get a sense just from looking at the JSON whether it's sufficient but it seems pretty comprehensive. I actually couldn't easily figure out how to make cargo update to the version with docs even replacing the argument passed to the binary, so I ended up just generating it myself, but that shouldn't change the serialization plumbing. |
We should not manually write documentation for builtin types like
Vector3
,Quaternion
,Callable
, ... -- except in cases where the Rust API differs from Godot's. Otherwise, it would require us to copy-paste large swaths of Godot's docs, only for it to become outdated when upstream changes.Instead, can automate it by pre-generating documentation in
godot-codegen
and importing it on demand:rustdoc output:
The text was updated successfully, but these errors were encountered: