changeset 30533:4f6c0ca7530b v9.0.0602

patch 9.0.0602: new TypeScript extensions are not recognized Commit: https://github.com/vim/vim/commit/7fc6c0e4dab4e80b9806a973936af54276468513 Author: rhysd <lin90162@yahoo.co.jp> Date: Tue Sep 27 11:57:13 2022 +0100 patch 9.0.0602: new TypeScript extensions are not recognized Problem: New TypeScript extensions are not recognized. Solution: Recognize .mts and .cts files. (closes https://github.com/vim/vim/issues/11237)
author Bram Moolenaar <Bram@vim.org>
date Tue, 27 Sep 2022 13:00:05 +0200
parents e8bb811789c1
children e2cfe68129e6
files runtime/filetype.vim src/testdir/test_filetype.vim src/version.c
diffstat 3 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -770,8 +770,8 @@ au BufNewFile,BufRead gitolite.conf		set
 au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc	setf perl
 
 " Glimmer-flavored TypeScript and JavaScript
-au BufNewFile,BufRead *.gts	setf typescript.glimmer
-au BufNewFile,BufRead *.gjs	setf javascript.glimmer
+au BufNewFile,BufRead *.gts			setf typescript.glimmer
+au BufNewFile,BufRead *.gjs			setf javascript.glimmer
 
 " Gnuplot scripts
 au BufNewFile,BufRead *.gpi,.gnuplot		setf gnuplot
@@ -2086,7 +2086,7 @@ au BufNewFile,BufRead *.tsv			setf tsv
 " TWIG files
 au BufNewFile,BufReadPost *.twig		setf twig
 
-" Typescript or Qt translation file (which is XML)
+" TypeScript or Qt translation file (which is XML)
 au BufNewFile,BufReadPost *.ts
 	\ if getline(1) =~ '<?xml' |
 	\   setf xml |
@@ -2094,6 +2094,9 @@ au BufNewFile,BufReadPost *.ts
 	\   setf typescript |
 	\ endif
 
+" TypeScript module and common
+au BufNewFile,BufRead *.mts,*.cts		setf typescript
+
 " TypeScript with React
 au BufNewFile,BufRead *.tsx			setf typescriptreact
 
@@ -2285,7 +2288,7 @@ au BufNewFile,BufRead *.fsproj,*.fsproj.
 au BufNewFile,BufRead *.vbproj,*.vbproj.user	setf xml
 
 " Qt Linguist translation source and Qt User Interface Files are XML
-" However, for .ts Typescript is more common.
+" However, for .ts TypeScript is more common.
 au BufNewFile,BufRead *.ui			setf xml
 
 " TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -584,6 +584,7 @@ let s:filename_checks = {
     \ 'tssop': ['file.tssop'],
     \ 'tsv': ['file.tsv'],
     \ 'twig': ['file.twig'],
+    \ 'typescript': ['file.mts', 'file.cts'],
     \ 'typescript.glimmer': ['file.gts'],
     \ 'typescriptreact': ['file.tsx'],
     \ 'uc': ['file.uc'],
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    602,
+/**/
     601,
 /**/
     600,