Set the explicitFileType of TypeScript files TypeScript files are not correctly recognized by Xcode and *.ts files do not display their contents. However, setting the explicitFileType key to `sourcecode.javascript` forces Xcode to render the file correctly and enables file editing. Change-Id: I3404a5d2e8423fad7e0d2ef832fc0d6476cb4b00 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/14000 Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
diff --git a/src/gn/xcode_object.cc b/src/gn/xcode_object.cc index a957c97..c9b69a3 100644 --- a/src/gn/xcode_object.cc +++ b/src/gn/xcode_object.cc
@@ -131,6 +131,7 @@ {"storyboard", "file.storyboard"}, {"strings", "text.plist.strings"}, {"swift", "sourcecode.swift"}, + {"ts", "sourcecode.javascript"}, {"ttf", "file"}, {"xcassets", "folder.assetcatalog"}, {"xcconfig", "text.xcconfig"}, @@ -152,7 +153,7 @@ } bool HasExplicitFileType(std::string_view ext) { - return ext == "dart"; + return ext == "dart" || ext == "ts"; } bool IsSourceFileForIndexing(std::string_view ext) {