mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[IDE/ModuleInterface] Fix erroneously printed newline between a regular comment and the declaration it is 'attached' to.
Swift SVN r16293
This commit is contained in:
@@ -362,7 +362,8 @@ void ClangCommentPrinter::printCommentsUntil(ClangNode Node) {
|
||||
const auto &Ctx = ClangLoader.getClangASTContext();
|
||||
const auto &SM = Ctx.getSourceManager();
|
||||
|
||||
clang::SourceLocation NodeLoc = SM.getFileLoc(Node.getLocation());
|
||||
clang::SourceLocation NodeLoc =
|
||||
SM.getFileLoc(Node.getSourceRange().getBegin());
|
||||
if (NodeLoc.isInvalid())
|
||||
return;
|
||||
unsigned NodeLineNo = SM.getSpellingLineNumber(NodeLoc);
|
||||
@@ -424,7 +425,8 @@ void ClangCommentPrinter::printCommentsUntil(ClangNode Node) {
|
||||
}
|
||||
*this << CommentText << "\n";
|
||||
printIndent();
|
||||
LastPrintedCommentLineNo = LineNo;
|
||||
LastPrintedCommentLineNo =
|
||||
SM.getLineNumber(LocInfo.first, LocInfo.second + Tok.getLength());
|
||||
|
||||
} while (true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user