-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add support for documenting most editor settings in the class reference #48548
Add support for documenting most editor settings in the class reference #48548
Conversation
bdc16e6
to
544c3b8
Compare
editor/doc_tools.cpp
Outdated
|
||
if (name == "EditorSettings") { | ||
// Special case for editor settings, so they can be documented. | ||
// Force the use of default editor settings to prevent the user's settings | ||
// (and list of projects) from being included the list. | ||
EditorSettings::create(true); | ||
EditorSettings::get_singleton()->get_property_list(&properties); | ||
own_properties = properties; |
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.
Settings which are defined inside editor constructors (e.g. EditorNode EDITOR_DEF("run/output/always_clear_output_on_play", true);
) will not be picked up on since the editor is not instantiated. This is also true for some project settings which do not get picked up by the doctool, e.g. editor/main_run_args
, see my comment here: godotengine/godot-proposals#1339 (comment)
1a77f87
to
45769b0
Compare
c5ae78b
to
24db120
Compare
All settings present in the XML are now documented! That said, this doesn't mean all editor settings are now documented. Doing so would require significant refactoring to move editor setting declarations to a centralized location, so I'd prefer leaving this to a future PR.
Edit: Fixed by destroying the EditorSettings instance after using it. Thanks to @pycbouh for the advice 🙂 gdb backtrace
|
24db120
to
3fde2cc
Compare
3fde2cc
to
3db8fa7
Compare
This'd be great to have, I looked around for an issue/PR for this after trying to mess with some settings and not understanding what they do. Is there anything blocking this atm? |
This needs to be tested again once #50864 is merged, to see whether documentation generation still works in that case (it probably does). |
Needs a rebase. If some extensive review is needed from @godotengine/documentation for the added descriptions, I would suggest splitting this in two PRs: one to add the possibility to generate and use editor settings docstrings, and sync the empty templates. And one that fills the templates. |
3db8fa7
to
d705b17
Compare
Rebased, with descriptions added for new settings. I'm getting this error on CI, but I forgot where you force "fake" default values for doctool to use: - <member name="filesystem/directories/default_project_path" type="String" setter="" getter="" default=""/home/hugo"">
+ <member name="filesystem/directories/default_project_path" type="String" setter="" getter="" default=""/home/runner""> |
d705b17
to
7478d7c
Compare
I suspect we only have something for project settings, but not editor settings. The |
c36f160
to
d28f847
Compare
d28f847
to
d0e6d9a
Compare
Settings defined in editor plugins are missing (about 100 of them), but all other settings (about 200 of them) can now be documented in the EditorSettings class. Co-authored-by: Rémi Verschelde <[email protected]>
d0e6d9a
to
63ce655
Compare
I pushed an update which makes the solution a lot less hacky. I think it's good to go now :) |
Thanks! |
Cherry-picked for 3.6. |
Settings defined in editor plugins are missing (about 100 of them), but all other settings (about 200 of them) are now documented in the EditorSettings class.
This PR can be remade for the
3.x
branch once we reach an agreement on its design.This closes godotengine/godot-proposals#1339 and closes godotengine/godot-docs#395. See also #49524 and #49525 (can be merged independently).
Edit: This PR no longer includes the actual documentation for easier reviewing. Settings were actually documented in #63870.
TODO
--doctool .
run (the XML is still generated fine).In a future PR, I'll move editor setting default declarations to be located as much as possible in
editor/editor_settings.cpp
, so they can all be picked up by doctool and then documented.