logic: Codeview Snippet order
Sorting the Snippets in. the Codeview. Active Token first then declaration, filename and extension
This commit is contained in:
@@ -392,7 +392,7 @@ std::shared_ptr<Graph> Storage::getGraphForActiveTokenIds(const std::vector<Id>&
|
||||
return graph;
|
||||
}
|
||||
|
||||
std::vector<Id> Storage::getActiveTokenIdsForId(Id tokenId) const
|
||||
std::vector<Id> Storage::getActiveTokenIdsForId(Id tokenId, Id& declarationId) const
|
||||
{
|
||||
std::vector<Id> ret;
|
||||
Token* token = m_graph.getTokenById(tokenId);
|
||||
@@ -401,17 +401,22 @@ std::vector<Id> Storage::getActiveTokenIdsForId(Id tokenId) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret.push_back(token->getId());
|
||||
|
||||
Node* node;
|
||||
if (token->isEdge())
|
||||
{
|
||||
node = dynamic_cast<Edge*>(token)->getTo();
|
||||
declarationId = node->getId();
|
||||
ret.push_back(node->getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
node = dynamic_cast<Node*>(token);
|
||||
declarationId = node->getId();
|
||||
}
|
||||
|
||||
ret.push_back(node->getId());
|
||||
//ret.push_back(node->getId());
|
||||
|
||||
node->forEachEdge(
|
||||
[&node, &ret](Edge* e)
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const;
|
||||
|
||||
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId) const;
|
||||
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId, Id& declarationId) const;
|
||||
virtual std::vector<Id> getLocationIdsForTokenIds(const std::vector<Id>& tokenIds) const;
|
||||
|
||||
virtual std::vector<Id> getTokenIdsForQuery(std::string query) const;
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const = 0;
|
||||
|
||||
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId) const = 0;
|
||||
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId, Id& declarationId) const = 0;
|
||||
virtual std::vector<Id> getLocationIdsForTokenIds(const std::vector<Id>& tokenIds) const = 0;
|
||||
|
||||
virtual std::vector<Id> getTokenIdsForQuery(std::string query) const = 0;
|
||||
|
||||
@@ -67,11 +67,11 @@ std::shared_ptr<Graph> GraphAccessProxy::getGraphForActiveTokenIds(const std::ve
|
||||
return std::make_shared<Graph>();
|
||||
}
|
||||
|
||||
std::vector<Id> GraphAccessProxy::getActiveTokenIdsForId(Id tokenId) const
|
||||
std::vector<Id> GraphAccessProxy::getActiveTokenIdsForId(Id tokenId, Id& delcarationId) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getActiveTokenIdsForId(tokenId);
|
||||
return m_subject->getActiveTokenIdsForId(tokenId, delcarationId);
|
||||
}
|
||||
|
||||
return std::vector<Id>();
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const;
|
||||
|
||||
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId) const;
|
||||
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId, Id& declarationId) const;
|
||||
virtual std::vector<Id> getLocationIdsForTokenIds(const std::vector<Id>& tokenIds) const;
|
||||
|
||||
virtual std::vector<Id> getTokenIdsForQuery(std::string query) const;
|
||||
|
||||
Reference in New Issue
Block a user