diff options
| author | Krasimir Georgiev <krasimir@google.com> | 2017-03-08 08:55:12 +0000 |
|---|---|---|
| committer | Krasimir Georgiev <krasimir@google.com> | 2017-03-08 08:55:12 +0000 |
| commit | 17725d8391739cfb54e626336cdeb4843de5d5d2 (patch) | |
| tree | d64cbfd57efadce89a68e196dc5733fa6e61d27d /clang/unittests/Format/FormatTestJS.cpp | |
| parent | e0ec12984b6c37f640fa328abb81edb9f0d4eaf1 (diff) | |
| download | bcm5719-llvm-17725d8391739cfb54e626336cdeb4843de5d5d2.tar.gz bcm5719-llvm-17725d8391739cfb54e626336cdeb4843de5d5d2.zip | |
[clang-format] Enable comment reflowing in multiline comments containing pragmas
Summary:
This patch enables comment reflowing of lines not matching the comment pragma regex
in multiline comments containing comment pragma lines. Previously, these comments
were dumped without being reindented to the result.
Reviewers: djasper, mprobst
Reviewed By: mprobst
Subscribers: klimek, mprobst, cfe-commits
Differential Revision: https://reviews.llvm.org/D30697
llvm-svn: 297261
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index f45ec7356b3..23253cc2d60 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -1607,6 +1607,27 @@ TEST_F(FormatTestJS, JSDocAnnotations) { " * @param This is a long comment but no type\n" " */", getGoogleJSStyleWithColumns(20)); + // Don't break @param line, but reindent it and reflow unrelated lines. + verifyFormat("{\n" + " /**\n" + " * long long long\n" + " * long\n" + " * @param {this.is.a.long.path.to.a.Type} a\n" + " * long long long\n" + " * long long\n" + " */\n" + " function f(a) {}\n" + "}", + "{\n" + "/**\n" + " * long long long long\n" + " * @param {this.is.a.long.path.to.a.Type} a\n" + " * long long long long\n" + " * long\n" + " */\n" + " function f(a) {}\n" + "}", + getGoogleJSStyleWithColumns(20)); } TEST_F(FormatTestJS, RequoteStringsSingle) { @@ -1695,6 +1716,5 @@ TEST_F(FormatTestJS, ImportComments) { getGoogleJSStyleWithColumns(25)); verifyFormat("// taze: x from 'location'", getGoogleJSStyleWithColumns(10)); } - } // end namespace tooling } // end namespace clang |

