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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user