summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-03-11 14:58:38 +0000
committerDaniel Jasper <djasper@google.com>2015-03-11 14:58:38 +0000
commit8c68a64ec847fc7ebe2fc5ad4410f6c84b02cddc (patch)
tree01e2d68122c4f5f155211d008c6767339aac00d9 /clang/lib/Format
parent580defbbaedeada88963b93435f10a45db5b9eee (diff)
downloadbcm5719-llvm-8c68a64ec847fc7ebe2fc5ad4410f6c84b02cddc.tar.gz
bcm5719-llvm-8c68a64ec847fc7ebe2fc5ad4410f6c84b02cddc.zip
clang-format: Recognize the .ts (TypeScript) extension as JavaScript.
Patch by Martin Probst. Thank you. llvm-svn: 231926
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/Format.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index d312e8d86e9..a243a1f3157 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1528,7 +1528,8 @@ const char *StyleOptionHelpDescription =
static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) {
if (FileName.endswith(".java")) {
return FormatStyle::LK_Java;
- } else if (FileName.endswith_lower(".js")) {
+ } else if (FileName.endswith_lower(".js") || FileName.endswith_lower(".ts")) {
+ // JavaScript or TypeScript.
return FormatStyle::LK_JavaScript;
} else if (FileName.endswith_lower(".proto") ||
FileName.endswith_lower(".protodevel")) {
OpenPOWER on IntegriCloud