From 7a0f2d974f9ac5bc85607e8c769d3370dd18ac74 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 7 Dec 2019 12:21:37 +0100 Subject: Update --- syntax/basic/class.vim | 4 ++-- syntax/basic/literal.vim | 4 ++-- syntax/basic/object.vim | 4 +++- syntax/basic/type.vim | 8 ++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'syntax/basic') diff --git a/syntax/basic/class.vim b/syntax/basic/class.vim index 73f63468..303d2077 100644 --- a/syntax/basic/class.vim +++ b/syntax/basic/class.vim @@ -15,7 +15,7 @@ syntax match typescriptClassName contained /\K\k*/ syntax region typescriptClassTypeParameter \ start=// - \ contains=typescriptTypeParameter + \ contains=@typescriptTypeParameterCluster \ nextgroup=typescriptClassBlock,typescriptClassExtends \ contained skipwhite skipnl @@ -47,7 +47,7 @@ syntax match typescriptInterfaceName contained /\k\+/ \ skipwhite skipnl syntax region typescriptInterfaceTypeParameter \ start=// - \ contains=typescriptTypeParameter + \ contains=@typescriptTypeParameterCluster \ nextgroup=typescriptObjectType,typescriptInterfaceExtends \ contained \ skipwhite skipnl diff --git a/syntax/basic/literal.vim b/syntax/basic/literal.vim index 533b228a..1f4fb854 100644 --- a/syntax/basic/literal.vim +++ b/syntax/basic/literal.vim @@ -16,7 +16,7 @@ syntax region typescriptString \ contains=typescriptSpecial,@Spell \ extend -syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)" +syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)" " From vim runtime " @@ -24,7 +24,7 @@ syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\| syntax region typescriptTemplate \ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/ - \ contains=typescriptTemplateSubstitution + \ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell \ nextgroup=@typescriptSymbols \ skipwhite skipempty diff --git a/syntax/basic/object.vim b/syntax/basic/object.vim index a0d69c53..90c75a0a 100644 --- a/syntax/basic/object.vim +++ b/syntax/basic/object.vim @@ -2,9 +2,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == syntax region typescriptObjectLiteral matchgroup=typescriptBraces \ start=/{/ end=/}/ - \ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName + \ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName,typescriptObjectAsyncKeyword \ fold contained +syntax keyword typescriptObjectAsyncKeyword async contained + syntax match typescriptObjectLabel contained /\k\+\_s*/ \ nextgroup=typescriptObjectColon,@typescriptCallImpl \ skipwhite skipempty diff --git a/syntax/basic/type.vim b/syntax/basic/type.vim index af2b535f..4de74eeb 100644 --- a/syntax/basic/type.vim +++ b/syntax/basic/type.vim @@ -3,13 +3,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == " Types syntax match typescriptOptionalMark /?/ contained +syntax cluster typescriptTypeParameterCluster contains= + \ typescriptTypeParameter, + \ typescriptGenericDefault + syntax region typescriptTypeParameters matchgroup=typescriptTypeBrackets \ start=// - \ contains=typescriptTypeParameter + \ contains=@typescriptTypeParameterCluster \ contained syntax match typescriptTypeParameter /\K\k*/ - \ nextgroup=typescriptConstraint,typescriptGenericDefault + \ nextgroup=typescriptConstraint \ contained skipwhite skipnl syntax keyword typescriptConstraint extends -- cgit v1.2.3