logic: search ui performance optimization
* replaced the implementation of the search index. the search index now uses a search-trie. edges have gates that can be used to check if a character can be matched when following the edge. * SearchMatches now have a text and a list of NameHierarchies that share this node (instead of Ids, so that nodes must be found by names (which makes sure that SearchMatches are still valid after refresh). * when parsing a project's description the CodeController now looks for NameHierarchies instead of SearchNode names to find ids of linked elements.
This commit is contained in:
@@ -48,7 +48,7 @@ std::string SearchMatch::searchMatchesToString(const std::vector<SearchMatch>& m
|
||||
SearchMatch SearchMatch::createCommand(CommandType type)
|
||||
{
|
||||
SearchMatch match;
|
||||
match.nameHierarchy = NameHierarchy(getCommandName(type));
|
||||
match.text = getCommandName(type);
|
||||
match.typeName = "command";
|
||||
match.searchType = SEARCH_COMMAND;
|
||||
return match;
|
||||
@@ -74,7 +74,7 @@ SearchMatch::SearchMatch()
|
||||
}
|
||||
|
||||
SearchMatch::SearchMatch(const std::string& query)
|
||||
: nameHierarchy(query)
|
||||
: text(query)
|
||||
, typeName("")
|
||||
, searchType(SEARCH_NONE)
|
||||
{
|
||||
@@ -87,7 +87,7 @@ bool SearchMatch::isValid() const
|
||||
|
||||
void SearchMatch::print(std::ostream& ostream) const
|
||||
{
|
||||
ostream << weight << '\t' << nameHierarchy.getQualifiedName() << std::endl << '\t';
|
||||
ostream << text << std::endl << '\t';
|
||||
size_t i = 0;
|
||||
for (size_t index : indices)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ void SearchMatch::print(std::ostream& ostream) const
|
||||
|
||||
std::string SearchMatch::getFullName() const
|
||||
{
|
||||
return nameHierarchy.getQualifiedName();
|
||||
return text;
|
||||
}
|
||||
|
||||
std::string SearchMatch::getNodeTypeAsString() const
|
||||
|
||||
Reference in New Issue
Block a user