forked from OSchip/llvm-project
clang-format: [Java] Improve annotation handling.
Before: @SuppressWarnings( value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii; After: @SuppressWarnings(value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii; llvm-svn: 220284
This commit is contained in:
parent
171eb8dbeb
commit
fd68191db4
|
@ -1817,6 +1817,8 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
|
|||
return false;
|
||||
if (Left.Tok.getObjCKeywordID() == tok::objc_interface)
|
||||
return false;
|
||||
if (Left.Type == TT_JavaAnnotation)
|
||||
return true;
|
||||
if (Right.Type == TT_StartOfName ||
|
||||
Right.Type == TT_FunctionDeclarationName || Right.is(tok::kw_operator))
|
||||
return true;
|
||||
|
|
|
@ -82,6 +82,8 @@ TEST_F(FormatTestJava, Annotations) {
|
|||
"});");
|
||||
|
||||
verifyFormat("@Partial @Mock DataLoader loader;");
|
||||
verifyFormat("@SuppressWarnings(value = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\")\n"
|
||||
"public static int iiiiiiiiiiiiiiiiiiiiiiii;");
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJava, Generics) {
|
||||
|
|
Loading…
Reference in New Issue