Merge pull request #57281 from Rubonnek/rename-subsequence
This commit is contained in:
commit
899cd34426
|
@ -3080,7 +3080,7 @@ bool String::is_subsequence_of(const String &p_string) const {
|
|||
return _base_is_subsequence_of(p_string, false);
|
||||
}
|
||||
|
||||
bool String::is_subsequence_ofi(const String &p_string) const {
|
||||
bool String::is_subsequence_ofn(const String &p_string) const {
|
||||
return _base_is_subsequence_of(p_string, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ public:
|
|||
bool ends_with(const String &p_string) const;
|
||||
bool is_enclosed_in(const String &p_string) const;
|
||||
bool is_subsequence_of(const String &p_string) const;
|
||||
bool is_subsequence_ofi(const String &p_string) const;
|
||||
bool is_subsequence_ofn(const String &p_string) const;
|
||||
bool is_quoted() const;
|
||||
Vector<String> bigrams() const;
|
||||
float similarity(const String &p_string) const;
|
||||
|
|
|
@ -1382,7 +1382,7 @@ static void _register_variant_builtin_methods() {
|
|||
bind_methodv(String, begins_with, static_cast<bool (String::*)(const String &) const>(&String::begins_with), sarray("text"), varray());
|
||||
bind_method(String, ends_with, sarray("text"), varray());
|
||||
bind_method(String, is_subsequence_of, sarray("text"), varray());
|
||||
bind_method(String, is_subsequence_ofi, sarray("text"), varray());
|
||||
bind_method(String, is_subsequence_ofn, sarray("text"), varray());
|
||||
bind_method(String, bigrams, sarray(), varray());
|
||||
bind_method(String, similarity, sarray("text"), varray());
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@
|
|||
Returns [code]true[/code] if this string is a subsequence of the given string.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_subsequence_ofi" qualifiers="const">
|
||||
<method name="is_subsequence_ofn" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="text" type="String" />
|
||||
<description>
|
||||
|
|
|
@ -1009,7 +1009,7 @@ void ConnectionsDock::update_tree() {
|
|||
PackedStringArray argnames;
|
||||
|
||||
String filter_text = search_box->get_text();
|
||||
if (!filter_text.is_subsequence_ofi(signal_name)) {
|
||||
if (!filter_text.is_subsequence_ofn(signal_name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ void CreateDialog::_update_search() {
|
|||
// Filter all candidate results.
|
||||
Vector<String> candidates;
|
||||
for (List<StringName>::Element *I = type_list.front(); I; I = I->next()) {
|
||||
if (empty_search || search_text.is_subsequence_ofi(I->get())) {
|
||||
if (empty_search || search_text.is_subsequence_ofn(I->get())) {
|
||||
candidates.push_back(I->get());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
|
|||
// Apply filters.
|
||||
while (parent) {
|
||||
const bool had_siblings = item->get_prev() || item->get_next();
|
||||
if (filter.is_subsequence_ofi(item->get_text(0))) {
|
||||
if (filter.is_subsequence_ofn(item->get_text(0))) {
|
||||
break; // Filter matches, must survive.
|
||||
}
|
||||
parent->remove_child(item);
|
||||
|
|
|
@ -72,7 +72,7 @@ void EditorCommandPalette::_update_command_search(const String &search_text) {
|
|||
r.shortcut_text = commands[r.key_name].shortcut;
|
||||
r.last_used = commands[r.key_name].last_used;
|
||||
|
||||
if (search_text.is_subsequence_ofi(r.display_name)) {
|
||||
if (search_text.is_subsequence_ofn(r.display_name)) {
|
||||
if (!search_text.is_empty()) {
|
||||
r.score = _score_path(search_text, r.display_name.to_lower());
|
||||
}
|
||||
|
|
|
@ -2595,7 +2595,7 @@ void EditorInspector::update_tree() {
|
|||
|
||||
// Ignore properties that do not fit the filter.
|
||||
if (use_filter && !filter.is_empty()) {
|
||||
if (!filter.is_subsequence_ofi(path) && !filter.is_subsequence_ofi(property_label_string) && property_prefix.to_lower().find(filter.to_lower()) == -1) {
|
||||
if (!filter.is_subsequence_ofn(path) && !filter.is_subsequence_ofn(property_label_string) && property_prefix.to_lower().find(filter.to_lower()) == -1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,13 +71,13 @@ void GroupDialog::_load_nodes(Node *p_current) {
|
|||
TreeItem *node = nullptr;
|
||||
NodePath path = scene_tree->get_edited_scene_root()->get_path_to(p_current);
|
||||
if (keep && p_current->is_in_group(selected_group)) {
|
||||
if (remove_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) {
|
||||
if (remove_filter->get_text().is_subsequence_ofn(String(p_current->get_name()))) {
|
||||
node = nodes_to_remove->create_item(remove_node_root);
|
||||
keep = true;
|
||||
} else {
|
||||
keep = false;
|
||||
}
|
||||
} else if (keep && add_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) {
|
||||
} else if (keep && add_filter->get_text().is_subsequence_ofn(String(p_current->get_name()))) {
|
||||
node = nodes_to_add->create_item(add_node_root);
|
||||
keep = true;
|
||||
} else {
|
||||
|
|
|
@ -1878,7 +1878,7 @@ void ScriptEditor::_update_members_overview() {
|
|||
for (int i = 0; i < functions.size(); i++) {
|
||||
String filter = filter_methods->get_text();
|
||||
String name = functions[i].get_slice(":", 0);
|
||||
if (filter.is_empty() || filter.is_subsequence_ofi(name)) {
|
||||
if (filter.is_empty() || filter.is_subsequence_ofn(name)) {
|
||||
members_overview->add_item(name);
|
||||
members_overview->set_item_metadata(members_overview->get_item_count() - 1, functions[i].get_slice(":", 1).to_int() - 1);
|
||||
}
|
||||
|
@ -2128,7 +2128,7 @@ void ScriptEditor::_update_script_names() {
|
|||
Vector<_ScriptEditorItemData> sedata_filtered;
|
||||
for (int i = 0; i < sedata.size(); i++) {
|
||||
String filter = filter_scripts->get_text();
|
||||
if (filter.is_empty() || filter.is_subsequence_ofi(sedata[i].name)) {
|
||||
if (filter.is_empty() || filter.is_subsequence_ofn(sedata[i].name)) {
|
||||
sedata_filtered.push_back(sedata[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2076,7 +2076,7 @@ void ThemeTypeDialog::_update_add_type_options(const String &p_filter) {
|
|||
Vector<StringName> unique_names;
|
||||
for (const StringName &E : names) {
|
||||
// Filter out undesired values.
|
||||
if (!p_filter.is_subsequence_ofi(String(E))) {
|
||||
if (!p_filter.is_subsequence_ofn(String(E))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ void EditorQuickOpen::_update_search() {
|
|||
// Filter possible candidates.
|
||||
Vector<Entry> entries;
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
if (empty_search || search_text.is_subsequence_ofi(files[i])) {
|
||||
if (empty_search || search_text.is_subsequence_ofn(files[i])) {
|
||||
Entry r;
|
||||
r.path = files[i];
|
||||
r.score = empty_search ? 0 : _score_path(search_text, files[i].to_lower());
|
||||
|
|
|
@ -411,7 +411,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll
|
|||
item->set_as_cursor(0);
|
||||
}
|
||||
|
||||
bool keep = (filter.is_subsequence_ofi(String(p_node->get_name())));
|
||||
bool keep = (filter.is_subsequence_ofn(String(p_node->get_name())));
|
||||
|
||||
for (int i = 0; i < p_node->get_child_count(); i++) {
|
||||
bool child_keep = _add_nodes(p_node->get_child(i), item, p_scroll_to_selected);
|
||||
|
|
|
@ -379,7 +379,7 @@ void EditorSettingsDialog::_update_shortcuts() {
|
|||
// Join the text of the events with a delimiter so they can all be displayed in one cell.
|
||||
String events_display_string = event_strings.is_empty() ? "None" : String("; ").join(event_strings);
|
||||
|
||||
if (!shortcut_filter.is_subsequence_ofi(action_name) && (events_display_string == "None" || !shortcut_filter.is_subsequence_ofi(events_display_string))) {
|
||||
if (!shortcut_filter.is_subsequence_ofn(action_name) && (events_display_string == "None" || !shortcut_filter.is_subsequence_ofn(events_display_string))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ void EditorSettingsDialog::_update_shortcuts() {
|
|||
|
||||
// Shortcut Item
|
||||
|
||||
if (!shortcut_filter.is_subsequence_ofi(sc->get_name())) {
|
||||
if (!shortcut_filter.is_subsequence_ofn(sc->get_name())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ Array GDScriptWorkspace::symbol(const Dictionary &p_params) {
|
|||
Vector<lsp::DocumentedSymbolInformation> script_symbols;
|
||||
E.value->get_symbols().symbol_tree_as_list(E.key, script_symbols);
|
||||
for (int i = 0; i < script_symbols.size(); ++i) {
|
||||
if (query.is_subsequence_ofi(script_symbols[i].name)) {
|
||||
if (query.is_subsequence_ofn(script_symbols[i].name)) {
|
||||
lsp::DocumentedSymbolInformation symbol = script_symbols[i];
|
||||
symbol.location.uri = get_file_uri(symbol.location.uri);
|
||||
arr.push_back(symbol.to_json());
|
||||
|
|
|
@ -889,7 +889,7 @@ void GridMapEditor::update_palette() {
|
|||
name = "#" + itos(id);
|
||||
}
|
||||
|
||||
if (!filter.is_empty() && !filter.is_subsequence_ofi(name)) {
|
||||
if (!filter.is_empty() && !filter.is_subsequence_ofn(name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -2857,7 +2857,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
|
|||
completion_options_casei.push_back(option);
|
||||
} else if (s.is_subsequence_of(option.display)) {
|
||||
completion_options_subseq.push_back(option);
|
||||
} else if (s.is_subsequence_ofi(option.display)) {
|
||||
} else if (s.is_subsequence_ofn(option.display)) {
|
||||
completion_options_subseq_casei.push_back(option);
|
||||
}
|
||||
|
||||
|
|
|
@ -877,7 +877,7 @@ TEST_CASE("[String] is_subsequence_of") {
|
|||
String a = "is subsequence of";
|
||||
CHECK(String("sub").is_subsequence_of(a));
|
||||
CHECK(!String("Sub").is_subsequence_of(a));
|
||||
CHECK(String("Sub").is_subsequence_ofi(a));
|
||||
CHECK(String("Sub").is_subsequence_ofn(a));
|
||||
}
|
||||
|
||||
TEST_CASE("[String] match") {
|
||||
|
|
Loading…
Reference in New Issue