diff options
author | Nico Weber <thakis@chromium.org> | 2020-01-03 12:11:36 -0500 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2020-01-03 12:11:44 -0500 |
commit | ba3484c051b62a662c555200f4a03b2e8df8e094 (patch) | |
tree | d92c5fd944df55874dfbcc86d2b2cd85eb01670a /clang/unittests/Format/FormatTestJava.cpp | |
parent | 427ffa2cdbbc7337d903ba71823a7830fa92568d (diff) | |
download | llvm-ba3484c051b62a662c555200f4a03b2e8df8e094.zip llvm-ba3484c051b62a662c555200f4a03b2e8df8e094.tar.gz llvm-ba3484c051b62a662c555200f4a03b2e8df8e094.tar.bz2 |
[clang-format/java] format multiple qualified annotations on one declaration better
Before:
class Foo {
@CommandLineFlags
.Add
@Features.foo
public void test() {}
}
Now:
class Foo {
@Features.foo
@CommandLineFlags.Add
public void test() { }
}
See also https://crbug.com/1034115
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index a4936e0..5e73e4b 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -335,6 +335,14 @@ TEST_F(FormatTestJava, Annotations) { verifyFormat("@Annotation(\"Some\"\n" " + \" text\")\n" "List<Integer> list;"); + + verifyFormat( + "@Test\n" + "@Feature({\"Android-TabSwitcher\"})\n" + "@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})\n" + "@Features.EnableFeatures({FEATURE})\n" + "public void test(@Foo.bar(\"baz\") @Quux.Qoob int theFirstParaaaaam,\n" + " @Foo.bar(\"baz\") @Quux.Qoob int theSecondParaaaaaaaaaaaaaaaam) {}"); } TEST_F(FormatTestJava, Generics) { |