MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _gutter_clicked

Method _gutter_clicked

editor/script/script_text_editor.cpp:1686–1725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686void ScriptTextEditor::_gutter_clicked(int p_line, int p_gutter) {
1687 if (p_gutter != connection_gutter) {
1688 return;
1689 }
1690
1691 Dictionary meta = code_editor->get_text_editor()->get_line_gutter_metadata(p_line, p_gutter);
1692 String type = meta.get("type", "");
1693 if (type.is_empty()) {
1694 return;
1695 }
1696
1697 // All types currently need a method name.
1698 String method = meta.get("method", "");
1699 if (method.is_empty()) {
1700 return;
1701 }
1702
1703 if (type == "connection") {
1704 Node *base = get_tree()->get_edited_scene_root();
1705 if (!base) {
1706 return;
1707 }
1708
1709 Vector<Node *> nodes = _find_all_node_for_script(base, base, script);
1710 connection_info_dialog->popup_connections(method, nodes);
1711 } else if (type == "inherits") {
1712 String base_class_raw = meta["base_class"];
1713 PackedStringArray base_class_split = base_class_raw.split(":", true, 1);
1714
1715 if (base_class_split[0] == "script") {
1716 // Go to function declaration.
1717 Ref<Script> base_script = ResourceLoader::load(base_class_split[1]);
1718 ERR_FAIL_COND(base_script.is_null());
1719 emit_signal(SNAME("go_to_method"), base_script, method);
1720 } else if (base_class_split[0] == "builtin") {
1721 // Open method documentation.
1722 emit_signal(SNAME("go_to_help"), "class_method:" + base_class_split[1] + ":" + method);
1723 }
1724 }
1725}
1726
1727void ScriptTextEditor::_edit_option(int p_op) {
1728 CodeEdit *tx = code_editor->get_text_editor();

Callers

nothing calls this directly

Calls 9

get_text_editorMethod · 0.80
popup_connectionsMethod · 0.80
splitMethod · 0.80
getMethod · 0.45
is_emptyMethod · 0.45
get_edited_scene_rootMethod · 0.45
is_nullMethod · 0.45

Tested by

no test coverage detected