Skip to content
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

Add private field modifier to classes #1237

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions syntax/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ syntax region jsParenRepeat contained matchgroup=jsParensRepeat s
syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsDestructuringArray,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsAsyncKeyword,jsNoise extend fold
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsAsyncKeyword,jsModifier,jsNoise extend fold
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
Expand Down Expand Up @@ -180,6 +180,7 @@ exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=j
" Classes
syntax keyword jsClassKeyword contained class
syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression
syntax match jsModifier contained /\#/
syntax match jsClassNoise contained /\./
syntax match jsClassFuncName contained /\<\K\k*\ze\s*[(<]/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowClassFunctionGroup
syntax match jsClassMethodType contained /\<\%([gs]et\|static\)\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsClassFuncName,jsClassProperty
Expand Down Expand Up @@ -233,7 +234,7 @@ if exists("javascript_plugin_flow")
endif

syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsStatement,jsDot
syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel
syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel,jsModifier

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
Expand Down Expand Up @@ -297,6 +298,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsOperator Operator
HiLink jsOf Operator
HiLink jsStorageClass StorageClass
HiLink jsModifier StorageClass
HiLink jsClassKeyword Keyword
HiLink jsExtendsKeyword Keyword
HiLink jsThis Special
Expand Down