forked from OSchip/llvm-project
clang-format: [Java] Prefer not to break in parameter annotations.
Before: boolean someFunction(@Param(aaaaaaaaaaaaaaaa) String aaaaa, String bbbbbbbbbbbbbbb) {} After: boolean someFunction( @Param(aaaaaaaaaaaaaaaa) String aaaaa, String bbbbbbbbbbbbbbb) {} llvm-svn: 225971
This commit is contained in:
parent
a18dcf7efd
commit
190fbda6de
|
@ -1587,6 +1587,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
|
|||
return Left.ParameterCount > 1 ? Style.PenaltyBreakBeforeFirstCallParameter
|
||||
: 19;
|
||||
}
|
||||
if (Left.is(TT_JavaAnnotation))
|
||||
return 50;
|
||||
|
||||
if (Right.is(tok::lessless)) {
|
||||
if (Left.is(tok::string_literal)) {
|
||||
|
|
|
@ -287,6 +287,12 @@ TEST_F(FormatTestJava, Annotations) {
|
|||
"ReturnType doSomething(\n"
|
||||
" String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}",
|
||||
getStyleWithColumns(60));
|
||||
verifyFormat("{\n"
|
||||
" boolean someFunction(\n"
|
||||
" @Param(aaaaaaaaaaaaaaaa) String aaaaa,\n"
|
||||
" String bbbbbbbbbbbbbbb) {}\n"
|
||||
"}",
|
||||
getStyleWithColumns(60));
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJava, Generics) {
|
||||
|
|
Loading…
Reference in New Issue