This revision was automatically updated to reflect the committed changes.
Closed by commit rC331857: [clang-format] Respect BreakBeforeClosingBrace while
calculating length (authored by krasimir, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46519?vs=145677=145881#toc
krasimir marked an inline comment as done.
krasimir added inline comments.
Comment at: lib/Format/ContinuationIndenter.cpp:93
+ break;
+if (End->Next->is(tok::r_brace)) {
+ const ParenState *State = FindParenState(End->Next->MatchingParen);
djasper
krasimir updated this revision to Diff 145677.
krasimir added a comment.
- Added other parens detection
Repository:
rC Clang
https://reviews.llvm.org/D46519
Files:
lib/Format/ContinuationIndenter.cpp
lib/Format/ContinuationIndenter.h
lib/Format/UnwrappedLineFormatter.cpp
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Generally looks good.
Comment at: lib/Format/ContinuationIndenter.cpp:93
+ break;
+if (End->Next->is(tok::r_brace)) {
+ const ParenState *State =
krasimir marked an inline comment as done and an inline comment as not done.
krasimir added inline comments.
Comment at: lib/Format/ContinuationIndenter.cpp:44
+ int MatchingStackIndex = Stack.size() - 1;
+ while (MatchingStackIndex >= 0 && Stack[MatchingStackIndex].Tok != )
+
krasimir updated this revision to Diff 145661.
krasimir marked 2 inline comments as done.
krasimir added a comment.
- Address review comments
Repository:
rC Clang
https://reviews.llvm.org/D46519
Files:
lib/Format/ContinuationIndenter.cpp
lib/Format/ContinuationIndenter.h
djasper added inline comments.
Comment at: lib/Format/ContinuationIndenter.cpp:44
+ int MatchingStackIndex = Stack.size() - 1;
+ while (MatchingStackIndex >= 0 && Stack[MatchingStackIndex].Tok != )
+--MatchingStackIndex;
I think this needs a long
krasimir created this revision.
Herald added subscribers: cfe-commits, klimek.
This patch makes `getLengthToMatchingParen` respect the
`BreakBeforeClosingBrace`
ParenState for matching scope closers. In order to distinguish between paren
states
introduced by real vs. fake parens, I've added the