[SourceKit] DocInfo: Update the printed doc comment for synthesized extensions therefore it reflects the synthesized targets explicitly. rdar://25439820

This commit is contained in:
Xi Ge
2016-03-31 16:57:35 -07:00
parent 045ee83705
commit 16a23d79b4
5 changed files with 71 additions and 23 deletions

View File

@@ -434,6 +434,18 @@ void SwiftLangSupport::printFullyAnnotatedDeclaration(const ValueDecl *VD,
VD->print(Printer, PO);
}
void SwiftLangSupport::
printFullyAnnotatedSynthesizedExtension(swift::ExtensionDecl * Extension,
swift::NominalTypeDecl *Target,
llvm::raw_ostream &OS) {
FullyAnnotatedDeclarationPrinter Printer(OS);
PrintOptions PO = PrintOptions::printQuickHelpDeclaration();
SynthesizedExtensionAnalyzer Analyzer(Target, PO);
PO.initArchetypeTransformerForSynthesizedExtensions(Target, &Analyzer);
Extension->print(Printer, PO);
}
template <typename FnTy>
void walkRelatedDecls(const ValueDecl *VD, const FnTy &Fn) {
llvm::SmallDenseMap<DeclName, unsigned, 16> NamesSeen;