This reverts commit r311457. It reveals some dormant bugs in comment
reflowing, like breaking a single line jsdoc type annotation before a
parameter into multiple lines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311641
91177308-0d34-0410-b5e6-
96231b3b80d8
return 0;
}
} else if (Current.is(TT_BlockComment)) {
- if (!Style.ReflowComments ||
+ if (!Current.isTrailingComment() || !Style.ReflowComments ||
// If a comment token switches formatting, like
// /* clang-format on */, we don't want to break it further,
// but we may still want to adjust its indentation.
"* long */",
getLLVMStyleWithColumns(20)));
}
-
-TEST_F(FormatTestComments, NonTrailingBlockComments) {
- verifyFormat("const /** comment comment */ A = B;",
- getLLVMStyleWithColumns(40));
-
- verifyFormat("const /** comment comment comment */ A =\n"
- " B;",
- getLLVMStyleWithColumns(40));
-
- EXPECT_EQ("const /** comment comment comment\n"
- " comment */\n"
- " A = B;",
- format("const /** comment comment comment comment */\n"
- " A = B;",
- getLLVMStyleWithColumns(40)));
-}
} // end namespace
} // end namespace format
} // end namespace clang