From adc7edd907b5a126d70e6efc2afd71d4b89c30f1 Mon Sep 17 00:00:00 2001 From: RedworkDE <10944644+RedworkDE@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:40:54 +0100 Subject: C#: Do not print errors about missing references to intentionally ignored members (cherry picked from commit 42cf684837aa9d4e4e92d216ac0454bbb03761f4) --- modules/mono/editor/bindings_generator.cpp | 26 +++++++++++++++++++++----- modules/mono/editor/bindings_generator.h | 5 +++++ 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 83101c1443..6690a3badb 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -523,7 +523,10 @@ void BindingsGenerator::_append_xml_method(StringBuilder &p_xml_output, const Ty p_xml_output.append(target_imethod->proxy_name); p_xml_output.append("\"/>"); } else { - ERR_PRINT("Cannot resolve method reference in documentation: '" + p_link_target + "'."); + if (!p_target_itype->is_intentionally_ignored(p_link_target)) { + ERR_PRINT("Cannot resolve method reference in documentation: '" + p_link_target + "'."); + } + _append_xml_undeclared(p_xml_output, p_link_target); } } @@ -563,7 +566,10 @@ void BindingsGenerator::_append_xml_member(StringBuilder &p_xml_output, const Ty p_xml_output.append(target_iprop->proxy_name); p_xml_output.append("\"/>"); } else { - ERR_PRINT("Cannot resolve member reference in documentation: '" + p_link_target + "'."); + if (!p_target_itype->is_intentionally_ignored(p_link_target)) { + ERR_PRINT("Cannot resolve member reference in documentation: '" + p_link_target + "'."); + } + _append_xml_undeclared(p_xml_output, p_link_target); } } @@ -591,7 +597,10 @@ void BindingsGenerator::_append_xml_signal(StringBuilder &p_xml_output, const Ty p_xml_output.append(target_isignal->proxy_name); p_xml_output.append("\"/>"); } else { - ERR_PRINT("Cannot resolve signal reference in documentation: '" + p_link_target + "'."); + if (!p_target_itype->is_intentionally_ignored(p_link_target)) { + ERR_PRINT("Cannot resolve signal reference in documentation: '" + p_link_target + "'."); + } + _append_xml_undeclared(p_xml_output, p_link_target); } } @@ -613,7 +622,10 @@ void BindingsGenerator::_append_xml_enum(StringBuilder &p_xml_output, const Type p_xml_output.append(target_enum_itype.proxy_name); // Includes nesting class if any p_xml_output.append("\"/>"); } else { - ERR_PRINT("Cannot resolve enum reference in documentation: '" + p_link_target + "'."); + if (!p_target_itype->is_intentionally_ignored(p_link_target)) { + ERR_PRINT("Cannot resolve enum reference in documentation: '" + p_link_target + "'."); + } + _append_xml_undeclared(p_xml_output, p_link_target); } } @@ -673,7 +685,10 @@ void BindingsGenerator::_append_xml_constant(StringBuilder &p_xml_output, const // Also search in @GlobalScope as a last resort if no class was specified _append_xml_constant_in_global_scope(p_xml_output, p_target_cname, p_link_target); } else { - ERR_PRINT("Cannot resolve constant reference in documentation: '" + p_link_target + "'."); + if (!p_target_itype->is_intentionally_ignored(p_link_target)) { + ERR_PRINT("Cannot resolve constant reference in documentation: '" + p_link_target + "'."); + } + _append_xml_undeclared(p_xml_output, p_link_target); } } @@ -2936,6 +2951,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { if (method_has_ptr_parameter(method_info)) { // Pointers are not supported. + itype.ignored_members.insert(method_info.name); continue; } diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index 5c266ed31f..eac281ddb4 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -408,6 +408,7 @@ class BindingsGenerator { List properties; List methods; List signals_; + HashSet ignored_members; bool has_virtual_methods = false; @@ -471,6 +472,10 @@ class BindingsGenerator { return nullptr; } + bool is_intentionally_ignored(const String &p_name) const { + return ignored_members.has(p_name); + } + private: static DocData::ClassDoc *_get_type_doc(TypeInterface &itype) { String doc_name = itype.name.begins_with("_") ? itype.name.substr(1) : itype.name; -- cgit v1.2.3