llvm-project/clang/unittests/Format
Manuel Klimek 0dddcf78b8 Format closing braces when reformatting the line containing the opening brace.
This required a couple of yaks to be shaved:
1. MatchingOpeningBlockLineIndex was misused to also store the
   closing index; instead, use a second variable, as this doesn't
   work correctly for "} else {".
2. We needed to change the API of AffectedRangeManager to not
   use iterators; we always passed in begin / end for the whole
   container before, so there was no mismatch in generality.
3. We need an extra check to discontinue formatting at the top
   level, as we now sometimes change the indent of the closing
   brace, but want to bail out immediately afterwards, for
   example:
     void f() {
       if (a) {
     }
     void g();
   Previously:
     void f() {
       if (a) {
     }
     void g();
   Now:
     void f() {
       if (a) {
       }
     void g();

Differential Revision: https://reviews.llvm.org/D45726

llvm-svn: 330573
2018-04-23 09:34:26 +00:00
..
CMakeLists.txt [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
CleanupTest.cpp Unittests misc. typos 2018-02-06 13:12:29 +00:00
FormatTest.cpp [clang-format] Don't remove empty lines before namespace endings 2018-04-19 13:02:15 +00:00
FormatTestComments.cpp [clang-format] In tests, expected code should be format-stable 2018-04-04 21:09:00 +00:00
FormatTestJS.cpp [clang-format] In tests, expected code should be format-stable 2018-04-04 21:09:00 +00:00
FormatTestJava.cpp [clang-format] In tests, expected code should be format-stable 2018-04-04 21:09:00 +00:00
FormatTestObjC.cpp [clang-format] Do not break after ObjC category open paren 2018-04-12 15:11:55 +00:00
FormatTestProto.cpp Revert "[clang-format] Improve Incomplete detection for (text) protos" 2018-04-23 08:50:36 +00:00
FormatTestRawStrings.cpp [clang-format] Fix raw string prefix penalty 2018-03-16 14:01:25 +00:00
FormatTestSelective.cpp Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
FormatTestTextProto.cpp Revert "[clang-format] Improve Incomplete detection for (text) protos" 2018-04-23 08:50:36 +00:00
FormatTestUtils.h clang-format: Add preprocessor directive indentation 2017-08-30 14:34:57 +00:00
NamespaceEndCommentsFixerTest.cpp clang-format: fix block OpeningLineIndex around preprocessor 2017-07-28 07:56:14 +00:00
SortImportsTestJS.cpp clang-format: [JS] support default imports. 2017-08-01 15:54:43 +00:00
SortIncludesTest.cpp [clang-format] Add option to group multiple #include blocks when sorting includes 2017-11-27 13:23:45 +00:00
UsingDeclarationsSorterTest.cpp [clang-format] Deduplicate using declarations 2017-11-24 18:00:01 +00:00