summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-10-21 08:24:18 +0000
committerDaniel Jasper <djasper@google.com>2014-10-21 08:24:18 +0000
commitfab69ff095db6cc222281d266b66d3b8083ad3ed (patch)
treedf882251bddf46eca7641ac436e3f60946f3d6ce /clang/lib/Format/ContinuationIndenter.cpp
parentb0852e54100c442f8b73f2e4238fe701eea2b3ce (diff)
downloadbcm5719-llvm-fab69ff095db6cc222281d266b66d3b8083ad3ed.tar.gz
bcm5719-llvm-fab69ff095db6cc222281d266b66d3b8083ad3ed.zip
clang-format: [Java] Wrap after each function annotation.
Before: @Override public String toString() { .. } After: @Override public String toString() { .. } llvm-svn: 220274
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index ead1da99c2d..4c93c7f548c 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -458,6 +458,7 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
!PreviousNonComment->isOneOf(tok::comma, tok::semi) &&
PreviousNonComment->Type != TT_TemplateCloser &&
PreviousNonComment->Type != TT_BinaryOperator &&
+ PreviousNonComment->Type != TT_JavaAnnotation &&
Current.Type != TT_BinaryOperator && !PreviousNonComment->opensScope())
State.Stack.back().BreakBeforeParameter = true;
@@ -533,7 +534,8 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
if (Previous.is(tok::comma) && State.Stack.back().VariablePos != 0)
return State.Stack.back().VariablePos;
if ((PreviousNonComment && (PreviousNonComment->ClosesTemplateDeclaration ||
- PreviousNonComment->Type == TT_AttributeParen)) ||
+ PreviousNonComment->Type == TT_AttributeParen ||
+ PreviousNonComment->Type == TT_JavaAnnotation)) ||
(!Style.IndentWrappedFunctionNames &&
(NextNonComment->is(tok::kw_operator) ||
NextNonComment->Type == TT_FunctionDeclarationName)))
OpenPOWER on IntegriCloud