diff options
author | Martin Probst <martin@probst.io> | 2017-04-26 12:36:49 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2017-04-26 12:36:49 +0000 |
commit | 90d2a6982477f868d43998e406b1c478189960de (patch) | |
tree | f902b63501ea4be603957d83b4c64e0db8ca79bd /unittests/Format/FormatTestJS.cpp | |
parent | 730d18e32166a9754539ffb3e8d6e0abc72228c3 (diff) |
clang-format: [JS/Java] ignore Objective-C constructs in JS & Java.
Summary:
Java and JavaScript support annotations and decorators, respectively, that use a leading "@" token. clang-format currently detects this as an Objective-C construct and applies special formatting, for example no whitespace around "=" operators. This change disables the distinction for Java and JavaScript, which leads to normal formatting of single line annotated and initialized properties.
Before:
class X {
@foo() bar=false;
}
After:
class X {
@foo() bar = false;
}
Reviewers: djasper, bkramer
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D32532
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index f7e605f31a..7886c4fe27 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -1239,6 +1239,9 @@ TEST_F(FormatTestJS, MetadataAnnotations) { "}"); verifyFormat("class X {}\n" "class Y {}"); + verifyFormat("class X {\n" + " @property() private isReply = false;\n" + "}\n"); } TEST_F(FormatTestJS, TypeAliases) { |