blob: 475cb8dae4aa8b09faf09670bfa925e8cba949ba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
" Vim syntax file
" Language: TypeScript
" Maintainer: Bram Moolenaar
" Last Change: 2019 Nov 17
" Based On: Herrington Darkholme's yats.vim
" Changes: See https:github.com/HerringtonDarkholme/yats.vim
" Credits: See yats.vim on github
" 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/typescriptcommon.vim
let b:current_syntax = "typescript"
if main_syntax == 'typescript'
unlet main_syntax
endif
let &cpo = s:cpo_save
unlet s:cpo_save
|