From ae737d8cd946178c48a518e7342d031dccb23b62 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Wed, 5 Jun 2024 18:24:59 +0300 Subject: [PATCH] Editor: Hide GDScript internal functions from method selectors --- editor/connections_dialog.cpp | 9 +++++++++ editor/property_selector.cpp | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 1145a10f7107..cede2c0ab663 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -294,6 +294,13 @@ List ConnectDialog::_filter_method_list(const List &p_me } for (const MethodInfo &mi : p_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; + } + if (!p_search_string.is_empty() && !mi.name.containsn(p_search_string)) { continue; } @@ -324,8 +331,10 @@ List ConnectDialog::_filter_method_list(const List &p_me continue; } } + ret.push_back(mi); } + return ret; } diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index d123d8ef596f..a5157bd394b7 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -225,11 +225,24 @@ void PropertySelector::_update_search() { } else { Ref