[llvm-bugs] [Bug 38720] New: [Formatter/ObjC] Avoid breaks after @protocol, return, etc. to fit the rest of the expression into a second line

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 27 06:24:52 PDT 2018


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

            Bug ID: 38720
           Summary: [Formatter/ObjC] Avoid breaks after @protocol, return,
                    etc. to fit the rest of the expression into a second
                    line
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jolesiak at google.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Current formatting:
@protocol
    aaaaaaaaaaaaaaaaaaaaaaaa <aaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa>

Should be formatted:
@protocol aaaaaaaaaaaaaaaaaaaaaaaa <aaaaaaaaaaaaaaaaaaaaaaa, 
                                    aaaaaaaaaaaaaaaaaaaaaaa>

The same way it is formatted now if there is not enough space to break after
"@protocol" and fit the rest of the expression into second line:
@protocol aaaaaaaaaaaaaaaaaaaaaaaaAA <aaaaaaaaaaaaaaaaaaaaaaa,
                                      aaaaaaaaaaaaaaaaaaaaaaa>

This should also work consistently with patterns like:
return [aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa:aaaaaaaaaaa
                                 aaaaaaaaaaaa:aaaaaaaaaa];

return @[
    aaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaa
];

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180827/f4c33eb9/attachment.html>


More information about the llvm-bugs mailing list