logic: preselecting SearchNodes for autocompletion by prefiltering the Graph with the entered Query

This change only shows matches in the autocompletion list that are prefiltered by the already entered query. The
autocompletion now also shows up after an operator of type . or > has been entered to show an alphabetical list of
possible tokens.
This commit is contained in:
Eberhard Graether
2014-10-28 20:21:19 +01:00
parent ede0af4291
commit 86f4629b0d
27 changed files with 407 additions and 198 deletions
+8 -4
View File
@@ -71,7 +71,8 @@ public:
// GraphAccess implementation
virtual Id getIdForNodeWithName(const std::string& fullName) const;
virtual std::string getNameForNodeWithId(Id id) const;
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(const std::string& query) const;
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(
const std::string& query, const std::string& word) const;
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const;
@@ -93,8 +94,6 @@ protected:
const SearchIndex& getSearchIndex() const;
private:
void initSearchIndex();
Node* addNodeHierarchy(Node::NodeType type, std::vector<std::string> nameHierarchy);
Node* addNodeHierarchy(Node::NodeType type, const std::string& fullName);
@@ -110,11 +109,16 @@ private:
Edge* addTypeEdge(Node* node, Edge::EdgeType edgeType, const ParseTypeUsage& typeUsage);
TokenLocation* addTokenLocation(Token* token, const ParseLocation& location, bool isScope = false);
bool getSubQuerySearchResults(
const std::string& query, const std::string& word, SearchIndex::SearchResults* results) const;
void log(std::string type, std::string str, const ParseLocation& location) const;
StorageGraph m_graph;
TokenLocationCollection m_locationCollection;
SearchIndex m_index;
SearchIndex m_tokenIndex;
SearchIndex m_filterIndex;
};
#endif // STORAGE_H