From ae18284e5af128e1fca0b42f284b558dd7dce73d Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 4 Sep 2019 17:39:23 +0200 Subject: Disable jsx when ts or js is disabled, closes #414 --- extras/flow.vim | 113 ------------------------------------------------------- extras/jsdoc.vim | 43 --------------------- extras/ngdoc.vim | 7 ---- 3 files changed, 163 deletions(-) (limited to 'extras') diff --git a/extras/flow.vim b/extras/flow.vim index 1f2294e6..67b7671b 100644 --- a/extras/flow.vim +++ b/extras/flow.vim @@ -111,116 +111,3 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsFlowObjectFuncName jsObjectFuncName delcommand HiLink endif -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'javascript') != -1 - finish -endif - -syntax region jsFlowDefinition contained start=/:/ end=/\%(\s*[,=;)\n]\)\@=/ contains=@jsFlowCluster containedin=jsParen -syntax region jsFlowArgumentDef contained start=/:/ end=/\%(\s*[,)]\|=>\@!\)\@=/ contains=@jsFlowCluster -syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster,jsComment fold -syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster,jsComment fold -syntax region jsFlowExactObject contained matchgroup=jsFlowNoise start=/{|/ end=/|}/ contains=@jsFlowCluster,jsComment fold -syntax region jsFlowParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster nextgroup=jsFlowArrow skipwhite keepend extend fold -syntax match jsFlowNoise contained /[:;,<>]/ -syntax keyword jsFlowType contained boolean number string null void any mixed JSON array Function object array bool class -syntax keyword jsFlowTypeof contained typeof skipempty skipwhite nextgroup=jsFlowTypeCustom,jsFlowType -syntax match jsFlowTypeCustom contained /[0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup=jsFlowGeneric -syntax region jsFlowGeneric matchgroup=jsFlowNoise start=/\k\@<=/ contains=@jsFlowCluster containedin=@jsExpression,jsFlowDeclareBlock -syntax region jsFlowGeneric contained matchgroup=jsFlowNoise start=/(\@=/ oneline contains=@jsFlowCluster containedin=@jsExpression,jsFlowDeclareBlock -syntax region jsFlowObjectGeneric contained matchgroup=jsFlowNoise start=/\k\@<=/ contains=@jsFlowCluster nextgroup=jsFuncArgs -syntax match jsFlowArrow contained /=>/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens -syntax match jsFlowObjectKey contained /[0-9a-zA-Z_$?]*\(\s*:\)\@=/ contains=jsFunctionKey,jsFlowMaybe skipwhite skipempty nextgroup=jsObjectValue containedin=jsObject -syntax match jsFlowOrOperator contained /|/ skipwhite skipempty nextgroup=@jsFlowCluster -syntax keyword jsFlowImportType contained type typeof skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup -syntax match jsFlowWildcard contained /*/ - -syntax match jsFlowReturn contained /:\s*/ contains=jsFlowNoise skipwhite skipempty nextgroup=@jsFlowReturnCluster,jsFlowArrow,jsFlowReturnParens -syntax region jsFlowReturnObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp extend fold -syntax region jsFlowReturnArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp fold -syntax region jsFlowReturnParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArrow fold -syntax match jsFlowReturnArrow contained /=>/ skipwhite skipempty nextgroup=@jsFlowReturnCluster -syntax match jsFlowReturnKeyword contained /\k\+/ contains=jsFlowType,jsFlowTypeCustom skipwhite skipempty nextgroup=jsFlowReturnGroup,jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArray -syntax match jsFlowReturnMaybe contained /?/ skipwhite skipempty nextgroup=jsFlowReturnKeyword,jsFlowReturnObject,jsFlowReturnParens -syntax region jsFlowReturnGroup contained matchgroup=jsFlowNoise start=// contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp -syntax match jsFlowReturnOrOp contained /\s*|\s*/ skipwhite skipempty nextgroup=@jsFlowReturnCluster -syntax match jsFlowWildcardReturn contained /*/ skipwhite skipempty nextgroup=jsFuncBlock -syntax keyword jsFlowTypeofReturn contained typeof skipempty skipwhite nextgroup=@jsFlowReturnCluster - -syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=// contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs -syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=// contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock -syntax region jsFlowClassFunctionGroup contained matchgroup=jsFlowNoise start=// contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs -syntax match jsFlowObjectFuncName contained /\<\K\k*<\@=/ skipwhite skipempty nextgroup=jsFlowObjectGeneric containedin=jsObject - -syntax region jsFlowTypeStatement start=/\(opaque\s\+\)\?type\%(\s\+\k\)\@=/ end=/=\@=/ contains=jsFlowTypeOperator oneline skipwhite skipempty nextgroup=jsFlowTypeValue keepend -syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/=/ end=/\%(;\|\n\%(\s*|\)\@!\)/ contains=@jsFlowCluster,jsFlowGeneric,jsFlowMaybe -syntax match jsFlowTypeOperator contained /=/ containedin=jsFlowTypeValue -syntax match jsFlowTypeOperator contained /=/ -syntax keyword jsFlowTypeKeyword contained type - -syntax keyword jsFlowDeclare declare skipwhite skipempty nextgroup=jsFlowTypeStatement,jsClassDefinition,jsStorageClass,jsFlowModule,jsFlowInterface -syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlowClassDef containedin=jsClassBlock -syntax region jsFlowClassDef contained start=/:/ end=/\%(\s*[,=;)\n]\)\@=/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassValue - -syntax region jsFlowModule contained start=/module/ end=/\%({\|:\)\@=/ skipempty skipwhite nextgroup=jsFlowDeclareBlock contains=jsString -syntax region jsFlowInterface contained start=/interface/ end=/{\@=/ skipempty skipwhite nextgroup=jsFlowInterfaceBlock contains=@jsFlowCluster -syntax region jsFlowDeclareBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsFlowDeclare,jsFlowNoise fold - -syntax match jsFlowMaybe contained /?/ -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 - -syntax region jsFlowParenAnnotation contained start=/:/ end=/[,=)]\@=/ containedin=jsParen contains=@jsFlowCluster - -syntax cluster jsFlowReturnCluster contains=jsFlowNoise,jsFlowReturnObject,jsFlowReturnArray,jsFlowReturnKeyword,jsFlowReturnGroup,jsFlowReturnMaybe,jsFlowReturnOrOp,jsFlowWildcardReturn,jsFlowReturnArrow,jsFlowTypeofReturn -syntax cluster jsFlowCluster contains=jsFlowArray,jsFlowObject,jsFlowExactObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGeneric,jsFlowMaybe,jsFlowParens,jsFlowOrOperator,jsFlowWildcard - -if version >= 508 || !exists("did_javascript_syn_inits") - if version < 508 - let did_javascript_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink jsFlowDefinition PreProc - HiLink jsFlowClassDef jsFlowDefinition - HiLink jsFlowArgumentDef jsFlowDefinition - HiLink jsFlowType Type - HiLink jsFlowTypeCustom PreProc - HiLink jsFlowTypeof PreProc - HiLink jsFlowTypeofReturn PreProc - HiLink jsFlowArray PreProc - HiLink jsFlowObject PreProc - HiLink jsFlowExactObject PreProc - HiLink jsFlowParens PreProc - HiLink jsFlowGeneric PreProc - HiLink jsFlowObjectGeneric jsFlowGeneric - HiLink jsFlowReturn PreProc - HiLink jsFlowParenAnnotation PreProc - HiLink jsFlowReturnObject jsFlowReturn - HiLink jsFlowReturnArray jsFlowArray - HiLink jsFlowReturnParens jsFlowParens - HiLink jsFlowReturnGroup jsFlowGeneric - HiLink jsFlowFunctionGroup PreProc - HiLink jsFlowClassGroup PreProc - HiLink jsFlowClassFunctionGroup PreProc - HiLink jsFlowArrow PreProc - HiLink jsFlowReturnArrow PreProc - HiLink jsFlowTypeStatement PreProc - HiLink jsFlowTypeKeyword PreProc - HiLink jsFlowTypeOperator Operator - HiLink jsFlowMaybe PreProc - HiLink jsFlowReturnMaybe PreProc - HiLink jsFlowClassProperty jsClassProperty - HiLink jsFlowDeclare PreProc - HiLink jsFlowModule PreProc - HiLink jsFlowInterface PreProc - HiLink jsFlowNoise Noise - HiLink jsFlowObjectKey jsObjectKey - HiLink jsFlowOrOperator jsOperator - HiLink jsFlowReturnOrOp jsFlowOrOperator - HiLink jsFlowWildcard PreProc - HiLink jsFlowWildcardReturn PreProc - HiLink jsFlowImportType PreProc - HiLink jsFlowTypeValue PreProc - HiLink jsFlowObjectFuncName jsObjectFuncName - delcommand HiLink -endif diff --git a/extras/jsdoc.vim b/extras/jsdoc.vim index 5d04d94f..d7250f81 100644 --- a/extras/jsdoc.vim +++ b/extras/jsdoc.vim @@ -41,46 +41,3 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsDocParam Label delcommand HiLink endif -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'javascript') != -1 - finish -endif - -"" syntax coloring for javadoc comments (HTML) -syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold - -" tags containing a param -syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam -" tags containing type and param -syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\|typedef\)\>" skipwhite nextgroup=jsDocType -" tags containing type but no param -syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|return\|returns\|yields\)\>" skipwhite nextgroup=jsDocTypeNoParam -" tags containing references -syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag -" other tags (no extra syntax) -syntax match jsDocTags contained "@\(abstract\|access\|accessor\|async\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inherit[dD]oc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>" - -syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam -syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam -syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend -syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend -syntax region jsDocTypeNoParam contained start="{" end="}" oneline -syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" -syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.\{-}]\|=\)\+" -syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags - -if version >= 508 || !exists("did_javascript_syn_inits") - if version < 508 - let did_javascript_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink jsDocTags Special - HiLink jsDocSeeTag Function - HiLink jsDocType Type - HiLink jsDocTypeBrackets jsDocType - HiLink jsDocTypeRecord jsDocType - HiLink jsDocTypeNoParam Type - HiLink jsDocParam Label - delcommand HiLink -endif diff --git a/extras/ngdoc.vim b/extras/ngdoc.vim index b4f2e006..90eceadf 100644 --- a/extras/ngdoc.vim +++ b/extras/ngdoc.vim @@ -5,10 +5,3 @@ endif syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+" -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'javascript') != -1 - finish -endif - -syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite -syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite -syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+" -- cgit v1.2.3