-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Optionally include documentation in GDExtension API dump #82331
Conversation
2e6a4e5
to
db9259f
Compare
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.
As a heavy user of extension_api.json
, I would welcome this addition. It would mean one less data source and one less format (XML) that needs to be understood.
The XML files also contain some meta-information that is exclusive to them, for example whether a class is experimental. Do you think it makes sense to add this to the JSON as well -- maybe even the base (non-doc) version?
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.
Thanks, this is a great idea!
I tested locally, and it seems to be working, although I only skimmed through the JSON, I didn't scrutinize it in depth.
The code looks good to me as well! I only have some minor notes about the command-line help info.
db9259f
to
8ee04c5
Compare
Thanks for the timely reviews!
It makes sense to me, but I would prefer not to touch it in this PR. We can discuss it with the GDExtension team on RocketChat. |
Thanks! |
I assume many language bindings will use Python for codegen from the json. Maybe we could have a small python library that can be used for parsing the bbcode in each language binding? |
@rburing We are starting to see a path to create GDExtension C# Bindings using your merge |
For those who found this PR and want to use the feature: note that in #83318 we changed the key name from This will allow generating even more detailed documentation. |
Language bindings implemented in GDExtension that generate glue code (in the future, C#?) may want to include documentation (for classes, properties, methods, signals, etc.) to improve the user experience in code editors and REPLs.
This PR adds an option to include that documentation in the
extension_api.json
file.This is much more convenient than having to obtain and parse ~829 XML files from the Godot source code.
(Ideally the build system for a GDExtension should depend just on having the correct API file, and not on having to run Godot or having the Godot source code.)
extension_api.json
generated using--dump-extension-api
: 5559324 bytes.extension_api.json
generated using--dump-extension-api-with-docs
: 9121481 bytes.Feedback welcome.
There are quite some loops that could be hidden away by adding new core methods to
ClassDoc
, if desired.