mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ASTPrinter: Add pre and post callbacks for printing synthesized extensions and call them.
This is necessary for jump to synthesized extensions in IDE.
This commit is contained in:
@@ -68,6 +68,15 @@ private:
|
||||
void printModuleRef(ModuleEntity Mod, Identifier Name) override {
|
||||
return OtherPrinter.printModuleRef(Mod, Name);
|
||||
}
|
||||
void printSynthesizedExtensionPre(const ExtensionDecl *ED,
|
||||
const NominalTypeDecl *NTD) override {
|
||||
return OtherPrinter.printSynthesizedExtensionPre(ED, NTD);
|
||||
}
|
||||
|
||||
void printSynthesizedExtensionPost(const ExtensionDecl *ED,
|
||||
const NominalTypeDecl *NTD) override {
|
||||
return OtherPrinter.printSynthesizedExtensionPost(ED, NTD);
|
||||
}
|
||||
|
||||
// Prints regular comments of the header the clang node comes from, until
|
||||
// the location of the node. Keeps track of the comments that were printed
|
||||
@@ -435,9 +444,6 @@ void swift::ide::printSubmoduleInterface(
|
||||
if (!shouldPrint(ET, AdjustedOptions))
|
||||
continue;
|
||||
Printer << "\n";
|
||||
Printer << "/// Synthesized extension from ";
|
||||
ET->getExtendedTypeLoc().getType().print(Printer, AdjustedOptions);
|
||||
Printer << "\n";
|
||||
ET->print(Printer, AdjustedOptions);
|
||||
Printer << "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user