Skip to content

Fixes #502 #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extras/flow.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ syntax match jsFlowNoise contained /[:;,<>]/
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise
syntax keyword jsFlowStorageClass contained const var let
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock

if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
Expand All @@ -26,6 +27,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsFlowDeclareBlock PreProc
HiLink jsFlowObject PreProc
HiLink jsFlowParenRegion PreProc
HiLink jsFlowClass PreProc
HiLink jsFlowClassProperty jsClassProperty
HiLink jsFlowType Type
HiLink jsFlowDeclareKeyword Type
HiLink jsFlowNoise Noise
Expand Down
8 changes: 4 additions & 4 deletions syntax/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ syntax match jsModuleAsterisk contained /*/
syntax keyword jsModuleDefault contained default skipwhite kipempty nextgroup=@jsExpression
syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk
syntax region jsExportContainer start=/\<export\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsStorageClass,jsModuleDefault,@jsExpression
syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise
syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise

" Strings, Templates, Numbers
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
Expand Down Expand Up @@ -165,7 +165,7 @@ exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFunc
syntax keyword jsClassKeywords contained extends class
syntax match jsClassNoise contained /\./
syntax match jsClassMethodDefinitions contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock,jsFlowClass
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
Expand All @@ -180,9 +180,9 @@ syntax match jsDestructuringPropertyValue contained /\<[0-9a-zA-Z_$]*\>/
syntax match jsDestructuringProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValue
syntax match jsDestructuringAssignment contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend
syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise extend
syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend
syntax match jsDestructuringNoise contained /[,\[\]]/
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpresslon skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold

" Comments
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
Expand Down