summaryrefslogtreecommitdiffstats
path: root/syntax/basic/cluster.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-09-06 14:32:07 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-09-06 14:32:07 +0200
commit84ec4eedcdd2892249b5369f91a6dd1d12fef2fc (patch)
tree6c9806851123656af2b71f6c6f5d89649442909c /syntax/basic/cluster.vim
parent66b769328c4511b2273f01c70de971c41f6964dd (diff)
downloadvim-polyglot-4.0.0.tar.gz
vim-polyglot-4.0.0.zip
Switch typescript provider, closes #428v4.0.0
Diffstat (limited to 'syntax/basic/cluster.vim')
-rw-r--r--syntax/basic/cluster.vim42
1 files changed, 42 insertions, 0 deletions
diff --git a/syntax/basic/cluster.vim b/syntax/basic/cluster.vim
new file mode 100644
index 00000000..0188aa98
--- /dev/null
+++ b/syntax/basic/cluster.vim
@@ -0,0 +1,42 @@
+if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
+ finish
+endif
+
+"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
+syntax cluster typescriptStatement
+ \ contains=typescriptBlock,typescriptVariable,
+ \ @typescriptTopExpression,typescriptAssign,
+ \ typescriptConditional,typescriptRepeat,typescriptBranch,
+ \ typescriptLabel,typescriptStatementKeyword,
+ \ typescriptFuncKeyword,
+ \ typescriptTry,typescriptExceptions,typescriptDebugger,
+ \ typescriptExport,typescriptInterfaceKeyword,typescriptEnum,
+ \ typescriptModule,typescriptAliasKeyword,typescriptImport
+
+syntax cluster typescriptPrimitive contains=typescriptString,typescriptTemplate,typescriptRegexpString,typescriptNumber,typescriptBoolean,typescriptNull,typescriptArray
+
+syntax cluster typescriptEventTypes contains=typescriptEventString,typescriptTemplate,typescriptNumber,typescriptBoolean,typescriptNull
+
+" top level expression: no arrow func
+" also no func keyword. funcKeyword is contained in statement
+" funcKeyword allows overloading (func without body)
+" funcImpl requires body
+syntax cluster typescriptTopExpression
+ \ contains=@typescriptPrimitive,
+ \ typescriptIdentifier,typescriptIdentifierName,
+ \ typescriptOperator,typescriptUnaryOp,
+ \ typescriptParenExp,typescriptRegexpString,
+ \ typescriptGlobal,typescriptAsyncFuncKeyword,
+ \ typescriptClassKeyword,typescriptTypeCast
+
+" no object literal, used in type cast and arrow func
+" TODO: change func keyword to funcImpl
+syntax cluster typescriptExpression
+ \ contains=@typescriptTopExpression,
+ \ typescriptArrowFuncDef,
+ \ typescriptFuncImpl
+
+syntax cluster typescriptValue
+ \ contains=@typescriptExpression,typescriptObjectLiteral
+
+syntax cluster typescriptEventExpression contains=typescriptArrowFuncDef,typescriptParenExp,@typescriptValue,typescriptRegexpString,@typescriptEventTypes,typescriptOperator,typescriptGlobal,jsxRegion