ui: Added second line to search autocompletion list showing namespace or filepath

* Show namespace or filepath in second line of search autocompletions
* Add filepaths relative to .coatidb location
* Rescore matches to acknowledge line split
* Fixed SearchMatch type to be drawn always visible at right edge
This commit is contained in:
Eberhard Graether
2016-10-31 22:41:17 +01:00
parent 8445e705f6
commit a4240def56
21 changed files with 564 additions and 168 deletions
+11 -11
View File
@@ -11,7 +11,7 @@ public:
void test_search_index_finds_id_of_element_added()
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("foo\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("foo\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
std::vector<SearchResult> results = index.search("oo", 0);
@@ -23,7 +23,7 @@ public:
void test_search_index_finds_correct_indices_for_query()
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("foo\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("foo\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
std::vector<SearchResult> results = index.search("oo", 0);
@@ -36,8 +36,8 @@ public:
void test_search_index_finds_ids_for_ambiguous_query()
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("for\tsvoid\tp() const"));
index.addNode(2, NameHierarchy::deserialize("fos\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("for\tsvoid\tp() const").getQualifiedName());
index.addNode(2, NameHierarchy::deserialize("fos\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
std::vector<SearchResult> results = index.search("fo", 0);
@@ -51,7 +51,7 @@ public:
void test_search_index_does_not_find_anything_after_clear()
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("foo\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("foo\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
index.clear();
std::vector<SearchResult> results = index.search("oo", 0);
@@ -62,8 +62,8 @@ public:
void test_search_index_does_not_find_all_results_when_max_amount_is_limited()
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("foo1\tsvoid\tp() const"));
index.addNode(2, NameHierarchy::deserialize("foo2\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("foo1\tsvoid\tp() const").getQualifiedName());
index.addNode(2, NameHierarchy::deserialize("foo2\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
std::vector<SearchResult> results = index.search("oo", 1);
@@ -73,8 +73,8 @@ public:
void test_search_index_query_is_case_insensitive()
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("foo1\tsvoid\tp() const"));
index.addNode(2, NameHierarchy::deserialize("FOO2\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("foo1\tsvoid\tp() const").getQualifiedName());
index.addNode(2, NameHierarchy::deserialize("FOO2\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
std::vector<SearchResult> results = index.search("oo", 0);
@@ -85,8 +85,8 @@ public:
{
SearchIndex index;
index.addNode(1, NameHierarchy::deserialize("oaabbcc\tsvoid\tp() const"));
index.addNode(2, NameHierarchy::deserialize("ocbcabc\tsvoid\tp() const"));
index.addNode(1, NameHierarchy::deserialize("oaabbcc\tsvoid\tp() const").getQualifiedName());
index.addNode(2, NameHierarchy::deserialize("ocbcabc\tsvoid\tp() const").getQualifiedName());
index.finishSetup();
std::vector<SearchResult> results = index.search("abc", 0);