[PATCH] D33193: clang-format: [JS] for async loops.

2017-05-15 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added inline comments. This revision is now accepted and ready to land. Comment at: lib/Format/TokenAnnotator.cpp:583 Contexts.back().ColonIsForRangeExpr = true; + // for async ( ... + if (CurrentToken->is(Keywords.kw_async

[PATCH] D33238: [clang-format] Make NoLineBreakFormatter respect MustBreakBefore

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Are there cases where this makes a difference? If so, add a test. If not, add something to the patch description to clarify. Comment at: lib/Format/TokenAnnotator.cpp:2473

[PATCH] D32477: [clang-format] Allow customizing the penalty for breaking assignment

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Basically looks good, but please add a test case where the penalty is high show that it changes behavior. https://reviews.llvm.org/D32477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. The current behavior here is actually intended. If you'd like the other format, we probably need to add a style option. What style guide are you basing this on? Comment at: unittests/Format/FormatTest.cpp:2476 "bool value = a

[PATCH] D32479: [clang-format] Add BreakConstructorInitializersBeforeColon option

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Yes, turning that option into an enum seems like the better choice here. https://reviews.llvm.org/D32479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32480: [clang-format] Add BinPackNamespaces option

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:153 + /// \endcode + bool AllowSemicolonAfterNamespace; + While I am not entirely opposed to this feature, I think it should be a separate patch. Comment at: include/cl

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I have looked through the PDF you linked to, but I couldn't really find much about formatting. I have found one instance of a constructor initializer list, but there is no accompanying text saying that this is even intentional. Haven't found a range-based for loop. As s

[PATCH] D33029: [clang-format] add option for dangling parenthesis

2017-05-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:793 + /// \endcode + bool DanglingParenthesis; + stringham wrote: > djasper wrote: > > I don't think this is a name that anyone will intuitively understand. I > > understand that the nami

[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

2017-05-18 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. When you say "this doesn't happen in tests", do you mean this never happens when there are parentheses around the expression? Comment at: unittests/Format/FormatTest.cpp:2476 "bool value = a\n" -

[PATCH] D33314: clang-format: Add option to remove semicolon at end of namespace

2017-05-18 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Yes, this definitely does not belong in the NamespaceEndCommentsFixer. It has nothing to do with comments. And I am also very skeptical about several things: - Why start here? There are many places where semicolons could be cleaned up. - If we add more of such cleanup f

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-05-18 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:358 + /// \endcode + bool BinPackNamespaces; + Typz wrote: > djasper wrote: > > This is not bin packing at all. Maybe CompactNamespaces? Or > > SingleLineNamespaces? > > > > Also, could

[PATCH] D33314: clang-format: Add option to remove semicolon at end of namespace

2017-05-19 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I think we should just not do this for now. This addresses a very infrequent case that's easy enough to fix manually. As such, it's not worth the added complexity of clang-format and potential failures it might generate. Changing non-whitespace/non-comment code is alway

[PATCH] D33351: [clang-format] Handle trailing comment sections in import statement lines

2017-05-19 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. nice Comment at: lib/Format/ContinuationIndenter.cpp:590 1u, std::min(Current.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1)); +bool InPPDirective = +S

[PATCH] D32479: clang-format: Introduce BreakConstructorInitializers option

2017-05-22 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:699 + /// This option is **deprecated* and is retained for backwards compatibility. bool BreakConstructorInitializersBeforeComma; I don't think you need to keep this around. The YAML p

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-05-22 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:358 + /// \endcode + bool BinPackNamespaces; + Typz wrote: > djasper wrote: > > Typz wrote: > > > djasper wrote: > > > > This is not bin packing at all. Maybe CompactNamespaces? Or > > >

[PATCH] D33394: [clang-format] Keep trailing preprocessor line comments separate from the following section comments

2017-05-22 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:106 + isLineComment(*Token) && Token->NewlinesBefore == 1 && + Token->OriginalColumn == PreviousToken->OriginalColumn); } Any chance of moving this logic to d

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2017-05-22 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Hm, can't really remember what I meant by "my comment". Probably not important. So, I still see two problems: - I would not count the link you mentioned as a publicly accessible style guide. - I don't think the naming and granularity of this option is right. You specifi

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-05-22 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. What I mean is that you should remove the CompactNamespace option and instead let this be configured by an additional enum value in NamespaceIndentation. https://reviews.llvm.org/D32480 ___ cfe-commits mailing list cfe-comm

[PATCH] D33394: [clang-format] Keep trailing preprocessor line comments separate from the following section comments

2017-05-22 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added inline comments. This revision is now accepted and ready to land. Comment at: lib/Format/UnwrappedLineParser.cpp:106 + isLineComment(*Token) && Token->NewlinesBefore == 1 && + Token->OriginalColumn == PreviousT

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-05-23 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. That's what I meant by "The name NamespaceIndentation might then be a bit confusing, but not sure whether it's worth changing it.". I am honestly not sure. Let's get a third opinion. If we add this additional option, I think we need to fix the behavior and make what pe

[PATCH] D32479: clang-format: Introduce BreakConstructorInitializers option

2017-05-23 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:196 + FormatStyle::BCIS_AfterColonAndComma) && + (State.Column + State.Line->Last->TotalLength - Previous.TotalLength > + getColumnLimit(State) || Typz wrote:

[PATCH] D32479: clang-format: Introduce BreakConstructorInitializers option

2017-05-23 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:196 + FormatStyle::BCIS_AfterColonAndComma) && + (State.Column + State.Line->Last->TotalLength - Previous.TotalLength > + getColumnLimit(State) || Typz wrote:

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2017-05-23 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Don't C99 designated literals use "=" instead of ":"? https://reviews.llvm.org/D32525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5