mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[InterfacePrinting] Add a print option to specify whether members of a decl should be separated by empty new lines.
By doing so, SourceKit can print Swift intefaces in the same fashion of what Xcode conventionally does. rdar://21710381 Swift SVN r30430
This commit is contained in:
@@ -1390,15 +1390,11 @@ void SourceFile::print(ASTPrinter &Printer, const PrintOptions &PO) {
|
||||
for (auto decl : Decls) {
|
||||
if (!decl->shouldPrintInContext(PO))
|
||||
continue;
|
||||
|
||||
if(decl->print(Printer, PO)) {
|
||||
// For a major decl, we print an empty line before it.
|
||||
if (MajorDeclKinds.find(decl->getKind()) != MajorDeclKinds.end())
|
||||
Printer << "\n";
|
||||
if(decl->print(Printer, PO))
|
||||
Printer << "\n";
|
||||
|
||||
// For a major decl, we print an empty line after it.
|
||||
if (MajorDeclKinds.find(decl->getKind()) != MajorDeclKinds.end()) {
|
||||
Printer << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user