You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Fix references to global constants in C# documentation generator
Tries to find the referenced constants in the GlobalScope if not found in the target class or if no class is specified.
This commit is contained in:
@@ -415,6 +415,11 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
|||||||
}
|
}
|
||||||
} else if (link_tag == "constant") {
|
} else if (link_tag == "constant") {
|
||||||
if (!target_itype || !target_itype->is_object_type) {
|
if (!target_itype || !target_itype->is_object_type) {
|
||||||
|
// Search in @GlobalScope as a last resort if no class was specified
|
||||||
|
if (link_target_parts.size() == 1) {
|
||||||
|
goto find_constant_in_global_scope;
|
||||||
|
}
|
||||||
|
|
||||||
if (OS::get_singleton()->is_stdout_verbose()) {
|
if (OS::get_singleton()->is_stdout_verbose()) {
|
||||||
if (target_itype) {
|
if (target_itype) {
|
||||||
OS::get_singleton()->print("Cannot resolve constant reference for non-Godot.Object type in documentation: %s\n", link_target.utf8().get_data());
|
OS::get_singleton()->print("Cannot resolve constant reference for non-Godot.Object type in documentation: %s\n", link_target.utf8().get_data());
|
||||||
@@ -428,6 +433,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
|||||||
xml_output.append(link_target);
|
xml_output.append(link_target);
|
||||||
xml_output.append("</c>");
|
xml_output.append("</c>");
|
||||||
} else if (!target_itype && target_cname == name_cache.type_at_GlobalScope) {
|
} else if (!target_itype && target_cname == name_cache.type_at_GlobalScope) {
|
||||||
|
find_constant_in_global_scope:
|
||||||
const String target_name = (String)target_cname;
|
const String target_name = (String)target_cname;
|
||||||
|
|
||||||
// Try to find as a global constant
|
// Try to find as a global constant
|
||||||
@@ -498,6 +504,11 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
|||||||
xml_output.append(target_iconst->proxy_name);
|
xml_output.append(target_iconst->proxy_name);
|
||||||
xml_output.append("\"/>");
|
xml_output.append("\"/>");
|
||||||
} else {
|
} else {
|
||||||
|
// Also search in @GlobalScope as a last resort if no class was specified
|
||||||
|
if (link_target_parts.size() == 1) {
|
||||||
|
goto find_constant_in_global_scope;
|
||||||
|
}
|
||||||
|
|
||||||
ERR_PRINT("Cannot resolve constant reference in documentation: '" + link_target + "'.");
|
ERR_PRINT("Cannot resolve constant reference in documentation: '" + link_target + "'.");
|
||||||
|
|
||||||
xml_output.append("<c>");
|
xml_output.append("<c>");
|
||||||
|
|||||||
Reference in New Issue
Block a user