Skip to content

Commit d9dfc5a

Browse files
committed
Fixes for Flow on Classes
1 parent 8a972d3 commit d9dfc5a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

extras/flow.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ syntax match jsFlowNoise contained /[:;,<>]/
1212
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise
1313
syntax keyword jsFlowStorageClass contained const var let
1414
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
15+
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
1516

1617
if version >= 508 || !exists("did_javascript_syn_inits")
1718
if version < 508
@@ -26,6 +27,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
2627
HiLink jsFlowDeclareBlock PreProc
2728
HiLink jsFlowObject PreProc
2829
HiLink jsFlowParenRegion PreProc
30+
HiLink jsFlowClass PreProc
2931
HiLink jsFlowType Type
3032
HiLink jsFlowDeclareKeyword Type
3133
HiLink jsFlowNoise Noise

syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFunc
165165
syntax keyword jsClassKeywords contained extends class
166166
syntax match jsClassNoise contained /\./
167167
syntax match jsClassMethodDefinitions contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty
168-
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock
168+
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock,jsFlowClass
169169
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
170170
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
171171
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue

0 commit comments

Comments
 (0)