summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-02-20 12:43:41 +0000
committerDaniel Jasper <djasper@google.com>2017-02-20 12:43:41 +0000
commit3d934d366ea84054e5c5693793e2035e6187a28a (patch)
treedf22f7af1e12678b742bf8c2b83fd64340f7f242 /clang/unittests/Format/FormatTestJS.cpp
parent19b35bf7f44d253e9e95a0cf1e0862bae891836d (diff)
downloadbcm5719-llvm-3d934d366ea84054e5c5693793e2035e6187a28a.tar.gz
bcm5719-llvm-3d934d366ea84054e5c5693793e2035e6187a28a.zip
clang-format: [JS/TS] Improve detection for array subscripts in types.
Before: var someValue = (v as aaaaaaaaaaaaaaaaaaaa<T>[ ]).someFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: var someValue = (v as aaaaaaaaaaaaaaaaaaaa<T>[]) .someFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 295658
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 4038e512590..ffd443cc3d7 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1095,6 +1095,9 @@ TEST_F(FormatTestJS, TypeAnnotations) {
verifyFormat("function someFunc(args: string[]):\n"
" {longReturnValue: string[]} {}",
getGoogleJSStyleWithColumns(60));
+ verifyFormat(
+ "var someValue = (v as aaaaaaaaaaaaaaaaaaaa<T>[])\n"
+ " .someFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
}
TEST_F(FormatTestJS, UnionIntersectionTypes) {
OpenPOWER on IntegriCloud