src: miscellaneous fixes

* fixed code view snippet minimize click expanded snippet again
* fixed typedef nodes node grouped within file group
* fixed splitting anonymous namespace bundle increased group nesting instead
* fixed build, tests and clang warnings
This commit is contained in:
Eberhard Graether
2018-06-08 16:12:53 +02:00
parent dcf506e3d7
commit 1a37a9af34
8 changed files with 40 additions and 5 deletions
@@ -476,6 +476,8 @@ std::map<Id, std::pair<Id, NameHierarchy>> PersistentStorage::getNodeIdToParentF
std::map<Id, std::pair<Id, NameHierarchy>> nodeIdToParentFileMap;
std::shared_ptr<SourceLocationCollection> locations = m_sqliteIndexStorage.getSourceLocationsForElementIds(nodeIds);
// prefer scope locations if available
locations->forEachSourceLocation(
[this, &nodeIdToParentFileMap](SourceLocation* location)
{
@@ -490,6 +492,26 @@ std::map<Id, std::pair<Id, NameHierarchy>> PersistentStorage::getNodeIdToParentF
}
);
// fill in missing ones
locations->forEachSourceLocation(
[this, &nodeIdToParentFileMap](SourceLocation* location)
{
if (!location->isStartLocation())
{
return;
}
for (Id tokenId : location->getTokenIds())
{
if (nodeIdToParentFileMap.find(tokenId) == nodeIdToParentFileMap.end())
{
nodeIdToParentFileMap.emplace(tokenId, std::make_pair(getFileNodeId(location->getFilePath()),
NameHierarchy(location->getFilePath().wstr(), NAME_DELIMITER_FILE)));
}
}
}
);
return nodeIdToParentFileMap;
}