Now a block gets recognized as a block if it contains a block.
The special cases we added don't have additional tests because they
are already tested for example in FormatTest.FormatsLambdas and
FormatTestJS.ContainerLiterals.
Paths
| Differential D150452
[clang-format] Recognize nested blocks AbandonedPublic Authored by sstwcw on May 12 2023, 8:37 AM.
Details Summary Now a block gets recognized as a block if it contains a block. The special cases we added don't have additional tests because they
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptMay 12 2023, 8:37 AM Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. · View Herald Transcript Comment Actions Coincidentally I also sent out a review to fix this issue yesterday, but went with a different approach of trying to scope the ProbablyBracedList logic by just looking at the lbrace previous token. Comment Actions On this change I like the token annotator tests, and reusing the same stack instead of adding a second one which always has the same size.
Revision Contents
Diff 521660 clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/TokenAnnotatorTest.cpp
|
Shouldn't it be called NextBraceIsProbablyLambda (or similar)?