From cbf17b5ac1b57e056a385d4e0da5b73ab2804809 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Mon, 14 Aug 2023 11:27:49 -0500 Subject: [PATCH] C#: Dereference editor types in core documentation --- modules/mono/editor/bindings_generator.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 342c94cbd90..d3bb12655a6 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -367,9 +367,19 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf } if (target_itype) { - xml_output.append("proxy_name); - xml_output.append("\"/>"); + if ((!p_itype || p_itype->api_type == ClassDB::API_CORE) && target_itype->api_type == ClassDB::API_EDITOR) { + // Editor references in core documentation cannot be resolved, + // handle as standard codeblock. + _log("Cannot reference editor type '%s' in documentation for core type '%s'\n", + target_itype->proxy_name.utf8().get_data(), p_itype ? p_itype->proxy_name.utf8().get_data() : "@GlobalScope"); + xml_output.append(""); + xml_output.append(target_itype->proxy_name); + xml_output.append(""); + } else { + xml_output.append("proxy_name); + xml_output.append("\"/>"); + } } else { ERR_PRINT("Cannot resolve type reference in documentation: '" + tag + "'.");