return State.Stack.back().StartOfArraySubscripts;
return ContinuationIndent;
}
- if (NextNonComment->is(TT_StartOfName) && NextNonComment->Next &&
- NextNonComment->Next->is(TT_ObjCMethodExpr))
+
+ // This ensure that we correctly format ObjC methods calls without inputs,
+ // i.e. where the last element isn't selector like: [callee method];
+ if (NextNonComment->is(tok::identifier) && NextNonComment->FakeRParens == 0 &&
+ NextNonComment->Next && NextNonComment->Next->is(TT_ObjCMethodExpr))
return State.Stack.back().Indent;
+
if (NextNonComment->isOneOf(TT_StartOfName, TT_PointerOrReference) ||
Previous.isOneOf(tok::coloncolon, tok::equal))
return ContinuationIndent;
ScopedContextCreator ContextCreator(*this, tok::less, 10);
// If this angle is in the context of an expression, we need to be more
- // hesitant to detect it as opening template parameters.
+ // hesitant to detect it as opening template parameters.
bool InExprContext = Contexts.back().IsExpression;
Contexts.back().IsExpression = false;
" hints:nil];");
verifyFormat("[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];");
+ verifyFormat("[aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa)\n"
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];");
verifyFormat(
"scoped_nsobject<NSTextField> message(\n"