diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 5bccb362525..603a2365c14 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -967,12 +967,17 @@ void ScriptTextEditor::_update_connected_methods() { text_edit->clear_info_icons(); missing_connections.clear(); + if (!script->is_valid()) { + return; + } + Node *base = get_tree()->get_edited_scene_root(); if (!base) { return; } Vector nodes = _find_all_node_for_script(base, base, script); + Set methods_found; for (int i = 0; i < nodes.size(); i++) { List connections; nodes[i]->get_signals_connected_to_this(&connections); @@ -989,28 +994,33 @@ void ScriptTextEditor::_update_connected_methods() { continue; } + if (methods_found.has(connection.method)) { + continue; + } + if (!ClassDB::has_method(script->get_instance_base_type(), connection.method)) { - - int line = script->get_language()->find_function(connection.method, text_edit->get_text()); - if (line < 0) { - // There is a chance that the method is inherited from another script. - bool found_inherited_function = false; - Ref