logic: codeview activation policy

* changed activation policy of codeview to activate implicit nodes only when no explicit or undefined nodes are found for the clicked code location.
This commit is contained in:
malte_langkabel
2016-04-20 13:24:03 +02:00
parent ce5c3e8626
commit ea4acef2de
+16 -3
View File
@@ -477,8 +477,9 @@ std::vector<Id> Storage::getActiveTokenIdsForId(Id tokenId, Id* declarationId) c
std::vector<Id> Storage::getNodeIdsForLocationIds(const std::vector<Id>& locationIds) const
{
std::set<Id> nodeIds;
std::set<Id> edgeIds;
std::set<Id> nodeIds;
std::set<Id> implicitNodeIds;
for (Id locationId : locationIds)
{
@@ -492,13 +493,25 @@ std::vector<Id> Storage::getNodeIdsForLocationIds(const std::vector<Id>& locatio
else if(m_sqliteStorage.isNode(elementId))
{
StorageNode node = m_sqliteStorage.getNodeById(elementId);
if (node.id != 0 && intToDefinitionType(node.definitionType) == DEFINITION_EXPLICIT)
if (node.id != 0)
{
nodeIds.insert(elementId);
if (intToDefinitionType(node.definitionType) == DEFINITION_IMPLICIT)
{
implicitNodeIds.insert(elementId);
}
else
{
nodeIds.insert(elementId);
}
}
}
}
if (nodeIds.size() == 0)
{
nodeIds = implicitNodeIds;
}
if (nodeIds.size())
{
return utility::toVector(nodeIds);