@@ -3,21 +3,22 @@ syntax region jsFlowArgumentDef contained start=/:/
33syntax region jsFlowArray contained matchgroup =jsFlowNoise start =/ \[ / end =/ \] / contains =@jsFlowCluster,jsComment fold
44syntax region jsFlowObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =@jsFlowCluster,jsComment fold
55syntax region jsFlowExactObject contained matchgroup =jsFlowNoise start =/ {|/ end =/ |}/ contains =@jsFlowCluster,jsComment fold
6- syntax region jsFlowParens contained matchgroup =jsFlowNoise start =/ (/ end =/ )/ contains =@jsFlowCluster keepend fold
6+ syntax region jsFlowParens contained matchgroup =jsFlowNoise start =/ (/ end =/ )/ contains =@jsFlowCluster nextgroup = jsFlowArrow skipwhite keepend extend fold
77syntax match jsFlowNoise contained / [:;,<>]/
88syntax keyword jsFlowType contained boolean number string null void any mixed JSON array Function object array bool class
99syntax keyword jsFlowTypeof contained typeof skipempty skipwhite nextgroup =jsFlowTypeCustom,jsFlowType
10- syntax match jsFlowTypeCustom contained / [0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup =jsFlowGroup
11- syntax region jsFlowGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster
12- syntax region jsFlowArrowArguments contained matchgroup =jsFlowNoise start =/ (/ end =/ )\% (\s *=>\)\@ =/ oneline skipwhite skipempty nextgroup =jsFlowArrow contains =@jsFlowCluster
10+ syntax match jsFlowTypeCustom contained / [0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup =jsFlowGeneric
11+ syntax region jsFlowGeneric matchgroup =jsFlowNoise start =/ \k\@ <=</ end =/ >/ contains =@jsFlowCluster containedin =@jsExpression,jsFlowDeclareBlock
12+ syntax region jsFlowGeneric contained matchgroup =jsFlowNoise start =/ </ end =/ >(\@ =/ oneline contains =@jsFlowCluster containedin =@jsExpression,jsFlowDeclareBlock
13+ syntax region jsFlowObjectGeneric contained matchgroup =jsFlowNoise start =/ \k\@ <=</ end =/ >/ contains =@jsFlowCluster nextgroup =jsFuncArgs
1314syntax match jsFlowArrow contained / =>/ skipwhite skipempty nextgroup =jsFlowType,jsFlowTypeCustom,jsFlowParens
1415syntax match jsFlowObjectKey contained / [0-9a-zA-Z_$?]*\(\s *:\)\@ =/ contains =jsFunctionKey,jsFlowMaybe skipwhite skipempty nextgroup =jsObjectValue containedin =jsObject
1516syntax match jsFlowOrOperator contained / |/ skipwhite skipempty nextgroup =@jsFlowCluster
1617syntax keyword jsFlowImportType contained type typeof skipwhite skipempty nextgroup =jsModuleAsterisk,jsModuleKeyword,jsModuleGroup
1718syntax match jsFlowWildcard contained / */
1819
1920syntax match jsFlowReturn contained / :\s */ contains =jsFlowNoise skipwhite skipempty nextgroup =@jsFlowReturnCluster,jsFlowArrow,jsFlowReturnParens
20- syntax region jsFlowReturnObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock,jsFlowReturnOrOp fold
21+ syntax region jsFlowReturnObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock,jsFlowReturnOrOp extend fold
2122syntax region jsFlowReturnArray contained matchgroup =jsFlowNoise start =/ \[ / end =/ \] / contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock,jsFlowReturnOrOp fold
2223syntax region jsFlowReturnParens contained matchgroup =jsFlowNoise start =/ (/ end =/ )/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArrow fold
2324syntax match jsFlowReturnArrow contained / =>/ skipwhite skipempty nextgroup =@jsFlowReturnCluster
@@ -31,9 +32,10 @@ syntax keyword jsFlowTypeofReturn contained typeof skipempty skipwhite nextgro
3132syntax region jsFlowFunctionGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncArgs
3233syntax region jsFlowClassGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsClassBlock
3334syntax region jsFlowClassFunctionGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncArgs
35+ syntax match jsFlowObjectFuncName contained / \<\K\k *<\@ =/ skipwhite skipempty nextgroup =jsFlowObjectGeneric containedin =jsObject
3436
3537syntax region jsFlowTypeStatement start =/ \( opaque\s\+\)\? type\% (\s\+\k\)\@ =/ end =/ =\@ =/ contains =jsFlowTypeOperator oneline skipwhite skipempty nextgroup =jsFlowTypeValue keepend
36- syntax region jsFlowTypeValue contained matchgroup =jsFlowNoise start =/ =/ end =/ \% (;\|\n\% (\s *|\)\@ !\) / contains =@jsFlowCluster,jsFlowGroup ,jsFlowMaybe
38+ syntax region jsFlowTypeValue contained matchgroup =jsFlowNoise start =/ =/ end =/ \% (;\|\n\% (\s *|\)\@ !\) / contains =@jsFlowCluster,jsFlowGeneric ,jsFlowMaybe
3739syntax match jsFlowTypeOperator contained / =/ containedin =jsFlowTypeValue
3840syntax match jsFlowTypeOperator contained / =/
3941syntax keyword jsFlowTypeKeyword contained type
@@ -42,20 +44,17 @@ syntax keyword jsFlowDeclare declare skipwhite skipempty nextgr
4244syntax match jsFlowClassProperty contained / \< [0-9a-zA-Z_$]*\> :\@ =/ skipwhite skipempty nextgroup =jsFlowClassDef containedin =jsClassBlock
4345syntax region jsFlowClassDef contained start =/ :/ end =/ \% (\s *[,=;)\n ]\)\@ =/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsClassValue
4446
45- syntax region jsFlowModule contained start =/ module/ end =/ { \@ =/ skipempty skipwhite nextgroup =jsFlowDeclareBlock contains =jsString
47+ syntax region jsFlowModule contained start =/ module/ end =/ \% ({ \| : \) \@ =/ skipempty skipwhite nextgroup =jsFlowDeclareBlock contains =jsString
4648syntax region jsFlowInterface contained start =/ interface/ end =/ {\@ =/ skipempty skipwhite nextgroup =jsFlowInterfaceBlock contains =@jsFlowCluster
4749syntax region jsFlowDeclareBlock contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =jsFlowDeclare,jsFlowNoise fold
4850
49- " NOTE: It appears the nextgroup was causing a ton of breakages... testing it
50- " witout a nextgroup, but keeping this arround for reference incase something breaks
51- " syntax match jsFlowMaybe contained /?/ nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens,jsFlowArrowArguments,jsFlowObject,jsFlowReturnObject extend keepend
5251syntax match jsFlowMaybe contained / ?/
53- syntax region jsFlowInterfaceBlock contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsFlowNoise keepend fold
52+ syntax region jsFlowInterfaceBlock contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsFlowObjectFuncName, jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsFlowNoise,jsFlowParens,jsFlowGeneric keepend fold
5453
5554syntax region jsFlowParenAnnotation contained start =/ :/ end =/ [,=)]\@ =/ containedin =jsParen contains =@jsFlowCluster
5655
5756syntax cluster jsFlowReturnCluster contains =jsFlowNoise,jsFlowReturnObject,jsFlowReturnArray,jsFlowReturnKeyword,jsFlowReturnGroup,jsFlowReturnMaybe,jsFlowReturnOrOp,jsFlowWildcardReturn,jsFlowReturnArrow,jsFlowTypeofReturn
58- syntax cluster jsFlowCluster contains =jsFlowArray,jsFlowObject,jsFlowExactObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGroup,jsFlowArrowArguments ,jsFlowMaybe,jsFlowParens,jsFlowOrOperator,jsFlowWildcard
57+ syntax cluster jsFlowCluster contains =jsFlowArray,jsFlowObject,jsFlowExactObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGeneric ,jsFlowMaybe,jsFlowParens,jsFlowOrOperator,jsFlowWildcard
5958
6059if version >= 508 || ! exists (" did_javascript_syn_inits" )
6160 if version < 508
@@ -75,17 +74,17 @@ if version >= 508 || !exists("did_javascript_syn_inits")
7574 HiLink jsFlowObject PreProc
7675 HiLink jsFlowExactObject PreProc
7776 HiLink jsFlowParens PreProc
78- HiLink jsFlowGroup PreProc
77+ HiLink jsFlowGeneric PreProc
78+ HiLink jsFlowObjectGeneric jsFlowGeneric
7979 HiLink jsFlowReturn PreProc
8080 HiLink jsFlowParenAnnotation PreProc
8181 HiLink jsFlowReturnObject jsFlowReturn
8282 HiLink jsFlowReturnArray jsFlowArray
8383 HiLink jsFlowReturnParens jsFlowParens
84- HiLink jsFlowReturnGroup jsFlowGroup
84+ HiLink jsFlowReturnGroup jsFlowGeneric
8585 HiLink jsFlowFunctionGroup PreProc
8686 HiLink jsFlowClassGroup PreProc
8787 HiLink jsFlowClassFunctionGroup PreProc
88- HiLink jsFlowArrowArguments PreProc
8988 HiLink jsFlowArrow PreProc
9089 HiLink jsFlowReturnArrow PreProc
9190 HiLink jsFlowTypeStatement PreProc
@@ -105,5 +104,6 @@ if version >= 508 || !exists("did_javascript_syn_inits")
105104 HiLink jsFlowWildcardReturn PreProc
106105 HiLink jsFlowImportType PreProc
107106 HiLink jsFlowTypeValue PreProc
107+ HiLink jsFlowObjectFuncName jsObjectFuncName
108108 delcommand HiLink
109109endif
0 commit comments