summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRedworkDE <10944644+RedworkDE@users.noreply.github.com>2023-03-24 11:40:54 +0100
committerYuri Sizov <yuris@humnom.net>2023-03-27 17:55:32 +0200
commitadc7edd907b5a126d70e6efc2afd71d4b89c30f1 (patch)
treeb75dd1d8efda116a72353d8a934d90dec96ecb28 /modules
parent9573574788b0ab4b5707aaba34a81110864748e6 (diff)
C#: Do not print errors about missing references to intentionally ignored members
(cherry picked from commit 42cf684837aa9d4e4e92d216ac0454bbb03761f4)
Diffstat (limited to 'modules')
-rw-r--r--modules/mono/editor/bindings_generator.cpp26
-rw-r--r--modules/mono/editor/bindings_generator.h5
2 files changed, 26 insertions, 5 deletions
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<PropertyInterface> properties;
List<MethodInterface> methods;
List<SignalInterface> signals_;
+ HashSet<String> 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;