[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-07-24 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D148131#4447426 , @owenpan wrote: > In D148131#4304960 , @jp4a50 wrote: > >> Hey @MyDeveloperDay @owenpan . I'd appreciate if you guys have time to >> consider this change. It's the las

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-25 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. jp4a50 requested review of this revision. Fixes a long-standing bug: https://github.com/llvm/llvm-proj

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-07-25 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. @owenpan I've put up a patch for the bug you mentioned here: https://reviews.llvm.org/D156259 I'll rebase this change on top of that if you like the look of it. It should be fairly trivial to do. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-26 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 544308. jp4a50 added a comment. Address minor review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/docs/ReleaseNotes.rst clang/lib/Format/

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-26 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 2 inline comments as done. jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:263 State.StartOfStringLiteral = 0; + State.NoLineBreak = false; State.StartOfLineLevel = 0; HazardyKnusperkeks wrote: > Was this u

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-26 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 544310. jp4a50 added a comment. Format files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/docs/ReleaseNotes.rst clang/lib/Format/ContinuationInden

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:664-666 +if ((Style.Language == FormatStyle::LK_Cpp || + Style.Language == FormatStyle::LK_ObjC) && +!Current.is(tok::comment) && PrevNonComment && HazardyKnus

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-22 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 552401. jp4a50 added a comment. Minor refactoring and comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/lib/Format/ContinuationIndenter.cpp cl

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-22 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 552403. jp4a50 added a comment. Minor refactor. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/lib/Format/ContinuationIndenter.cpp clang/lib/Format/C

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-22 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 4 inline comments as done. jp4a50 added a comment. Addressed all comments. Please let me know if there's anything else required before merging. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D15625

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-23 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 552701. jp4a50 added a comment. Minor refactoring. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/lib/Format/ContinuationIndenter.cpp clang/lib/Forma

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-23 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked an inline comment as done. jp4a50 added a comment. @owenpan right you are! Missed those somehow. Made a further two changes. Hope I haven't missed anything else! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://revie

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 545594. jp4a50 added a comment. Refactor DisallowLineBreaksOnThisLine lambda. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/docs/ReleaseNotes.rst cl

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 3 inline comments as done. jp4a50 added a comment. All comments addressed. PTAL and let me know if there are any other blockers for merge. Comment at: clang/lib/Format/ContinuationIndenter.cpp:664-666 +if ((Style.Language == FormatStyle::LK_Cpp || + S

[PATCH] D156259: Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-07-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 545622. jp4a50 marked an inline comment as done. jp4a50 added a comment. Formatting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/docs/ReleaseNotes.r

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-01 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:657-666 + bool DisallowLineBreaksOnThisLine = [&Style = this->Style, &Current] { +// Deal with lambda arguments in C++. The aim here is to ensure that we +// don't over-indent lambda func

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-01 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 546002. jp4a50 added a comment. More CR feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/docs/ReleaseNotes.rst clang/lib/Format/ContinuationI

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-08-01 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 546004. jp4a50 added a comment. Stack diff on top of https://reviews.llvm.org/D156259. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ https://reviews.llvm.org/D148131 Files: clang/docs/ReleaseNotes

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-03 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 546972. jp4a50 added a comment. Format files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259 Files: clang/docs/ReleaseNotes.rst clang/lib/Format/ContinuationInden

[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

2023-08-03 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. @HazardyKnusperkeks could you merge this for me assuming the build is green please? I don't have merge rights. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156259/new/ https://reviews.llvm.org/D156259

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-09-08 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 556262. jp4a50 added a comment. Minor review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ https://reviews.llvm.org/D148131 Files: clang/lib/Format/ContinuationIndenter.cpp clang/unitt

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-09-08 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 2 inline comments as done. jp4a50 added a comment. Thanks all. All comments addressed now. Please merge for me once ready. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ https://reviews.llvm.org/D148131 ___

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-08-25 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Hello @owenpan , @HazardyKnusperkeks . Now that https://reviews.llvm.org/D156259 is merged, please can you take a look at this change? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ https://reviews.llvm.org/D148

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-08-30 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 554704. jp4a50 added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ https://reviews.llvm.org/D148131 Files: clang/lib/Format/ContinuationIndenter.cpp clang/uni

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-08-30 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 6 inline comments as done. jp4a50 added a comment. All comments addressed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ https://reviews.llvm.org/D148131 ___ cfe-commits mailing

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-09-01 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D148131#4628719 , @HazardyKnusperkeks wrote: > But please wait for other opinions. OK sure. @owenpan, any thoughts? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148131/new/ ht

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 505264. jp4a50 added a comment. Add new code sample to demonstrate behaviour of "LambdaBodyIndentation: OuterScope" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042 Fi

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 created this revision. Herald added a project: All. jp4a50 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The option allows users to specify how many columns to use to indent designated initializers that start on a new line. Repos

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 505302. jp4a50 added a comment. Apply clang-format. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/Releas

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:2704 + +**DesignatedInitializerIndentWidth** (``Unsigned``) + The number of columns to use to indent designated initializers that start on a new line. Perhaps it would be better to

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D146042#4195295 , @owenpan wrote: >> The previous implementation of the option involved a hack which corrupted >> the parenthesis state stack. > > Can you link the review (e.g. `Dnn`) of the previous implementation in > th

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3540 + someMethod(someOtherMethod( + [](SomeReallyLongLambdaSignatureArgument foo) { MyDeveloperDay wrote: > This code may come from Format.h Sorry, I'm not sure I

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3540 + someMethod(someOtherMethod( + [](SomeReallyLongLambdaSignatureArgument foo) { jp4a50 wrote: > MyDeveloperDay wrote: > > This code may come from Format.h > So

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 505449. jp4a50 added a comment. Update OuterScope docs in Format.h and regenerate public docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042 Files: clang/docs/Clan

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/Format.cpp:1372 LLVMStyle.DerivePointerAlignment = false; + LLVMStyle.DesignatedInitializerIndentWidth = 4; LLVMStyle.DisableFormat = false; MyDeveloperDay wrote: > so lets say someone is using an

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 505540. jp4a50 added a comment. Change DesignatedInitializerIndentWidth to a signed integer which defaults to ContinuationIndentWidth when set to -1. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ ht

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-15 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 2 inline comments as done. jp4a50 added inline comments. Comment at: clang/lib/Format/Format.cpp:1372 LLVMStyle.DerivePointerAlignment = false; + LLVMStyle.DesignatedInitializerIndentWidth = 4; LLVMStyle.DisableFormat = false; jp4a50 wrote: >

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-17 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D146101#4195293 , @owenpan wrote: > Please see > https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options. > Is there a way to fix the issue without adding a new option? @owenpan We could simpl

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-17 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. All comments addressed so bump on review please :) Also, a build has failed but I don't think my changes caused it - it looks like an old version of clang

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-19 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D146042#4204513 , @owenpan wrote: > Looks like this patch doesn't put the opening brace at the outerscope for > some of the examples from the linked github issues: > > $ cat .clang-format > AllowShortLambdasOnASingleLine: N

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-19 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. > The style guide doesn't mention indenting designated initializers with 2 > spaces? That is a fair point. I will get it updated because the author and maintainer of that style guide is the one requesting this change since, in practice, codebases following this style gu

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-22 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D146101#4208962 , @MyDeveloperDay wrote: > What I'd really like to see, is... in the event that > `ContinuationIndentWidth` is set and I do NOTset > `DesignatedInitializerIndentWidth` , then > `DesignatedInitializerIndentW

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-22 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:21918-21927 + verifyFormat("Result doSomething(Promise promise) {\n" + " return promise.then(\n" + " [this, obj = std::move(s)](int evaluated) mutable {\n" +

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 508740. jp4a50 added a comment. Address minor review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 Files: clang/docs/ClangFormatStyleOptions.rst clang/

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked an inline comment as done. jp4a50 added a comment. All actionable comments have been addressed. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth <

[PATCH] D146995: [clang-format] Refactor unit tests for "LambdaBodyIndentation: OuterScope" option.

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 created this revision. Herald added a project: All. jp4a50 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The changes: - make the tests more concise - fix invalid C++ in the code samples - ensure line breaks in tests' code samples

[PATCH] D146995: [clang-format] Refactor unit tests for "LambdaBodyIndentation: OuterScope" option.

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:21978 Style); - EXPECT_EQ("SomeResult doSomething(SomeObject promise) {\n" -" return promise.then(\n" The refactored version of these test cases has been

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 508762. jp4a50 added a comment. Rebase diff on top of D146995 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042 Files: clang/docs/C

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:21952 "}", Style); + verifyFormat("void test() {\n" MyDeveloperDay wrote: > I feel like lots of these test changes could be made on their own, BEFORE

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 508765. jp4a50 added a comment. Re-enable OuterScope lambda body indentation of lambdas in namespace scope statements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-27 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. I've removed the special-casing that I added for namespace scope statements. If I make those changes at all, I'll raise them as a follow up diff. Comment at: clang/unittests/Format/FormatTest.cpp:21953 - verifyFormat("std::sort(v.begin(), v.end(),\n" -

[PATCH] D146995: [clang-format][NFC] Refactor unit tests for "LambdaBodyIndentation: OuterScope" option.

2023-03-28 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. If you guys are happy with this, could you please merge it for me? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146995/new/ https://reviews.llvm.org/D146995 ___ cfe-commits maili

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-28 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth < 0 + ? Style.ContinuationIndentWidth + : Style.Designate

[PATCH] D146995: [clang-format][NFC] Refactor unit tests for "LambdaBodyIndentation: OuterScope" option.

2023-03-28 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. > You need to state a name and email for the commit. Name: Jon Phillips Email: jonap2...@gmail.com Also, thanks for relating the child diff to this one. I couldn't see how to do it at first but have seen the option now. Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-29 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1665-1669 + const auto DesignatedInitializerIndentWidth = + Style.DesignatedInitializerIndentWidth < 0 + ? Style.ContinuationIndentWidth + : Style.Designate

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 created this revision. Herald added a subscriber: mgrang. Herald added a project: All. jp4a50 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The previous implementation of the option involved a hack which corrupted the parenthesis s

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1132 + State.NextToken->is(TT_LambdaLBrace) && State.Line && + State.Line->Level != 0)) { + return State.FirstIndent; Note that we do not apply "OuterScope" b

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-30 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. So at the risk of adding to the number of decisions we need to come to a consensus on, I was about to update the KJ style guide to explicitly call out the difference in indentation for designated initializers when I realized that we (both KJ code authors and clang-format

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 509982. jp4a50 added a comment. Replace DesignatedInitializerIndentWidth with BracedInitializerIndentWidth which applies to a broader range of initializers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/n

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. I've implemented BracedInitializerIndentWidth now with significantly extended test coverage (including checking that it is not applied *too* broadly). The actual implementation is just as simple as that for `DesignatedInitializerIndentWidth`. > For the yaml stuff, I for

[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

2023-03-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/docs/tools/dump_format_style.py:72 - subtype, napplied = re.subn(r'^std::vector<(.*)>$', r'\1', typestr) - if napplied == 1: -return 'List of ' + pluralize(to_yaml_type(subtype)) + match = re.match(r'std::vector<(.*)>$', ty

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-03-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/include/clang/Format/Format.h:949 + /// If unset, ``ContinuationIndentWidth`` is used. + /// \code + /// AlignAfterOpenBracket: AlwaysBreak MyDeveloperDay wrote: > did you check generating the html from the rst

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-03-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 510022. jp4a50 added a comment. Alphabetical ordering. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/Rel

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-03-31 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Could I get a re-review on this one please? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D147556: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-04 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. jp4a50 requested review of this revision. The option allows users to specify how many columns to use t

[PATCH] D147556: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-04 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 abandoned this revision. jp4a50 added a comment. Sorry - this is a duplicate of https://reviews.llvm.org/D146101 created by accident. Closing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147556/new/ https://reviews.llvm.org/D147556 _

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-04 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 510886. jp4a50 added a comment. Minor review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/Rel

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-04 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/include/clang/Format/Format.h:949 + /// If unset, ``ContinuationIndentWidth`` is used. + /// \code + /// AlignAfterOpenBracket: AlwaysBreak owenpan wrote: > HazardyKnusperkeks wrote: > > jp4a50 wrote: > > > MyD

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-04-04 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 510901. jp4a50 added a comment. Tidy up docs and tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042 Files: clang/docs/ClangFormatStyleOptions.rst clang/include

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-04-04 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 2 inline comments as done. jp4a50 added a comment. In D146042#4239182 , @owenpan wrote: > In D146042#4204651 , @jp4a50 wrote: > >> I'm confident that the patch will indent all those examples correctl

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-04-05 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 511098. jp4a50 added a comment. Add release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146042/new/ https://reviews.llvm.org/D146042 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/ReleaseN

[PATCH] D146042: [clang-format] Fix numerous issues with "LambdaBodyIndentation: OuterScope" option

2023-04-05 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Thanks for accepting! Commit details as follows as per previous diff: Name: Jon Phillips Email: jonap2...@gmail.com If someone could commit for me that would be much appreciated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-05 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Following on from our discussion about new options needing motivation from public style guides, I've updated the KJ style guide to clarify its stance on braced init lists: https://github.com/capnproto/capnproto/blob/master/style-guide.md#spacing-and-bracing Repository:

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-06 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 4 inline comments as done. jp4a50 added a comment. Just FYI this is ready for review again. I believe I've addressed all comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 ___

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-07 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 marked 29 inline comments as done. jp4a50 added a comment. Marked comments as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 ___ cfe-commits maili

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-12 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Ping for review again plz. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-12 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D146101#4261293 , @MyDeveloperDay wrote: > If all comments and concerns are done, then I'm inclined to accept, but I'd > like @owenpan and @HazardyKnusperkeks to give their opinion before we land > this. Sure. Thanks! ==

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-04-12 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. jp4a50 requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-04-12 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:333 + // enabled. + !(Current.is(TT_LambdaLBrace) && Style.BraceWrapping.BeforeLambdaBody) && CurrentState.NoLineBreakInOperand) { AFAICT, this only matters when

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-14 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Commit details as follows as per other diffs: Name: Jon Phillips Email: jonap2...@gmail.com Would appreciate someone committing for me. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D14

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-28 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 updated this revision to Diff 517868. jp4a50 added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146101/new/ https://reviews.llvm.org/D146101 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/ReleaseNotes.rst

[PATCH] D146101: [clang-format] Add BracedInitializerIndentWidth option.

2023-04-28 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. In D146101#4270509 , @owenpan wrote: > In D146101#4268487 , @jp4a50 wrote: > >> Would appreciate someone committing for me. > > Can you rebase it? I got a conflict in ReleaseNotes.rst. @ow

[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

2023-04-28 Thread Jon Phillips via Phabricator via cfe-commits
jp4a50 added a comment. Hey @MyDeveloperDay @owenpan . I'd appreciate if you guys have time to consider this change. It's the last significant issue my team and I are tracking that's blocking our adoption of clang-format for multiple codebases that use KJ