Skip to content

Commit 68ad7c0

Browse files
committed
Merge pull request #41 from Quramy/master
Add syntax highlight supports for Template Strings and Decorators
2 parents bef8dd5 + e25d712 commit 68ad7c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

syntax/typescript.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ syntax case match
5959
syn match typeScriptSpecial "\\\d\d\d\|\\."
6060
syn region typeScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typeScriptSpecial,@htmlPreproc
6161
syn region typeScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typeScriptSpecial,@htmlPreproc
62+
syn region typeScriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typeScriptSpecial,@htmlPreproc
6263

6364
syn match typeScriptSpecialCharacter "'\\.'"
6465
syn match typeScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
@@ -70,6 +71,8 @@ syn region typeScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[g
7071
" syntax match typeScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
7172
syntax match typeScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
7273
" syntax match typeScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
74+
75+
syn match typeScriptDecorators /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
7376
"}}}
7477
"" typeScript Prototype"{{{
7578
syntax keyword typeScriptPrototype contained prototype
@@ -176,7 +179,7 @@ syntax match typeScriptDotNotation "\.style\." nextgroup=typeScriptCssStyles
176179

177180

178181
"" Code blocks
179-
syntax cluster typeScriptAll contains=typeScriptComment,typeScriptLineComment,typeScriptDocComment,typeScriptStringD,typeScriptStringS,typeScriptRegexpString,typeScriptNumber,typeScriptFloat,typeScriptLabel,typeScriptSource,typeScriptType,typeScriptOperator,typeScriptBoolean,typeScriptNull,typeScriptFuncKeyword,typeScriptConditional,typeScriptGlobal,typeScriptRepeat,typeScriptBranch,typeScriptStatement,typeScriptGlobalObjects,typeScriptMessage,typeScriptIdentifier,typeScriptExceptions,typeScriptReserved,typeScriptDeprecated,typeScriptDomErrNo,typeScriptDomNodeConsts,typeScriptHtmlEvents,typeScriptDotNotation,typeScriptBrowserObjects,typeScriptDOMObjects,typeScriptAjaxObjects,typeScriptPropietaryObjects,typeScriptDOMMethods,typeScriptHtmlElemProperties,typeScriptDOMProperties,typeScriptEventListenerKeywords,typeScriptEventListenerMethods,typeScriptAjaxProperties,typeScriptAjaxMethods,typeScriptFuncArg
182+
syntax cluster typeScriptAll contains=typeScriptComment,typeScriptLineComment,typeScriptDocComment,typeScriptStringD,typeScriptStringS,typeScriptStringB,typeScriptRegexpString,typeScriptNumber,typeScriptFloat,typeScriptDecorators,typeScriptLabel,typeScriptSource,typeScriptType,typeScriptOperator,typeScriptBoolean,typeScriptNull,typeScriptFuncKeyword,typeScriptConditional,typeScriptGlobal,typeScriptRepeat,typeScriptBranch,typeScriptStatement,typeScriptGlobalObjects,typeScriptMessage,typeScriptIdentifier,typeScriptExceptions,typeScriptReserved,typeScriptDeprecated,typeScriptDomErrNo,typeScriptDomNodeConsts,typeScriptHtmlEvents,typeScriptDotNotation,typeScriptBrowserObjects,typeScriptDOMObjects,typeScriptAjaxObjects,typeScriptPropietaryObjects,typeScriptDOMMethods,typeScriptHtmlElemProperties,typeScriptDOMProperties,typeScriptEventListenerKeywords,typeScriptEventListenerMethods,typeScriptAjaxProperties,typeScriptAjaxMethods,typeScriptFuncArg
180183

181184
if main_syntax == "typescript"
182185
syntax sync clear
@@ -242,6 +245,7 @@ if version >= 508 || !exists("did_typeScript_syn_inits")
242245
HiLink typeScriptDocParam Function
243246
HiLink typeScriptStringS String
244247
HiLink typeScriptStringD String
248+
HiLink typeScriptStringB String
245249
HiLink typeScriptRegexpString String
246250
HiLink typeScriptGlobal Constant
247251
HiLink typeScriptCharacter Character
@@ -265,6 +269,7 @@ if version >= 508 || !exists("did_typeScript_syn_inits")
265269
HiLink typeScriptNull Type
266270
HiLink typeScriptNumber Number
267271
HiLink typeScriptFloat Number
272+
HiLink typeScriptDecorators Special
268273
HiLink typeScriptBoolean Boolean
269274
HiLink typeScriptLabel Label
270275
HiLink typeScriptSpecial Special

0 commit comments

Comments
 (0)