Родитель
15b157d42e
Коммит
59b62cbc62
|
@ -190,8 +190,12 @@ repository:
|
|||
'2': { name: entity.name.label.ts }
|
||||
- name: keyword.control.loop.ts
|
||||
match: '{{startOfIdentifier}}(break|continue|do|goto|while){{endOfIdentifier}}'
|
||||
- name: keyword.control.flow.ts
|
||||
match: '{{startOfIdentifier}}(return){{endOfIdentifier}}'
|
||||
- begin: '{{startOfIdentifier}}(return){{endOfIdentifier}}'
|
||||
beginCaptures:
|
||||
'0': { name: keyword.control.flow.ts }
|
||||
end: (?=[;}]|$|{{endOfStatement}})
|
||||
patterns:
|
||||
- include: '#expression'
|
||||
- name: keyword.control.switch.ts
|
||||
match: '{{startOfIdentifier}}(case|default|switch){{endOfIdentifier}}'
|
||||
- include: '#if-statement'
|
||||
|
|
|
@ -184,10 +184,25 @@
|
|||
<string>(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.flow.ts</string>
|
||||
<key>match</key>
|
||||
<key>begin</key>
|
||||
<string>(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.flow.ts</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=[;}]|$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#expression</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
|
|
|
@ -184,10 +184,25 @@
|
|||
<string>(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.flow.tsx</string>
|
||||
<key>match</key>
|
||||
<key>begin</key>
|
||||
<string>(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.flow.tsx</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=[;}]|$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#expression</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
|
|
|
@ -123,7 +123,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
@ -184,7 +184,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
@ -1027,7 +1027,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
@ -1086,7 +1086,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
|
|
@ -139,7 +139,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.class.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.class.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
@ -202,7 +202,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.class.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.class.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
|
|
@ -87,7 +87,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
> [
|
||||
|
|
|
@ -51,7 +51,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
|
|
@ -50,7 +50,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
|
|
@ -58,7 +58,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^
|
||||
source.ts meta.function.ts meta.block.ts keyword.operator.ternary.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
function test(type, obj) {
|
||||
return type in obj && 'broken';
|
||||
}
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>function test(type, obj) {
|
||||
^^^^^^^^
|
||||
source.ts meta.function.ts storage.type.function.ts
|
||||
^
|
||||
source.ts meta.function.ts
|
||||
^^^^
|
||||
source.ts meta.function.ts meta.definition.function.ts entity.name.function.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
|
||||
^^^^
|
||||
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.parameters.ts punctuation.separator.parameter.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.parameters.ts
|
||||
^^^
|
||||
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
|
||||
^
|
||||
source.ts meta.function.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
|
||||
> return type in obj && 'broken';
|
||||
^^
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^^^^
|
||||
source.ts meta.function.ts meta.block.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.operator.expression.in.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^^^
|
||||
source.ts meta.function.ts meta.block.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.operator.logical.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts string.quoted.single.ts punctuation.definition.string.begin.ts
|
||||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts string.quoted.single.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts string.quoted.single.ts punctuation.definition.string.end.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts punctuation.terminator.statement.ts
|
||||
>}
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
|
|
@ -70,7 +70,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
> x: {
|
||||
|
|
|
@ -443,7 +443,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
^
|
||||
|
|
|
@ -66,7 +66,7 @@ Grammar: TypeScript.tmLanguage
|
|||
^^^^^^
|
||||
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts
|
||||
source.ts meta.function.ts meta.block.ts
|
||||
^
|
||||
source.ts meta.function.ts meta.block.ts meta.objectliteral.ts punctuation.definition.block.ts
|
||||
> x: {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
function test(type, obj) {
|
||||
return type in obj && 'broken';
|
||||
}
|
Загрузка…
Ссылка в новой задаче