HackStudio: Fuzzy-match Locator suggestions

This also sorts them to put better results first. Currently the
fuzzy-match algorithm gets a little confused, but as that improves, so
will this.
This commit is contained in:
Sam Atkins 2024-01-25 14:51:24 +00:00 committed by Sam Atkins
commit 4b1c7533f5
Notes: sideshowbarker 2024-07-17 00:59:43 +09:00
2 changed files with 18 additions and 11 deletions

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
* Copyright (c) 2024, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -78,7 +79,7 @@ Locator::Locator(Core::EventReceiver* parent)
open_suggestion(index);
};
m_model = GUI::FilteringProxyModel::create(ProjectDeclarations::the().declarations_model()).release_value_but_fixme_should_propagate_errors();
m_model = GUI::FilteringProxyModel::create(ProjectDeclarations::the().declarations_model(), GUI::FilteringProxyModel::FilteringOptions::SortByScore).release_value_but_fixme_should_propagate_errors();
m_suggestion_view->set_model(m_model);
}