Issue 57301
Summary clang-format for obj-c binds : tighter than @selector
Labels clang-format, new issue
Assignees
Reporter zmodem
    Consider:

```
$ cat | buildtools/linux64/clang-format -style=chromium
void f() {
  NSApplication* application = [NSApplication sharedApplication];
  if ([application respondsToSelector:@selector(setAutomaticCustomizeTouchBarMenuItemEnabled:)]) {
    [application setAutomaticCustomizeTouchBarMenuItemEnabled:YES];
  }
}
```

the output is:

```
void f() {
  NSApplication* application = [NSApplication sharedApplication];
  if ([application respondsToSelector:@selector
                   (setAutomaticCustomizeTouchBarMenuItemEnabled:)]) {
    [application setAutomaticCustomizeTouchBarMenuItemEnabled:YES];
  }
}
```

it seems more desirably to keep the `@selector` with its argument, so e.g.

```
if ([application respondsToSelector:
    @selector(setAutomaticCustomizeTouchBarMenuItemEnabled:)]) {
  [application setAutomaticCustomizeTouchBarMenuItemEnabled:YES];
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to