comparison vendor/vim-syntax/shared/typescriptcommon.vim @ 745:a02f25ddadfe default tip

[vendor] update
author nanaya <me@nanaya.net>
date Fri, 29 Aug 2025 21:11:41 +0900
parents 78469331407e
children
comparison
equal deleted inserted replaced
744:8d3ad5ae1ce4 745:a02f25ddadfe
1 " Vim syntax file 1 " Vim syntax file
2 " Language: TypeScript and TypeScriptReact 2 " Language: TypeScript and TypeScriptReact
3 " Maintainer: Herrington Darkholme 3 " Maintainer: Herrington Darkholme
4 " Last Change: 2024 May 24 4 " Last Change: 2024 May 24
5 " 2025 Aug 05 support for new TypeScript syntaxes
5 " Based On: Herrington Darkholme's yats.vim 6 " Based On: Herrington Darkholme's yats.vim
6 " Changes: See https://github.com/HerringtonDarkholme/yats.vim 7 " Changes: See https://github.com/HerringtonDarkholme/yats.vim
7 " Credits: See yats.vim on github 8 " Credits: See yats.vim on github
8 9
9 if &cpo =~ 'C' 10 if &cpo =~ 'C'
10 let s:cpo_save = &cpo 11 let s:cpo_save = &cpo
11 set cpo&vim 12 set cpo&vim
12 endif 13 endif
13
14 14
15 " NOTE: this results in accurate highlighting, but can be slow. 15 " NOTE: this results in accurate highlighting, but can be slow.
16 syntax sync fromstart 16 syntax sync fromstart
17 17
18 "Dollar sign is permitted anywhere in an identifier 18 "Dollar sign is permitted anywhere in an identifier
238 238
239 " runtime syntax/ts-common/reserved.vim 239 " runtime syntax/ts-common/reserved.vim
240 "Import 240 "Import
241 syntax keyword typescriptImport from as 241 syntax keyword typescriptImport from as
242 syntax keyword typescriptImport import 242 syntax keyword typescriptImport import
243 \ nextgroup=typescriptImportType,typescriptTypeBlock,typescriptDefaultImportName 243 \ nextgroup=typescriptImportType,typescriptImportBlock,typescriptDefaultImportName,typescriptImportDefer
244 \ skipwhite 244 \ skipwhite
245 syntax keyword typescriptImportType type 245 syntax keyword typescriptImportType type
246 \ contained 246 \ contained
247 syntax match typescriptDefaultImportName /\v\h\k*( |,)/
248 \ contained
249 \ nextgroup=typescriptImportBlock
250 \ skipwhite skipempty
251 syntax match typescriptImportDefer /\<defer\%(\s\+\*\)\@=/
252 \ contained
253 syntax region typescriptImportBlock
254 \ matchgroup=typescriptBraces
255 \ start=/{/ end=/}/
256 \ contained
257 \ contains=typescriptIdentifierName,typescriptImportType,typescriptString
258 \ fold
247 syntax keyword typescriptExport export 259 syntax keyword typescriptExport export
248 \ nextgroup=typescriptExportType 260 \ nextgroup=typescriptExportType
249 \ skipwhite 261 \ skipwhite
250 syntax match typescriptExportType /\<type\s*{\@=/ 262 syntax match typescriptExportType /\<type\s*{\@=/
251 \ contained skipwhite skipempty skipnl 263 \ contained skipwhite skipempty skipnl
327 \ typescriptAbstract, 339 \ typescriptAbstract,
328 \ typescriptEnumKeyword,typescriptEnum, 340 \ typescriptEnumKeyword,typescriptEnum,
329 \ typescriptModule 341 \ typescriptModule
330 342
331 syntax keyword typescriptIdentifier arguments nextgroup=@afterIdentifier 343 syntax keyword typescriptIdentifier arguments nextgroup=@afterIdentifier
332 syntax match typescriptDefaultImportName /\v\h\k*( |,)/
333 \ contained
334 \ nextgroup=typescriptTypeBlock
335 \ skipwhite skipempty
336
337 syntax region typescriptTypeBlock
338 \ matchgroup=typescriptBraces
339 \ start=/{/ end=/}/
340 \ contained
341 \ contains=typescriptIdentifierName,typescriptImportType
342 \ fold
343 344
344 "Program Keywords 345 "Program Keywords
345 syntax keyword typescriptNull null undefined nextgroup=@typescriptSymbols skipwhite skipempty 346 syntax keyword typescriptNull null undefined nextgroup=@typescriptSymbols skipwhite skipempty
346 syntax keyword typescriptIdentifier this super prototype nextgroup=@afterIdentifier 347 syntax keyword typescriptIdentifier this super nextgroup=@afterIdentifier
348 syntax keyword typescriptPrototype prototype nextgroup=@afterIdentifier
347 syntax keyword typescriptStatementKeyword return skipwhite contained nextgroup=@typescriptValue containedin=typescriptBlock 349 syntax keyword typescriptStatementKeyword return skipwhite contained nextgroup=@typescriptValue containedin=typescriptBlock
348 350
349 "Syntax coloring for Node.js shebang line 351 "Syntax coloring for Node.js shebang line
350 syntax match shellbang "^#!.*node\>" 352 syntax match shellbang "^#!.*node\>"
351 syntax match shellbang "^#!.*iojs\>" 353 syntax match shellbang "^#!.*iojs\>"
1986 syntax match typescriptDecorator /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/ 1988 syntax match typescriptDecorator /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
1987 \ nextgroup=typescriptFuncCallArg,typescriptTypeArguments 1989 \ nextgroup=typescriptFuncCallArg,typescriptTypeArguments
1988 \ contains=@_semantic,typescriptDotNotation 1990 \ contains=@_semantic,typescriptDotNotation
1989 1991
1990 1992
1991 hi def link typescriptReserved Error 1993 hi def link typescriptReserved Error
1992 1994
1993 hi def link typescriptEndColons Exception 1995 hi def link typescriptEndColons Exception
1994 hi def link typescriptSymbols Normal 1996 hi def link typescriptSymbols Normal
1995 hi def link typescriptBraces Function 1997 hi def link typescriptBraces Function
1996 hi def link typescriptParens Normal 1998 hi def link typescriptParens Normal
1997 hi def link typescriptComment Comment 1999 hi def link typescriptComment Comment
1998 hi def link typescriptLineComment Comment 2000 hi def link typescriptLineComment Comment
1999 hi def link typescriptDocComment Comment 2001 hi def link typescriptDocComment Comment
2000 hi def link typescriptCommentTodo Todo 2002 hi def link typescriptCommentTodo Todo
2001 hi def link typescriptMagicComment SpecialComment 2003 hi def link typescriptMagicComment SpecialComment
2002 hi def link typescriptRef Include 2004 hi def link typescriptRef Include
2003 hi def link typescriptDocNotation SpecialComment 2005 hi def link typescriptDocNotation SpecialComment
2004 hi def link typescriptDocTags SpecialComment 2006 hi def link typescriptDocTags SpecialComment
2005 hi def link typescriptDocNGParam typescriptDocParam 2007 hi def link typescriptDocNGParam typescriptDocParam
2006 hi def link typescriptDocParam Function 2008 hi def link typescriptDocParam Function
2007 hi def link typescriptDocNumParam Function 2009 hi def link typescriptDocNumParam Function
2008 hi def link typescriptDocEventRef Function 2010 hi def link typescriptDocEventRef Function
2009 hi def link typescriptDocNamedParamType Type 2011 hi def link typescriptDocNamedParamType Type
2010 hi def link typescriptDocParamName Type 2012 hi def link typescriptDocParamName Type
2011 hi def link typescriptDocParamType Type 2013 hi def link typescriptDocParamType Type
2012 hi def link typescriptString String 2014 hi def link typescriptString String
2013 hi def link typescriptSpecial Special 2015 hi def link typescriptSpecial Special
2014 hi def link typescriptStringLiteralType String 2016 hi def link typescriptStringLiteralType String
2015 hi def link typescriptTemplateLiteralType String 2017 hi def link typescriptTemplateLiteralType String
2016 hi def link typescriptStringMember String 2018 hi def link typescriptStringMember String
2017 hi def link typescriptTemplate String 2019 hi def link typescriptTemplate String
2018 hi def link typescriptEventString String 2020 hi def link typescriptEventString String
2019 hi def link typescriptDestructureString String 2021 hi def link typescriptDestructureString String
2020 hi def link typescriptASCII Special 2022 hi def link typescriptASCII Special
2021 hi def link typescriptTemplateSB Label 2023 hi def link typescriptTemplateSB Label
2022 hi def link typescriptRegexpString String 2024 hi def link typescriptRegexpString String
2023 hi def link typescriptGlobal Constant 2025 hi def link typescriptGlobal Constant
2024 hi def link typescriptTestGlobal Function 2026 hi def link typescriptTestGlobal Function
2025 hi def link typescriptPrototype Type 2027 hi def link typescriptPrototype Type
2026 hi def link typescriptConditional Conditional 2028 hi def link typescriptConditional Conditional
2027 hi def link typescriptConditionalElse Conditional 2029 hi def link typescriptConditionalElse Conditional
2028 hi def link typescriptCase Conditional 2030 hi def link typescriptCase Conditional
2029 hi def link typescriptDefault typescriptCase 2031 hi def link typescriptDefault typescriptCase
2030 hi def link typescriptBranch Conditional 2032 hi def link typescriptBranch Conditional
2031 hi def link typescriptIdentifier Structure 2033 hi def link typescriptIdentifier Structure
2032 hi def link typescriptVariable Identifier 2034 hi def link typescriptVariable Keyword
2033 hi def link typescriptUsing Identifier 2035 hi def link typescriptUsing Identifier
2034 hi def link typescriptDestructureVariable PreProc 2036 hi def link typescriptDestructureVariable PreProc
2035 hi def link typescriptEnumKeyword Identifier 2037 hi def link typescriptEnumKeyword Identifier
2036 hi def link typescriptRepeat Repeat 2038 hi def link typescriptRepeat Repeat
2037 hi def link typescriptForOperator Repeat 2039 hi def link typescriptForOperator Repeat
2038 hi def link typescriptStatementKeyword Statement 2040 hi def link typescriptStatementKeyword Statement
2039 hi def link typescriptMessage Keyword 2041 hi def link typescriptMessage Keyword
2040 hi def link typescriptOperator Identifier 2042 hi def link typescriptOperator Operator
2041 hi def link typescriptKeywordOp Identifier 2043 hi def link typescriptKeywordOp Operator
2042 hi def link typescriptCastKeyword Special 2044 hi def link typescriptCastKeyword Special
2043 hi def link typescriptType Type 2045 hi def link typescriptType Type
2044 hi def link typescriptNull Boolean 2046 hi def link typescriptNull Boolean
2045 hi def link typescriptNumber Number 2047 hi def link typescriptNumber Number
2046 hi def link typescriptBoolean Boolean 2048 hi def link typescriptBoolean Boolean
2047 hi def link typescriptObjectLabel typescriptLabel 2049 hi def link typescriptObjectLabel typescriptLabel
2048 hi def link typescriptDestructureLabel Function 2050 hi def link typescriptDestructureLabel Function
2049 hi def link typescriptLabel Label 2051 hi def link typescriptLabel Label
2050 hi def link typescriptTupleLable Label 2052 hi def link typescriptTupleLable Label
2051 hi def link typescriptStringProperty String 2053 hi def link typescriptStringProperty String
2052 hi def link typescriptImport Special 2054 hi def link typescriptImport Keyword
2053 hi def link typescriptImportType Special 2055 hi def link typescriptImportType Keyword
2054 hi def link typescriptAmbientDeclaration Special 2056 hi def link typescriptImportDefer Keyword
2055 hi def link typescriptExport Special 2057 hi def link typescriptAmbientDeclaration Keyword
2056 hi def link typescriptExportType Special 2058 hi def link typescriptExport Keyword
2057 hi def link typescriptModule Special 2059 hi def link typescriptExportType Keyword
2058 hi def link typescriptTry Special 2060 hi def link typescriptModule Keyword
2059 hi def link typescriptExceptions Special 2061 hi def link typescriptTry Exception
2060 2062 hi def link typescriptExceptions Exception
2061 hi def link typescriptMember Function 2063
2062 hi def link typescriptMethodAccessor Operator 2064 hi def link typescriptMember Function
2063 2065 hi def link typescriptMethodAccessor Operator
2064 hi def link typescriptAsyncFuncKeyword Keyword 2066
2065 hi def link typescriptObjectAsyncKeyword Keyword 2067 hi def link typescriptAsyncFuncKeyword Keyword
2066 hi def link typescriptAsyncFor Keyword 2068 hi def link typescriptObjectAsyncKeyword Keyword
2067 hi def link typescriptFuncKeyword Keyword 2069 hi def link typescriptAsyncFor Keyword
2068 hi def link typescriptAsyncFunc Keyword 2070 hi def link typescriptFuncKeyword Keyword
2069 hi def link typescriptArrowFunc Type 2071 hi def link typescriptAsyncFunc Keyword
2070 hi def link typescriptFuncName Function 2072 hi def link typescriptArrowFunc Type
2071 hi def link typescriptFuncCallArg PreProc 2073 hi def link typescriptFuncName Function
2072 hi def link typescriptArrowFuncArg PreProc 2074 hi def link typescriptFuncCallArg PreProc
2073 hi def link typescriptFuncComma Operator 2075 hi def link typescriptArrowFuncArg PreProc
2074 2076 hi def link typescriptFuncComma Operator
2075 hi def link typescriptClassKeyword Keyword 2077
2076 hi def link typescriptClassExtends Keyword 2078 hi def link typescriptClassKeyword Keyword
2077 hi def link typescriptAbstract Special 2079 hi def link typescriptClassExtends Keyword
2078 hi def link typescriptClassStatic StorageClass 2080 hi def link typescriptAbstract Special
2079 hi def link typescriptReadonlyModifier Keyword 2081 hi def link typescriptClassStatic StorageClass
2080 hi def link typescriptInterfaceKeyword Keyword 2082 hi def link typescriptReadonlyModifier StorageClass
2081 hi def link typescriptInterfaceExtends Keyword 2083 hi def link typescriptInterfaceKeyword Keyword
2082 hi def link typescriptInterfaceName Function 2084 hi def link typescriptInterfaceExtends Keyword
2083 2085 hi def link typescriptInterfaceName Function
2084 hi def link shellbang Comment 2086
2087 hi def link shellbang Comment
2085 2088
2086 hi def link typescriptTypeParameter Identifier 2089 hi def link typescriptTypeParameter Identifier
2087 hi def link typescriptConstraint Keyword 2090 hi def link typescriptConstraint Keyword
2088 hi def link typescriptPredefinedType Type 2091 hi def link typescriptPredefinedType Type
2089 hi def link typescriptReadonlyArrayKeyword Keyword 2092 hi def link typescriptReadonlyArrayKeyword Keyword
2105 hi def link typescriptTypeReference Identifier 2108 hi def link typescriptTypeReference Identifier
2106 hi def link typescriptConstructor Keyword 2109 hi def link typescriptConstructor Keyword
2107 hi def link typescriptDecorator Special 2110 hi def link typescriptDecorator Special
2108 hi def link typescriptAssertType Keyword 2111 hi def link typescriptAssertType Keyword
2109 2112
2110 hi link typeScript NONE 2113 hi def link typeScript NONE
2111 2114
2112 if exists('s:cpo_save') 2115 if exists('s:cpo_save')
2113 let &cpo = s:cpo_save 2116 let &cpo = s:cpo_save
2114 unlet s:cpo_save 2117 unlet s:cpo_save
2115 endif 2118 endif