Родитель
355ee0e1ad
Коммит
07819cfcb8
|
@ -2219,7 +2219,7 @@ repository:
|
|||
begin: (:)(?=\s*\S)
|
||||
beginCaptures:
|
||||
'1': { name: keyword.operator.type.annotation.ts }
|
||||
end: (?<![:|&])((?=$|^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))
|
||||
end: (?<![:|&])(?!\s*[|&]\s+)((?=^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))
|
||||
patterns:
|
||||
- include: '#type'
|
||||
# if type starts on next line use modified line endings as end of type annotation eg. complete empty line
|
||||
|
|
|
@ -6776,7 +6776,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?<![:|&])((?=$|^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))</string>
|
||||
<string>(?<![:|&])(?!\s*[|&]\s+)((?=^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
|
|
@ -6724,7 +6724,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?<![:|&])((?=$|^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))</string>
|
||||
<string>(?<![:|&])(?!\s*[|&]\s+)((?=^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
|
|
@ -114,23 +114,23 @@ Grammar: TypeScript.tmLanguage
|
|||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts string.quoted.single.ts punctuation.definition.string.end.ts
|
||||
> | 'a2' // oh , the color is not good !
|
||||
^^^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts keyword.operator.type.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts keyword.operator.type.ts
|
||||
^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts string.quoted.single.ts punctuation.definition.string.begin.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts string.quoted.single.ts punctuation.definition.string.begin.ts
|
||||
^^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts string.quoted.single.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts string.quoted.single.ts
|
||||
^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts string.quoted.single.ts punctuation.definition.string.end.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts string.quoted.single.ts punctuation.definition.string.end.ts
|
||||
^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts comment.line.double-slash.ts punctuation.definition.comment.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts comment.line.double-slash.ts punctuation.definition.comment.ts
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts comment.line.double-slash.ts
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts meta.field.declaration.ts comment.line.double-slash.ts
|
||||
> | 'a3' // oh , the color is not good !
|
||||
^^^
|
||||
source.ts meta.interface.ts meta.field.declaration.ts meta.type.annotation.ts meta.object.type.ts
|
||||
|
|
|
@ -168,7 +168,7 @@ Grammar: TypeScript.tmLanguage
|
|||
source.ts meta.var.expr.ts meta.object.type.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.object.type.ts meta.type.annotation.ts keyword.operator.ternary.ts
|
||||
^
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.object.type.ts meta.type.annotation.ts
|
||||
> () => void;
|
||||
^^^^^^
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
type Foo = {
|
||||
bar: number
|
||||
| string;
|
||||
};
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>type Foo = {
|
||||
^^^^
|
||||
source.ts meta.type.declaration.ts storage.type.type.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts
|
||||
^^^
|
||||
source.ts meta.type.declaration.ts entity.name.type.alias.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts punctuation.definition.block.ts
|
||||
> bar: number
|
||||
^^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts
|
||||
^^^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.definition.property.ts variable.object.property.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^^^^^^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts support.type.primitive.ts
|
||||
> | string;
|
||||
^^^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts keyword.operator.type.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^^^^^^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts support.type.primitive.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts punctuation.terminator.statement.ts
|
||||
>};
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.object.type.ts punctuation.definition.block.ts
|
||||
^
|
||||
source.ts punctuation.terminator.statement.ts
|
|
@ -0,0 +1,44 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
export let a: string
|
||||
| boolean | number;
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>export let a: string
|
||||
^^^^^^
|
||||
source.ts meta.var.expr.ts keyword.control.export.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^^^
|
||||
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
|
||||
> | boolean | number;
|
||||
^^^^
|
||||
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 keyword.operator.type.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
|
||||
^
|
||||
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 keyword.operator.type.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
|
||||
^
|
||||
source.ts punctuation.terminator.statement.ts
|
|
@ -0,0 +1,4 @@
|
|||
type Foo = {
|
||||
bar: number
|
||||
| string;
|
||||
};
|
|
@ -0,0 +1,2 @@
|
|||
export let a: string
|
||||
| boolean | number;
|
Загрузка…
Ссылка в новой задаче