Fixed incorrectly matched destructuring parametes in type declaration.
Fixes #675
This commit is contained in:
Родитель
8beee84dc9
Коммит
8980e4be2d
|
@ -2176,7 +2176,6 @@ repository:
|
|||
endCaptures:
|
||||
'0': { name: meta.brace.round.ts }
|
||||
patterns:
|
||||
- include: '#destructuring-parameter'
|
||||
#parameter name only if followed by type annotation
|
||||
- match: |-
|
||||
(?x)(?:{{startOfIdentifier}}(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:){{startOfIdentifier}}(?:(this)|({{identifier}}))\s*(\??)(?=\s*{{functionLikeType}})
|
||||
|
|
|
@ -6448,10 +6448,6 @@
|
|||
</dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#destructuring-parameter</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
|
||||
|
|
|
@ -6394,10 +6394,6 @@
|
|||
</dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#destructuring-parameter</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
type T = { a: number } & ({ b: number })
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>type T = { a: number } & ({ b: number })
|
||||
^^^^
|
||||
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
|
||||
^
|
||||
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
|
||||
^
|
||||
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 punctuation.definition.block.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts keyword.operator.type.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.brace.round.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.object.type.ts punctuation.definition.block.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.object.type.ts meta.field.declaration.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.object.type.ts meta.field.declaration.ts meta.definition.property.ts variable.object.property.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.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.type.paren.cover.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^^^^^^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts support.type.primitive.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.object.type.ts punctuation.definition.block.ts
|
||||
^
|
||||
source.ts meta.type.declaration.ts meta.type.paren.cover.ts meta.brace.round.ts
|
|
@ -0,0 +1 @@
|
|||
type T = { a: number } & ({ b: number })
|
Загрузка…
Ссылка в новой задаче