Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing gutter icon for inner class method overrides #89545

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
brno32 marked this conversation as resolved.
Show resolved Hide resolved
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<Script> inherited_script = script->get_base_script();
Expand Down Expand Up @@ -1217,7 +1228,7 @@ void ScriptTextEditor::_update_connected_methods() {
text_edit->set_line_gutter_icon(line, connection_gutter, get_parent_control()->get_editor_theme_icon(SNAME("MethodOverrideAndSlot")));
}

methods_found.insert(name);
methods_found.insert(StringName(raw_name));
}
}
}
Expand Down
Loading