https://bugs.llvm.org/show_bug.cgi?id=38156

            Bug ID: 38156
           Summary: [Formatter/ObjC] Formatter should put arguments into
                    one line when block is the last argument
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: joles...@google.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

For a method invocation with many arguments but only one inline block which is
the last argument, clang-format should put arguments into one line (if a column
limit allows).

Right now, this:
[object aa:aa bb:^{
    return cccccccc;
}];

Is formatted (clang-format -style='{BasedOnStyle: llvm, ColumnLimit: 20}'
file.m) to:
[object
    aa:aa
    bb:^{
      return cccccccc;
    }];

Notice that the return line in the output breaks the column limit.

I think that output style makes sense in a general case, e.g. if:
1. There is more then 1 inline block.
2. Arguments don't fit into one line.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to