620
|
1 " Vim syntax file
|
672
|
2 " Language: TypeScript
|
726
|
3 " Maintainer: Herrington Darkholme
|
|
4 " Last Change: 2024 May 24
|
672
|
5 " Based On: Herrington Darkholme's yats.vim
|
726
|
6 " Changes: Go to https://github.com/HerringtonDarkholme/yats.vim for recent changes.
|
672
|
7 " Origin: https://github.com/othree/yajs
|
|
8 " Credits: Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck
|
|
9 " (This file is based on their hard work), gumnos (From the #vim
|
|
10 " IRC Channel in Freenode)
|
|
11
|
|
12 " This is the same syntax that is in yats.vim, but:
|
|
13 " - flattened into one file
|
|
14 " - HiLink commands changed to "hi def link"
|
|
15 " - Setting 'cpo' to the Vim value
|
620
|
16
|
|
17 if !exists("main_syntax")
|
672
|
18 if exists("b:current_syntax")
|
620
|
19 finish
|
|
20 endif
|
672
|
21 let main_syntax = 'typescript'
|
620
|
22 endif
|
|
23
|
672
|
24 let s:cpo_save = &cpo
|
|
25 set cpo&vim
|
620
|
26
|
672
|
27 " this region is NOT used in TypeScriptReact
|
|
28 " nextgroup doesn't contain objectLiteral, let outer region contains it
|
|
29 syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
|
|
30 \ start=/< \@!/ end=/>/
|
|
31 \ contains=@typescriptType
|
|
32 \ nextgroup=@typescriptExpression
|
|
33 \ contained skipwhite oneline
|
620
|
34
|
|
35
|
672
|
36 """""""""""""""""""""""""""""""""""""""""""""""""""
|
|
37 " Source the part common with typescriptreact.vim
|
688
|
38 source <sfile>:h/shared/typescriptcommon.vim
|
620
|
39
|
|
40
|
|
41 let b:current_syntax = "typescript"
|
|
42 if main_syntax == 'typescript'
|
|
43 unlet main_syntax
|
|
44 endif
|
|
45
|
672
|
46 let &cpo = s:cpo_save
|
|
47 unlet s:cpo_save
|