Skip to content
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

Fix missing GDExtension in-editor API reference #78830

Merged

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Jun 29, 2023

This commit partially reverts e1ce034 (#76431), keeping the core changes which should still be safe.
It also reverts 67e8c57 (#77578) which depends on e1ce034.

This commit partially reverts a change in e1ce034 (#76431) which would prevent from generating API reference for GDExtension APIs.

Fixes #78829.

Another option could be to revert all changes related to the docs cache and revisit it for 4.2, as it's current disabled anyway, and those changes had bigger implications as seen here. But this surgical revert might be enough.

@akien-mga
Copy link
Member Author

Just tested that reverting only this part is enough to fix the regression:

diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index 91358c3475..780b3169b4 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -374,11 +374,6 @@ void DocTools::generate(bool p_basic_types) {
 				classes.pop_front();
 				continue;
 			}
-			if (ClassDB::get_api_type(name) != ClassDB::API_CORE && ClassDB::get_api_type(name) != ClassDB::API_EDITOR) {
-				print_verbose(vformat("Class '%s' belongs neither to core nor editor, skipping.", name));
-				classes.pop_front();
-				continue;
-			}
 
 			String cname = name;
 			// Property setters and getters do not get exposed as individual methods.

Another option would be to add API_EXTENSION to the list of allowed APIs, but then I'm not sure what we're excluding anymore.

This commit partially reverts a change in e1ce034
which would prevent from generating API reference for GDExtension APIs.

Fixes godotengine#78829.
@akien-mga akien-mga force-pushed the classref-fix-missing-gdextension-api branch from 6c1eab4 to b3d1aee Compare June 29, 2023 10:49
@akien-mga
Copy link
Member Author

Just tested that reverting only this part is enough to fix the regression:

Pushed that, so it's more minimal.

@RandomShaper
Copy link
Member

Just tested that reverting only this part is enough to fix the regression:

diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index 91358c3475..780b3169b4 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -374,11 +374,6 @@ void DocTools::generate(bool p_basic_types) {
 				classes.pop_front();
 				continue;
 			}
-			if (ClassDB::get_api_type(name) != ClassDB::API_CORE && ClassDB::get_api_type(name) != ClassDB::API_EDITOR) {
-				print_verbose(vformat("Class '%s' belongs neither to core nor editor, skipping.", name));
-				classes.pop_front();
-				continue;
-			}
 
 			String cname = name;
 			// Property setters and getters do not get exposed as individual methods.

Another option would be to add API_EXTENSION to the list of allowed APIs, but then I'm not sure what we're excluding anymore.

Only API_NONE would remain. So the if could be changed so those are discarded. That said, I think we have some overlap between API_NONE and not exposed classes, but that's another topic.

@akien-mga akien-mga merged commit f228fb7 into godotengine:master Jun 29, 2023
@akien-mga akien-mga deleted the classref-fix-missing-gdextension-api branch June 29, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In-editor API reference for GDExtension-defined classes is missing
2 participants