summaryrefslogtreecommitdiffstats
path: root/editor/property_selector.cpp
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2024-06-05 18:24:59 +0300
committerDanil Alexeev <danil@alexeev.xyz>2024-06-05 18:24:59 +0300
commitae737d8cd946178c48a518e7342d031dccb23b62 (patch)
tree8c5333fb1b2ed94bb868763c7f19198656e6694f /editor/property_selector.cpp
parent96a386f3c424af96d950ee5098b4b0e4907c9508 (diff)
downloadredot-engine-ae737d8cd946178c48a518e7342d031dccb23b62.tar.gz
Editor: Hide GDScript internal functions from method selectors
Diffstat (limited to 'editor/property_selector.cpp')
-rw-r--r--editor/property_selector.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index d123d8ef59..a5157bd394 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -225,11 +225,24 @@ void PropertySelector::_update_search() {
} else {
Ref<Script> script_ref = Object::cast_to<Script>(ObjectDB::get_instance(script));
if (script_ref.is_valid()) {
- methods.push_back(MethodInfo("*Script Methods"));
if (script_ref->is_built_in()) {
script_ref->reload(true);
}
- script_ref->get_script_method_list(&methods);
+
+ List<MethodInfo> script_methods;
+ script_ref->get_script_method_list(&script_methods);
+
+ methods.push_back(MethodInfo("*Script Methods")); // TODO: Split by inheritance.
+
+ for (const MethodInfo &mi : script_methods) {
+ if (mi.name.begins_with("@")) {
+ // GH-92782. GDScript inline setters/getters are historically present in `get_method_list()`
+ // and can be called using `Object.call()`. However, these functions are meant to be internal
+ // and their names are not valid identifiers, so let's hide them from the user.
+ continue;
+ }
+ methods.push_back(mi);
+ }
}
StringName base = base_type;