Fix var declaration without line ending followed by expression

Fixes #975
This commit is contained in:
Sheetal Nandi 2023-04-05 15:14:47 -07:00
Родитель d1a9c20032
Коммит e0aefd8205
6 изменённых файлов: 93 добавлений и 30 удалений

Просмотреть файл

@ -269,7 +269,7 @@ repository:
# let/var
- name: meta.var.expr.ts
begin: (?={{varExprStart}})
end: (?!{{varExprStart}})((?=;|}|({{startOfIdentifier}}(of|in)\s+)|{{endOfStatement}})|((?<!{{lookBehindLet}}|{{lookBehindVar}})(?=\s*$)))
end: (?!{{varExprStart}})((?=^|;|}|({{startOfIdentifier}}(of|in)\s+)|{{endOfStatement}})|((?<!{{lookBehindLet}}|{{lookBehindVar}})(?=\s*$)))
patterns:
- begin: '{{varExprStart}}\s*'
beginCaptures:
@ -281,7 +281,7 @@ repository:
- include: '#var-single-variable'
- include: '#variable-initializer'
- include: '#comment'
- begin: (,)\s*((?!\S)|(?=\/\/))
- begin: (,)\s*(?=$|\/\/)
beginCaptures:
'1': { name: punctuation.separator.comma.ts }
end: (?<!,)(((?==|;|}|({{startOfIdentifier}}(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))
@ -299,7 +299,7 @@ repository:
'1': { name: keyword.control.export.ts }
'2': { name: storage.modifier.ts }
'3': { name: storage.type.ts }
end: (?!{{constExprStart}})((?=;|}|({{startOfIdentifier}}(of|in)\s+)|{{endOfStatement}})|((?<!{{lookBehindConst}})(?=\s*$)))
end: (?!{{constExprStart}})((?=^|;|}|({{startOfIdentifier}}(of|in)\s+)|{{endOfStatement}})|((?<!{{lookBehindConst}})(?=\s*$)))
patterns:
- begin: '{{constExprStart}}\s*'
beginCaptures:
@ -311,7 +311,7 @@ repository:
- include: '#var-single-const'
- include: '#variable-initializer'
- include: '#comment'
- begin: (,)\s*((?!\S)|(?=\/\/))
- begin: (,)\s*(?=$|\/\/)
beginCaptures:
'1': { name: punctuation.separator.comma.ts }
end: (?<!,)(((?==|;|}|({{startOfIdentifier}}(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))
@ -331,7 +331,7 @@ repository:
beginCaptures:
'1': { name: meta.definition.variable.ts entity.name.function.ts }
'2': { name: keyword.operator.definiteassignment.ts }
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+))|({{endOfStatement}})
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+)|({{endOfStatement}}))
patterns:
- include: '#var-single-variable-type-annotation'
- name: meta.var-single-variable.expr.ts
@ -339,7 +339,7 @@ repository:
beginCaptures:
'1': { name: meta.definition.variable.ts variable.other.constant.ts }
'2': { name: keyword.operator.definiteassignment.ts }
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+))|({{endOfStatement}})
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+)|({{endOfStatement}}))
patterns:
- include: '#var-single-variable-type-annotation'
- name: meta.var-single-variable.expr.ts
@ -347,7 +347,7 @@ repository:
beginCaptures:
'1': { name: meta.definition.variable.ts variable.other.readwrite.ts }
'2': { name: keyword.operator.definiteassignment.ts }
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+))|({{endOfStatement}})
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+)|({{endOfStatement}}))
patterns:
- include: '#var-single-variable-type-annotation'
@ -358,14 +358,14 @@ repository:
(?x)({{identifier}})(?={{functionLikeAssignmentOrType}})
beginCaptures:
'1': { name: meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts }
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+))|({{endOfStatement}})
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+)|({{endOfStatement}}))
patterns:
- include: '#var-single-variable-type-annotation'
- name: meta.var-single-variable.expr.ts
begin: ({{identifier}})
beginCaptures:
'1': { name: meta.definition.variable.ts variable.other.constant.ts }
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+))|({{endOfStatement}})
end: (?=$|^|[;,=}]|({{startOfIdentifier}}(of|in)\s+)|({{endOfStatement}}))
patterns:
- include: '#var-single-variable-type-annotation'

Просмотреть файл

@ -429,7 +429,7 @@
<key>begin</key>
<string>(?=(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))</string>
<key>end</key>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))</string>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=^|;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))</string>
<key>patterns</key>
<array>
<dict>
@ -474,7 +474,7 @@
</dict>
<dict>
<key>begin</key>
<string>(,)\s*((?!\S)|(?=\/\/))</string>
<string>(,)\s*(?=$|\/\/)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -539,7 +539,7 @@
</dict>
</dict>
<key>end</key>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^const|[^\._$[:alnum:]]const)(?=\s*$)))</string>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=^|;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^const|[^\._$[:alnum:]]const)(?=\s*$)))</string>
<key>patterns</key>
<array>
<dict>
@ -584,7 +584,7 @@
</dict>
<dict>
<key>begin</key>
<string>(,)\s*((?!\S)|(?=\/\/))</string>
<string>(,)\s*(?=$|\/\/)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -719,7 +719,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -747,7 +747,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -775,7 +775,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -873,7 +873,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -896,7 +896,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>

Просмотреть файл

@ -433,7 +433,7 @@
<key>begin</key>
<string>(?=(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))</string>
<key>end</key>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))</string>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=^|;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))</string>
<key>patterns</key>
<array>
<dict>
@ -478,7 +478,7 @@
</dict>
<dict>
<key>begin</key>
<string>(,)\s*((?!\S)|(?=\/\/))</string>
<string>(,)\s*(?=$|\/\/)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -543,7 +543,7 @@
</dict>
</dict>
<key>end</key>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^const|[^\._$[:alnum:]]const)(?=\s*$)))</string>
<string>(?!(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=^|;|}|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))|((?&lt;!^const|[^\._$[:alnum:]]const)(?=\s*$)))</string>
<key>patterns</key>
<array>
<dict>
@ -588,7 +588,7 @@
</dict>
<dict>
<key>begin</key>
<string>(,)\s*((?!\S)|(?=\/\/))</string>
<string>(,)\s*(?=$|\/\/)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -727,7 +727,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -755,7 +755,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -783,7 +783,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -885,7 +885,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>
@ -908,7 +908,7 @@
</dict>
</dict>
<key>end</key>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+))|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b))</string>
<string>(?=$|^|[;,=}]|((?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(of|in)\s+)|(;|^\s*$|(?:^\s*(?:abstract|async|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|var|while)\b)))</string>
<key>patterns</key>
<array>
<dict>

Просмотреть файл

@ -0,0 +1,60 @@
original file
-----------------------------------
let abc: string
abc.prop
let abc, def: string
abc.prop
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>let abc: string
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.annotation.ts
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.annotation.ts support.type.primitive.ts
>abc.prop
^^^
source.ts variable.other.object.ts
^
source.ts punctuation.accessor.ts
^^^^
source.ts variable.other.property.ts
>
^
source.ts
>let abc, def: string
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts
^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.annotation.ts
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.annotation.ts support.type.primitive.ts
>abc.prop
^^^
source.ts variable.other.object.ts
^
source.ts punctuation.accessor.ts
^^^^
source.ts variable.other.property.ts

Просмотреть файл

@ -213,10 +213,8 @@ Grammar: TypeScript.tmLanguage
source.ts meta.var.expr.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts punctuation.separator.comma.ts
^^
^^^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.constant.ts
^

5
tests/cases/Issue975.ts Normal file
Просмотреть файл

@ -0,0 +1,5 @@
let abc: string
abc.prop
let abc, def: string
abc.prop