summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-09-04 17:39:23 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-09-04 17:39:23 +0200
commitae18284e5af128e1fca0b42f284b558dd7dce73d (patch)
treeeb065c770b2f4985f5677829c1550d0f7067acea
parente3024f21fca230b030fb2fe2fde4e768fb8205b3 (diff)
downloadvim-polyglot-ae18284e5af128e1fca0b42f284b558dd7dce73d.tar.gz
vim-polyglot-ae18284e5af128e1fca0b42f284b558dd7dce73d.zip
Disable jsx when ts or js is disabled, closes #414v3.10.0
-rw-r--r--after/ftplugin/javascript.vim2
-rw-r--r--after/ftplugin/typescript.vim2
-rw-r--r--after/indent/javascript.vim2
-rw-r--r--after/indent/typescript.vim2
-rw-r--r--after/syntax/javascript.vim2
-rw-r--r--after/syntax/jsx_pretty.vim2
-rw-r--r--after/syntax/typescript.vim2
-rw-r--r--autoload/jsx_pretty/comment.vim2
-rw-r--r--autoload/jsx_pretty/indent.vim2
-rwxr-xr-xbuild8
-rw-r--r--extras/flow.vim113
-rw-r--r--extras/jsdoc.vim43
-rw-r--r--extras/ngdoc.vim7
-rw-r--r--ftdetect/polyglot.vim5
-rw-r--r--plugin_guard_jsx.vim.template5
15 files changed, 20 insertions, 179 deletions
diff --git a/after/ftplugin/javascript.vim b/after/ftplugin/javascript.vim
index 4a6346d9..463b854a 100644
--- a/after/ftplugin/javascript.vim
+++ b/after/ftplugin/javascript.vim
@@ -14,7 +14,7 @@ if exists('b:undo_ftplugin')
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/after/ftplugin/typescript.vim b/after/ftplugin/typescript.vim
index 21da03be..d307f5d4 100644
--- a/after/ftplugin/typescript.vim
+++ b/after/ftplugin/typescript.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/after/indent/javascript.vim b/after/indent/javascript.vim
index 275073fa..8c2254d6 100644
--- a/after/indent/javascript.vim
+++ b/after/indent/javascript.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/after/indent/typescript.vim b/after/indent/typescript.vim
index 4e281b22..acc283f0 100644
--- a/after/indent/typescript.vim
+++ b/after/indent/typescript.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/after/syntax/javascript.vim b/after/syntax/javascript.vim
index 27818b58..1d2064b5 100644
--- a/after/syntax/javascript.vim
+++ b/after/syntax/javascript.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/after/syntax/jsx_pretty.vim b/after/syntax/jsx_pretty.vim
index bc98202a..f37a084b 100644
--- a/after/syntax/jsx_pretty.vim
+++ b/after/syntax/jsx_pretty.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/after/syntax/typescript.vim b/after/syntax/typescript.vim
index f39d755f..df500404 100644
--- a/after/syntax/typescript.vim
+++ b/after/syntax/typescript.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/autoload/jsx_pretty/comment.vim b/autoload/jsx_pretty/comment.vim
index 639e55b9..325baaea 100644
--- a/autoload/jsx_pretty/comment.vim
+++ b/autoload/jsx_pretty/comment.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/autoload/jsx_pretty/indent.vim b/autoload/jsx_pretty/indent.vim
index 22ede621..67170b46 100644
--- a/autoload/jsx_pretty/indent.vim
+++ b/autoload/jsx_pretty/indent.vim
@@ -1,4 +1,4 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
diff --git a/build b/build
index 71ff6c31..c416af26 100755
--- a/build
+++ b/build
@@ -6,7 +6,7 @@ DIRS="syntax indent compiler autoload ftplugin after/syntax after/indent after/f
# shellcheck disable=SC2034
DIRS_BASIC="syntax compiler indent after/syntax after/indent"
# shellcheck disable=SC2034
-DIRS_ALL="syntax indent compiler autoload ftplugin after"
+DIRS_ALL="syntax indent compiler autoload ftplugin after extras"
# shellcheck disable=SC2034
DIRS_SYNTAX="syntax indent after/syntax after/indent"
# shellcheck disable=SC2034
@@ -127,7 +127,11 @@ copy_file() {
touch "$file_in_dst"
# Use comma instead of / to handle cases like c/c++
- sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
+ if [[ "${package_name}" == "jsx" ]]; then
+ sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard_jsx.vim.template >> "$file_in_dst"
+ else
+ sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
+ fi
}
update_readme() {
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\@<=</ end=/>/ contains=@jsFlowCluster containedin=@jsExpression,jsFlowDeclareBlock
-syntax region jsFlowGeneric contained matchgroup=jsFlowNoise start=/</ end=/>(\@=/ oneline contains=@jsFlowCluster containedin=@jsExpression,jsFlowDeclareBlock
-syntax region jsFlowObjectGeneric contained matchgroup=jsFlowNoise start=/\k\@<=</ end=/>/ 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=/</ end=/>/ 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=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs
-syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
-syntax region jsFlowClassFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ 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 <args>
- else
- command -nargs=+ HiLink hi def link <args>
- 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 <args>
- else
- command -nargs=+ HiLink hi def link <args>
- 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\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 7e3dc45f..8352996f 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -1,8 +1,3 @@
-" Enable jsx syntax by default
-if !exists('g:jsx_ext_required')
- let g:jsx_ext_required = 0
-endif
-
" Make csv loading faster
if !exists('g:csv_start')
let g:csv_start = 1
diff --git a/plugin_guard_jsx.vim.template b/plugin_guard_jsx.vim.template
new file mode 100644
index 00000000..a6b41027
--- /dev/null
+++ b/plugin_guard_jsx.vim.template
@@ -0,0 +1,5 @@
+if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
+ finish
+endif
+
+%%CONTENT%%