[llvm-bugs] [Bug 37111] New: [Formatter/ObjC] @selector(method:arg:) tends to be line-wrapped around the ( rather than :

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 12 10:38:07 PDT 2018


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

            Bug ID: 37111
           Summary: [Formatter/ObjC] @selector(method:arg:) tends to be
                    line-wrapped around the ( rather than :
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david at dzhang.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

clang-format binds method argument : tighter than @selector(, resulting in the
following odd formatting.

See also: https://bugs.chromium.org/p/chromium/issues/detail?id=711737

----------------------------------------

input.m:

- (void)test {
    if ([object
respondsToSelector:@selector(selectorNameThatIsReallyLong:param1:param2:)])
        return;
}

$ clang-format -style=llvm input.m

- (void)test {
  if ([object respondsToSelector:@selector
              (selectorNameThatIsReallyLong:param1:param2:)])
    return;
}

$ clang-format --version
clang-format version 7.0.0 (tags/google/stable/2018-01-11)

----------------------------------------

The @selector and its ( should remain together

I have not been able to find a combination of config options that avoids this
behavior.

-- 
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/20180412/f5e52e10/attachment.html>


More information about the llvm-bugs mailing list