From 1d93a1fbb8aaf49696dd5508c0d77091ccce5f1f Mon Sep 17 00:00:00 2001 From: Alex Drozd Date: Sat, 16 Mar 2024 00:09:03 +0100 Subject: [PATCH] Fix missing gutter icon for inner class method overrides --- editor/plugins/script_text_editor.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index c093f556eaa..640c755ccf9 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1164,11 +1164,22 @@ void ScriptTextEditor::_update_connected_methods() { // Add override icons to methods. methods_found.clear(); for (int i = 0; i < functions.size(); i++) { - StringName name = StringName(functions[i].get_slice(":", 0)); + String raw_name = functions[i].get_slice(":", 0); + StringName name = StringName(raw_name); if (methods_found.has(name)) { continue; } + // Account for inner classes + if (raw_name.contains(".")) { + // Strip inner class name from the method, and start from the right since + // our inner class might be inside another inner class + int pos = raw_name.rfind("."); + if (pos != -1) { + name = raw_name.substr(pos + 1); + } + } + String found_base_class; StringName base_class = script->get_instance_base_type(); Ref