summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/typescript.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
commitaed8ce9da277f5ecffe968b324f242c41c3b752a (patch)
treed2e538394cb7a8a7c42a4aac6ccf1a8e3256999b /runtime/syntax/typescript.vim
parentInitial commit. (diff)
downloadvim-aed8ce9da277f5ecffe968b324f242c41c3b752a.tar.xz
vim-aed8ce9da277f5ecffe968b324f242c41c3b752a.zip
Adding upstream version 2:9.0.1378.upstream/2%9.0.1378upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/typescript.vim')
-rw-r--r--runtime/syntax/typescript.vim47
1 files changed, 47 insertions, 0 deletions
diff --git a/runtime/syntax/typescript.vim b/runtime/syntax/typescript.vim
new file mode 100644
index 0000000..af71938
--- /dev/null
+++ b/runtime/syntax/typescript.vim
@@ -0,0 +1,47 @@
+" Vim syntax file
+" Language: TypeScript
+" Maintainer: Bram Moolenaar, Herrington Darkholme
+" Last Change: 2019 Nov 30
+" Based On: Herrington Darkholme's yats.vim
+" Changes: Go to https:github.com/HerringtonDarkholme/yats.vim for recent changes.
+" Origin: https://github.com/othree/yajs
+" Credits: Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck
+" (This file is based on their hard work), gumnos (From the #vim
+" IRC Channel in Freenode)
+
+" This is the same syntax that is in yats.vim, but:
+" - flattened into one file
+" - HiLink commands changed to "hi def link"
+" - Setting 'cpo' to the Vim value
+
+if !exists("main_syntax")
+ if exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'typescript'
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" this region is NOT used in TypeScriptReact
+" nextgroup doesn't contain objectLiteral, let outer region contains it
+syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
+ \ start=/< \@!/ end=/>/
+ \ contains=@typescriptType
+ \ nextgroup=@typescriptExpression
+ \ contained skipwhite oneline
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""
+" Source the part common with typescriptreact.vim
+source <sfile>:h/shared/typescriptcommon.vim
+
+
+let b:current_syntax = "typescript"
+if main_syntax == 'typescript'
+ unlet main_syntax
+endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save