mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Cursor info: for extension decls, the cursor info query always returns the extended nominal's group name.
This commit is contained in:
@@ -1546,7 +1546,14 @@ Optional<StringRef> ModuleFile::getGroupNameById(unsigned Id) const {
|
||||
}
|
||||
|
||||
Optional<StringRef> ModuleFile::getGroupNameForDecl(const Decl *D) const {
|
||||
auto Triple = getCommentForDecl(D);
|
||||
auto GroupD = D;
|
||||
|
||||
// Extensions always exist in the same group with the nominal.
|
||||
if (auto ED = dyn_cast_or_null<ExtensionDecl>(D->getDeclContext()->
|
||||
getInnermostTypeContext())) {
|
||||
GroupD = ED->getExtendedType()->getAnyNominal();
|
||||
}
|
||||
auto Triple = getCommentForDecl(GroupD);
|
||||
if (!Triple.hasValue()) {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user