[SourceKit] CursorInfo: The result of cursor info for a module name starts to include group names in that module.

This commit is contained in:
Xi Ge
2016-03-21 16:29:18 -07:00
parent acdf28f440
commit 3dd149ab99
8 changed files with 55 additions and 1 deletions

View File

@@ -1621,7 +1621,16 @@ void ModuleFile::collectAllGroups(std::vector<StringRef> &Names) const {
if (!GroupNamesMap)
return;
for (auto It = GroupNamesMap->begin(); It != GroupNamesMap->end(); ++ It) {
Names.push_back(It->getSecond());
StringRef FullGroupName = It->getSecond();
if (FullGroupName.empty())
continue;
auto Sep = FullGroupName.find_last_of(Separator);
assert(Sep != StringRef::npos);
auto Group = FullGroupName.substr(0, Sep);
auto Found = std::find(Names.begin(), Names.end(), Group);
if (Found != Names.end())
continue;
Names.push_back(Group);
}
}