summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/class_db.cpp14
-rw-r--r--core/class_db.h3
-rw-r--r--modules/gdscript/gd_editor.cpp4
3 files changed, 16 insertions, 5 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 1fe02c8cd9..6b8c290a99 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -497,7 +497,7 @@ void ClassDB::_add_class2(const StringName &p_class, const StringName &p_inherit
}
}
-void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance) {
+void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance, bool p_exclude_from_properties) {
OBJTYPE_RLOCK;
@@ -528,6 +528,9 @@ void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, b
minfo.name = E->get();
minfo.id = method->get_method_id();
+ if (p_exclude_from_properties && type->methods_in_properties.has(minfo.name))
+ continue;
+
for (int i = 0; i < method->get_argument_count(); i++) {
//Variant::Type t=method->get_argument_type(i);
@@ -802,7 +805,14 @@ void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, cons
OBJTYPE_WLOCK
type->property_list.push_back(p_pinfo);
-
+#ifdef DEBUG_METHODS_ENABLED
+ if (mb_get) {
+ type->methods_in_properties.insert(p_getter);
+ }
+ if (mb_set) {
+ type->methods_in_properties.insert(p_setter);
+ }
+#endif
PropertySetGet psg;
psg.setter = p_setter;
psg.getter = p_getter;
diff --git a/core/class_db.h b/core/class_db.h
index 547068da5f..4f00a16e91 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -139,6 +139,7 @@ public:
#ifdef DEBUG_METHODS_ENABLED
List<StringName> constant_order;
List<StringName> method_order;
+ Set<StringName> methods_in_properties;
List<MethodInfo> virtual_methods;
StringName category;
#endif
@@ -486,7 +487,7 @@ public:
static bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false);
static void set_method_flags(StringName p_class, StringName p_method, int p_flags);
- static void get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance = false);
+ static void get_method_list(StringName p_class, List<MethodInfo> *p_methods, bool p_no_inheritance = false, bool p_exclude_from_properties = false);
static MethodBind *get_method(StringName p_class, StringName p_name);
static void add_virtual_method(const StringName &p_class, const MethodInfo &p_method, bool p_virtual = true);
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 12e26163d9..adf3c8edc4 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -1276,7 +1276,7 @@ static void _find_identifiers_in_class(GDCompletionContext &context, bool p_stat
}
}
List<MethodInfo> methods;
- ClassDB::get_method_list(type, &methods);
+ ClassDB::get_method_list(type, &methods, false, true);
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
if (E->get().name.begins_with("_"))
continue;
@@ -2251,7 +2251,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
}
List<MethodInfo> mi;
- ClassDB::get_method_list(t.obj_type, &mi);
+ ClassDB::get_method_list(t.obj_type, &mi, false, true);
for (List<MethodInfo>::Element *E = mi.front(); E; E = E->next()) {
if (E->get().name.begins_with("_"))