Sourcekit/DocSupport: include fully annotated generic signatures for extension decls. rdar://40906297

This commit is contained in:
Xi Ge
2018-12-04 13:00:16 -08:00
parent d8f12cb096
commit d620dfae5e
11 changed files with 50 additions and 4 deletions

View File

@@ -397,6 +397,14 @@ static bool initDocEntityInfo(const Decl *D,
VD, SynthesizedTarget, OS);
else
SwiftLangSupport::printFullyAnnotatedDeclaration(VD, Type(), OS);
} else if (auto *E = dyn_cast<ExtensionDecl>(D)) {
if (auto *Sig = E->getGenericSignature()) {
// The extension under printing is potentially part of a synthesized
// extension. Thus it's hard to print the fully annotated decl. We
// need to at least print the generic signature here.
llvm::raw_svector_ostream OS(Info.FullyAnnotatedGenericSig);
SwiftLangSupport::printFullyAnnotatedGenericReq(Sig, OS);
}
}
}