|
@@ -37,6 +37,7 @@
|
|
#include "core/io/resource_loader.h"
|
|
#include "core/io/resource_loader.h"
|
|
#include "core/os/keyboard.h"
|
|
#include "core/os/keyboard.h"
|
|
#include "core/os/os.h"
|
|
#include "core/os/os.h"
|
|
|
|
+#include "core/string/fuzzy_search.h"
|
|
#include "core/version.h"
|
|
#include "core/version.h"
|
|
#include "editor/code_editor.h"
|
|
#include "editor/code_editor.h"
|
|
#include "editor/debugger/editor_debugger_node.h"
|
|
#include "editor/debugger/editor_debugger_node.h"
|
|
@@ -2013,13 +2014,30 @@ void ScriptEditor::_update_members_overview() {
|
|
functions.sort();
|
|
functions.sort();
|
|
}
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < functions.size(); i++) {
|
|
|
|
- String filter = filter_methods->get_text();
|
|
|
|
- String name = functions[i].get_slicec(':', 0);
|
|
|
|
- if (filter.is_empty() || filter.is_subsequence_ofn(name)) {
|
|
|
|
|
|
+ String filter = filter_methods->get_text();
|
|
|
|
+ if (filter.is_empty()) {
|
|
|
|
+ for (int i = 0; i < functions.size(); i++) {
|
|
|
|
+ String name = functions[i].get_slicec(':', 0);
|
|
members_overview->add_item(name);
|
|
members_overview->add_item(name);
|
|
members_overview->set_item_metadata(-1, functions[i].get_slicec(':', 1).to_int() - 1);
|
|
members_overview->set_item_metadata(-1, functions[i].get_slicec(':', 1).to_int() - 1);
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ PackedStringArray search_names;
|
|
|
|
+ for (int i = 0; i < functions.size(); i++) {
|
|
|
|
+ search_names.append(functions[i].get_slicec(':', 0));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Vector<FuzzySearchResult> results;
|
|
|
|
+ FuzzySearch fuzzy;
|
|
|
|
+ fuzzy.set_query(filter, false);
|
|
|
|
+ fuzzy.search_all(search_names, results);
|
|
|
|
+
|
|
|
|
+ for (const FuzzySearchResult &res : results) {
|
|
|
|
+ String name = functions[res.original_index].get_slicec(':', 0);
|
|
|
|
+ int line = functions[res.original_index].get_slicec(':', 1).to_int() - 1;
|
|
|
|
+ members_overview->add_item(name);
|
|
|
|
+ members_overview->set_item_metadata(-1, line);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
String path = se->get_edited_resource()->get_path();
|
|
String path = se->get_edited_resource()->get_path();
|