| 1684 | } |
| 1685 | |
| 1686 | void 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 | |
| 1727 | void ScriptTextEditor::_edit_option(int p_op) { |
| 1728 | CodeEdit *tx = code_editor->get_text_editor(); |
nothing calls this directly
no test coverage detected