[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked an inline comment as done. gedare added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:773-792 if ((Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak || Style.AlignAfterOpenBracket == FormatStyle::BAS_BlockIndent) &&

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 558069. gedare added a comment. Use cameLCAse in test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files: clang/lib/Format/ContinuationIndenter.cpp clang/unitte

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25814-25824 + " if (quitelongname < alsolongname ||\n" + " anotherevenlongername <=\n" + " thisreallyreallyreallyreallyreallyreallylongername

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:773-792 if ((Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak || Style.AlignAfterOpenBracket == FormatStyle::BAS_BlockIndent) && (Previous.isOneOf(tok::l_paren, TT_Te

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. @MyDeveloperDay ping I have rebased to main without any problems. This patch fixes the bug. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 ___

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 558063. gedare added a comment. Rebase to main Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files: clang/lib/Format/ContinuationIndenter.cpp clang/unittests/For

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked 3 inline comments as done. gedare added a comment. I have fixed the bug in a different way that avoids using `BlockIndent` on `if` conditionals. `AlwaysBreak` will continue to apply to `if` conditionals by default. I may propose a style option to control that behavior later. Repo

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542625. gedare added a comment. Do not apply BlockIndent to if conditionals. Address other comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files: clang/lib

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. I guess since the current behavior does not treat `if` with block indentation, this bug fix should instead prefer to maintain the current behavior, and if someone wants to have block indentation of `if` it would need to be added as a new style option. Otherwise, this wil

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25504 + +#if 0 verifyFormat("if (quitelongarg !=\n" MyDeveloperDay wrote: > we don't do this. OK, I'll move that other bug up my priority list, as the behavior of this test case i

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay requested changes to this revision. MyDeveloperDay added inline comments. This revision now requires changes to proceed. Comment at: clang/unittests/Format/FormatTest.cpp:25504 + +#if 0 verifyFormat("if (quitelongarg !=\n" we don't do this. ==

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. It looks like this was added in D109557: Adds a BlockIndent option to AlignAfterOpenBracket I'm trying to understand what bad stuff happens if you remove the "if" from `return !(Previous && Previous->is(tok::kw_for));` Reposit

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25486 "comment\n" - " return;\n" "}", MyDeveloperDay wrote: > Why remove? oops. that's a spurious change. I have reverted it. Reposito

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 541813. gedare marked an inline comment as done. gedare added a comment. Revert deleted line in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files: clang/li

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-17 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25486 "comment\n" - " return;\n" "}", Why remove? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-07 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Although I chose to preserve the existing behavior of `AlwaysBreak` and to mimic it for `BlockIndent`, I think it would be best to choose a consistent approach and document it. I also have a patch that does not apply the AlignAfterOpenBracket for if clauses, which could

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-07 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. A bug with BlockIndent prevents line breaks within if (and e