Skip to content

Commit af791ed

Browse files
committed
Adding object key flow support
1 parent be52070 commit af791ed

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

extras/flow.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite
1111
syntax match jsFlowNoise contained /[:;,<>]/
1212
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise
1313
syntax keyword jsFlowStorageClass contained const var let
14+
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
1415

1516
if version >= 508 || !exists("did_javascript_syn_inits")
1617
if version < 508
@@ -24,6 +25,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
2425
HiLink jsFlowArray PreProc
2526
HiLink jsFlowDeclareBlock PreProc
2627
HiLink jsFlowObject PreProc
28+
HiLink jsFlowParenRegion PreProc
2729
HiLink jsFlowType Type
2830
HiLink jsFlowDeclareKeyword Type
2931
HiLink jsFlowNoise Noise

syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ else
7373
endif
7474
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
7575

76-
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
76+
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue,jsFlowParenRegion
7777
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
7878
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
7979
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend

0 commit comments

Comments
 (0)