| 2116 | } |
| 2117 | |
| 2118 | void ScriptEditor::_update_members_overview() { |
| 2119 | members_overview->clear(); |
| 2120 | |
| 2121 | ScriptEditorBase *se = _get_current_editor(); |
| 2122 | if (!se) { |
| 2123 | return; |
| 2124 | } |
| 2125 | |
| 2126 | Vector<String> functions = se->get_functions(); |
| 2127 | if (EDITOR_GET("text_editor/script_list/sort_members_outline_alphabetically")) { |
| 2128 | functions.sort(); |
| 2129 | } |
| 2130 | |
| 2131 | String filter = filter_methods->get_text(); |
| 2132 | if (filter.is_empty()) { |
| 2133 | for (int i = 0; i < functions.size(); i++) { |
| 2134 | String name = functions[i].get_slicec(':', 0); |
| 2135 | members_overview->add_item(name); |
| 2136 | members_overview->set_item_metadata(-1, functions[i].get_slicec(':', 1).to_int() - 1); |
| 2137 | } |
| 2138 | } else { |
| 2139 | PackedStringArray search_names; |
| 2140 | for (int i = 0; i < functions.size(); i++) { |
| 2141 | search_names.append(functions[i].get_slicec(':', 0)); |
| 2142 | } |
| 2143 | |
| 2144 | Vector<FuzzySearchResult> results; |
| 2145 | FuzzySearch fuzzy; |
| 2146 | fuzzy.set_query(filter, false); |
| 2147 | fuzzy.search_all(search_names, results); |
| 2148 | |
| 2149 | for (const FuzzySearchResult &res : results) { |
| 2150 | String name = functions[res.original_index].get_slicec(':', 0); |
| 2151 | int line = functions[res.original_index].get_slicec(':', 1).to_int() - 1; |
| 2152 | members_overview->add_item(name); |
| 2153 | members_overview->set_item_metadata(-1, line); |
| 2154 | } |
| 2155 | } |
| 2156 | |
| 2157 | String path = se->get_edited_resource()->get_path(); |
| 2158 | bool built_in = !path.is_resource_file(); |
| 2159 | String name = built_in ? path.get_file() : se->get_name(); |
| 2160 | filename->set_text(name); |
| 2161 | } |
| 2162 | |
| 2163 | void ScriptEditor::_update_help_overview_visibility() { |
| 2164 | int selected = tab_container->get_current_tab(); |
nothing calls this directly
no test coverage detected