forked from OSchip/llvm-project
clang-format: [Java] Fix formatting of multiple annotations.
Before: @SuppressWarnings(value = "unchecked") @Author(name = "abc") public void doSomething() { } After: @SuppressWarnings(value = "unchecked") @Author(name = "abc") public void doSomething() { } llvm-svn: 220286
This commit is contained in:
parent
5ffcb7fe90
commit
d78c422378
|
@ -827,7 +827,8 @@ private:
|
|||
PreviousNoComment->isOneOf(tok::comma, tok::l_brace))
|
||||
Current.Type = TT_DesignatedInitializerPeriod;
|
||||
} else if (Current.isOneOf(tok::identifier, tok::kw_const) &&
|
||||
Current.Previous && Current.Previous->isNot(tok::equal) &&
|
||||
Current.Previous &&
|
||||
!Current.Previous->isOneOf(tok::equal, tok::at) &&
|
||||
Line.MightBeFunctionDecl && Contexts.size() == 1) {
|
||||
// Line.MightBeFunctionDecl can only be true after the parentheses of a
|
||||
// function declaration have been found.
|
||||
|
|
|
@ -74,6 +74,9 @@ TEST_F(FormatTestJava, Annotations) {
|
|||
|
||||
verifyFormat("@SuppressWarnings(value = \"unchecked\")\n"
|
||||
"public void doSomething() {\n}");
|
||||
verifyFormat("@SuppressWarnings(value = \"unchecked\")\n"
|
||||
"@Author(name = \"abc\")\n"
|
||||
"public void doSomething() {\n}");
|
||||
|
||||
verifyFormat("DoSomething(new A() {\n"
|
||||
" @Override\n"
|
||||
|
|
Loading…
Reference in New Issue