[PATCH] D45004: [clang-format] New style option IndentWrappedObjCMethodNames

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 28 15:47:04 PDT 2018


benhamilton created this revision.
benhamilton added reviewers: djasper, jolesiak.
Herald added subscribers: cfe-commits, klimek.

Currently, indentation of Objective-C method names which are wrapped
onto the next line due to a long return type is controlled by the
style option `IndentWrappedFunctionNames`.

For the Google style, we'd like to indent Objective-C method names
when wrapped onto the next line, but *not* indent non-Objective-C
functions when wrapped onto the next line.

This diff adds a new style option, `IndentWrappedObjCMethodNames`,
with three options:

1. Auto: Keep current behavior (indent ObjC methods according to

`IndentWrappedFunctionNames`)

2. Always: Always indent wrapped ObjC methods

3. Never: Never indent wrapped ObjC methods

In a separate diff, I'll update the Google style to set
`IndentWrappedFunctionNames` to `Always`.

Test Plan: Tests updated. Ran tests with:

  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests


Repository:
  rC Clang

https://reviews.llvm.org/D45004

Files:
  include/clang/Format/Format.h
  lib/Format/ContinuationIndenter.cpp
  lib/Format/Format.cpp
  unittests/Format/FormatTestObjC.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45004.140153.patch
Type: text/x-patch
Size: 7859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180328/5f89f0b6/attachment.bin>


More information about the cfe-commits mailing list