hanchenye-llvm-project/clang/unittests/Format
Krasimir Georgiev 9163fe2aba [clang-format] Use number of unwrapped lines for short namespace
Summary:
This patch makes the namespace comment fixer use the number of unwrapped lines
that a namespace spans to detect it that namespace is short, thus not needing
end comments to be added.
This is needed to ensure clang-format is idempotent. Previously, a short namespace
was detected by the original source code lines. This has the effect of requiring two
runs for this example:
```
namespace { class A; }
```
after first run:
```
namespace {
class A;
}
```
after second run:
```
namespace {
class A;
} // namespace
```

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 296736
2017-03-02 09:54:44 +00:00
..
CMakeLists.txt [clang-format] Add a NamespaceEndCommentsFixer 2017-02-27 13:28:36 +00:00
CleanupTest.cpp [clang-format] revert an unintended change in r288493 and add a test case. 2016-12-19 10:41:05 +00:00
FormatTest.cpp [clang-format] Use number of unwrapped lines for short namespace 2017-03-02 09:54:44 +00:00
FormatTestComments.cpp Fix r296605 so that stuff in #ifndef SWIG blocks is still formatted. 2017-03-01 11:10:11 +00:00
FormatTestJS.cpp clang-format: [JS] Properly format object literals with shorthands. 2017-03-01 19:47:28 +00:00
FormatTestJava.cpp clang-format: [Java] Fix bug in enum formatting. 2017-02-28 18:28:15 +00:00
FormatTestObjC.cpp clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle 2017-01-17 00:12:27 +00:00
FormatTestProto.cpp clang-format: [Proto] Also supports implicit string literal concatenation 2017-02-03 08:29:02 +00:00
FormatTestSelective.cpp [clang-format] Implement comment reflowing. 2017-01-25 13:58:58 +00:00
FormatTestUtils.h
NamespaceEndCommentsFixerTest.cpp [clang-format] Use number of unwrapped lines for short namespace 2017-03-02 09:54:44 +00:00
SortImportsTestJS.cpp clang-format: [JS] Fix line breaks before comments when sorting imports. 2016-09-19 07:02:34 +00:00
SortIncludesTest.cpp clang-format: Correctly calculate affected ranges when sorting #includes. 2016-08-30 21:33:41 +00:00