mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 20:13:51 -05:00
Respect symlinks for resolving vim-polyglot as fallback, closes #605
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/class.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
"don't add typescriptMembers to nextgroup, let outer scope match it
|
||||
" so we won't match abstract method outside abstract class
|
||||
@@ -72,5 +67,3 @@ syntax region typescriptInterfaceTypeArguments matchgroup=typescriptTypeBrackets
|
||||
\ contained skipwhite
|
||||
|
||||
syntax match typescriptInterfaceComma /,/ contained nextgroup=typescriptInterfaceHeritage skipwhite skipnl
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/cluster.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
|
||||
syntax cluster typescriptStatement
|
||||
@@ -45,5 +40,3 @@ syntax cluster typescriptValue
|
||||
\ contains=@typescriptExpression,typescriptObjectLiteral
|
||||
|
||||
syntax cluster typescriptEventExpression contains=typescriptArrowFuncDef,typescriptParenExp,@typescriptValue,typescriptRegexpString,@typescriptEventTypes,typescriptOperator,typescriptGlobal,jsxRegion
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/decorator.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
syntax match typescriptDecorator /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
|
||||
\ nextgroup=typescriptFuncCallArg,typescriptTypeArguments
|
||||
\ contains=@_semantic,typescriptDotNotation
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/doc.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
"Syntax coloring for Node.js shebang line
|
||||
syntax match shellbang "^#!.*node\>"
|
||||
@@ -91,5 +86,3 @@ if exists("main_syntax") && main_syntax == "typescript"
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/function.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
syntax keyword typescriptAsyncFuncKeyword async
|
||||
\ nextgroup=typescriptFuncKeyword,typescriptArrowFuncDef
|
||||
@@ -74,5 +69,3 @@ syntax region typescriptParamImpl matchgroup=typescriptParens
|
||||
\ contains=typescriptDecorator,@typescriptParameterList,@typescriptComments
|
||||
\ nextgroup=typescriptReturnAnnotation,typescriptBlock
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/identifiers.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
syntax cluster afterIdentifier contains=
|
||||
\ typescriptDotNotation,
|
||||
@@ -86,5 +81,3 @@ syntax region typescriptObjectDestructure matchgroup=typescriptBraces
|
||||
\ contains=typescriptDestructureString,@typescriptDestructureVariables,@typescriptComments
|
||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||
\ transparent contained skipwhite skipempty fold
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/keyword.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
"Import
|
||||
syntax keyword typescriptImport from as
|
||||
@@ -103,5 +98,3 @@ syntax cluster typescriptAmbients contains=
|
||||
\ typescriptAbstract,
|
||||
\ typescriptEnumKeyword,typescriptEnum,
|
||||
\ typescriptModule
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/literal.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
"Syntax in the JavaScript code
|
||||
|
||||
@@ -48,5 +43,3 @@ syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescrip
|
||||
syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptNumber /\<\%(\d[0-9_]*\%(\.\d[0-9_]*\)\=\|\.\d[0-9_]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/
|
||||
\ nextgroup=typescriptSymbols skipwhite skipempty
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/members.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
syntax keyword typescriptConstructor contained constructor
|
||||
\ nextgroup=@typescriptCallSignature
|
||||
@@ -53,5 +48,3 @@ syntax region typescriptComputedMember contained matchgroup=typescriptPropert
|
||||
\ contains=@typescriptValue,typescriptMember,typescriptMappedIn
|
||||
\ nextgroup=@memberNextGroup
|
||||
\ skipwhite skipempty
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/object.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
syntax region typescriptObjectLiteral matchgroup=typescriptBraces
|
||||
\ start=/{/ end=/}/
|
||||
@@ -37,5 +32,3 @@ syntax match typescriptRestOrSpread /\.\.\./ contained
|
||||
syntax match typescriptObjectSpread /\.\.\./ contained containedin=typescriptObjectLiteral,typescriptArray nextgroup=@typescriptValue
|
||||
|
||||
syntax match typescriptObjectColon contained /:/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/patch.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
" patch for generated code
|
||||
syntax keyword typescriptGlobal Promise
|
||||
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
|
||||
syntax keyword typescriptGlobal Map WeakMap
|
||||
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/reserved.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
syntax cluster typescriptStrings contains=typescriptProp,typescriptString,typescriptTemplate,@typescriptComments,typescriptDocComment,typescriptRegexpString,typescriptPropertyName
|
||||
|
||||
@@ -38,5 +33,3 @@ syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved volat
|
||||
syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved class
|
||||
syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved var
|
||||
syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved function
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/symbols.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
" + - ^ ~
|
||||
syntax match typescriptUnaryOp /[+\-~!]/
|
||||
@@ -47,5 +42,3 @@ syntax match typescriptBinaryOp contained /-\(-\|=\)\?/ nextgroup=@typescriptV
|
||||
syntax match typescriptBinaryOp contained /\*\*=\?/ nextgroup=@typescriptValue
|
||||
|
||||
syntax cluster typescriptSymbols contains=typescriptBinaryOp,typescriptKeywordOp,typescriptTernary,typescriptAssign,typescriptCastKeyword
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
let s:base = expand("<sfile>:h:h")
|
||||
let Filter = { _, v -> stridx(v, s:base) == -1 && stridx(v, $VIMRUNTIME) == -1 && v !~ "after" }
|
||||
let files = filter(globpath(&rtp, 'syntax/basic/type.vim', 1, 1), Filter)
|
||||
if len(files) > 0
|
||||
exec 'source ' . files[0]
|
||||
if !polyglot#util#IsEnabled('typescript', expand('<sfile>:p'))
|
||||
finish
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
" Types
|
||||
syntax match typescriptOptionalMark /?/ contained
|
||||
@@ -221,5 +216,3 @@ syntax region typescriptAliasDeclaration matchgroup=typescriptUnion
|
||||
syntax keyword typescriptReadonlyArrayKeyword readonly
|
||||
\ nextgroup=@typescriptPrimaryType
|
||||
\ skipwhite
|
||||
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user