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

2018-04-06 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Ok, you know the ObjC community much better than I do. If you think that adding the indentation for ObjC irrespective of the option works for most people, I am happy to go with it. Repository: rC Clang https://reviews.llvm.org/D45004

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

2018-04-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > By default, Xcode has a "Line wrapping" setting Ah, that appears to just be a visual thing. Xcode doesn't actually insert newlines into the source code. Repository: rC Clang https://reviews.llvm.org/D45004 ___

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

2018-04-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. Actually, a slight correction. By default, Xcode has a "Line wrapping" setting under Preferences -> Text editing which says: [ X ] Wrap lines to editor width Indent wrapped lines by: [4 ] Spaces which suggests people using Xcode may expect indentation

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

2018-04-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > A FormatStyle already contains a reference to the FormatStyleSet it was > created from and you can get the FormatStyle for a different language through > that. It might just be a bit hacky and not easy to understand as is, but > maybe there are easy abstractions

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

2018-04-05 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I'd go to great lengths to avoid adding new config options and so I don't think this would be a bad trade-off to make. Also, note that you might not actually have to change much. A FormatStyle already contains a reference to the FormatStyleSet it was created from and

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

2018-04-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > a user sets the existing IndentWrappedFunctionNames to true for ObjC and to > false for C++. > Now IMO, that should mean that ObjC function names are indented and C++ > functions are not, even if the language of the *file* is ObjC. > Getting this right will

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

2018-04-05 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I still really believe that these config options do no make sense and are actively confusing. I see two options: - We leave this as is - We fix this right The right fix here is (IMO) that a style already is per language and thus already has a member specifying the

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

2018-04-05 Thread Jacek Olesiak via Phabricator via cfe-commits
jolesiak added a comment. > I am proposing to update the Google Objective-C style guide to explicitly > describe the desired indentation behavior. +1 Repository: rC Clang https://reviews.llvm.org/D45004 ___ cfe-commits mailing list

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

2018-04-04 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. Update: I am proposing to update the Google Objective-C style guide to explicitly describe the desired indentation behavior. Comment at: include/clang/Format/Format.h:1154-1163 + /// \brief The style of indenting long function or method names

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

2018-03-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > Well, I disagree. It says: "If you break after the return type of a function > declaration or definition, do not indent." Great, thanks for clarifying! Repository: rC Clang https://reviews.llvm.org/D45004 ___

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

2018-03-29 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Well, I disagree. It says: "If you break after the return type of a function declaration or definition, do not indent." Repository: rC Clang https://reviews.llvm.org/D45004 ___ cfe-commits mailing list

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

2018-03-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added a comment. > Do we have a public style guide that explicitly says to do this? Good question! This was the result of internal discussion with the Google Objective-C style guide maintainers based on analysis of ObjC code at Google.

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

2018-03-29 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton marked an inline comment as done. benhamilton added inline comments. Comment at: include/clang/Format/Format.h:1154-1163 + /// \brief The style of indenting long function or method names wrapped + /// onto the next line. + enum IndentWrappedMethodStyle { +///

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

2018-03-29 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Do we have a public style guide that explicitly says to do this? That's a requirement for new style options as per https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options. Also, are we sure that somebody wants the other behavior? Does

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

2018-03-28 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added inline comments. Comment at: include/clang/Format/Format.h:1154-1163 + /// \brief The style of indenting long function or method names wrapped + /// onto the next line. + enum IndentWrappedMethodStyle { +/// Automatically determine indenting style. +

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

2018-03-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > What do you think of the name IndentWrappedObjCMethodSignatures as an > alternative to IndentWrappedObjCMethodNames? In Objective-C the method name > might be considered the selector whereas I believe that this option pertains > to formatting of the method

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

2018-03-28 Thread Stephane Moore via Phabricator via cfe-commits
stephanemoore added a comment. What do you think of the name `IndentWrappedObjCMethodSignatures` as an alternative to `IndentWrappedObjCMethodNames`? In Objective-C the method name might be considered the selector whereas I believe that this option pertains to formatting of the method

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

2018-03-28 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 140155. benhamilton added a comment. Fix typo 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 Index:

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

2018-03-28 Thread Ben Hamilton via Phabricator via cfe-commits
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