New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 800819 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

clang-format quality problem

Project Member Reported by macourteau@chromium.org, Jan 10 2018

Issue description

clang-format produced code that (choose all that apply): 
- Doesn't match Chromium style
- No sane human would ever choose

Here's the code before formatting:

  if (action == @selector(showGuessPanel:) ||
      action == @selector(toggleGrammarChecking:)) {

Here's the code after formatting:

  if (action == @selector(showGuessPanel:) || action == @selector
                                                  (toggleGrammarChecking:)) {

Here's how it ought to look:

  if (action == @selector(showGuessPanel:) ||
      action == @selector(toggleGrammarChecking:)) {

Code review link for full files/context:

https://chromium-review.googlesource.com/c/chromium/src/+/860520
 

Comment 1 by thakis@chromium.org, Jan 23 2018

I looked at this some today, without too much luck. If I say "@selectoo" then it does what we expect, so clang-format's special handling of @selector causes this somehow.

clang-format has the concept of an "Obj-C method expression" (usually `[foo bar:baz quuz:quux]`), and it sensibly (?) marks the contents of @selector(...) as one, since that contains a selector. But that breaks some other assumption down the line. Needs more investigation.
Status: Assigned (was: Untriaged)
Labels: clang-format
Labels: Pri-2
Setting defect without priority to Pri-2.
Setting defect without priority to Pri-2.

Sign in to add a comment