Handle the parameter name scoping in function type

Fixes #629
This commit is contained in:
Sheetal Nandi 2018-06-14 12:55:37 -07:00
Родитель 5629dc0e73
Коммит 9a52efafc4
5 изменённых файлов: 461 добавлений и 10 удалений

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

@ -94,11 +94,7 @@ variables:
{{arrowLookup}}
))
)
functionLikeAssignmentOrType: |-
\s*
# function assignment |
(={{functionOrArrowLookup}}) |
# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
functionLikeType: |-
(:\s*(
(<) |
([(]\s*(
@ -110,6 +106,13 @@ variables:
))
))
)) |
(:\s*{{possiblyMultilineArrow}})
functionLikeAssignmentOrType: |-
\s*
# function assignment |
(={{functionOrArrowLookup}}) |
# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
{{functionLikeType}} |
(:\s*(=>|{{matchingParenthesis}}|(<[^<>]*>)|[^<>(),=])+={{functionOrArrowLookup}})
arrowFunctionEnd: (?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))
@ -2027,8 +2030,28 @@ 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}})
captures:
'1': { name: storage.modifier.ts }
'2': { name: keyword.operator.rest.ts }
'3': { name: entity.name.function.ts variable.language.this.ts }
'4': { name: entity.name.function.ts }
'5': { name: keyword.operator.optional.ts }
- match: |-
(?x)(?:{{startOfIdentifier}}(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:){{startOfIdentifier}}(?:(this)|({{identifier}}))\s*(\??)(?=:)
captures:
'1': { name: storage.modifier.ts }
'2': { name: keyword.operator.rest.ts }
'3': { name: variable.parameter.ts variable.language.this.ts }
'4': { name: variable.parameter.ts }
'5': { name: keyword.operator.optional.ts }
- include: '#type-annotation'
- name: punctuation.separator.parameter.ts
match: ','
- include: '#type'
- include: '#function-parameters'
type-fn-type-parameters:
patterns:

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

@ -526,6 +526,7 @@
))
))
)) |
(:\s*((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*)?[\(]\s*([\{\[]\s*)?$)) |
(:\s*(=&gt;|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(&lt;[^&lt;&gt;]*&gt;)|[^&lt;&gt;(),=])+=\s*(
((async\s+)?(
(function\s*[(&lt;*]) |
@ -971,6 +972,7 @@
))
))
)) |
(:\s*((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*)?[\(]\s*([\{\[]\s*)?$)) |
(:\s*(=&gt;|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(&lt;[^&lt;&gt;]*&gt;)|[^&lt;&gt;(),=])+=\s*(
((async\s+)?(
(function\s*[(&lt;*]) |
@ -1439,6 +1441,7 @@
))
))
)) |
(:\s*((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*)?[\(]\s*([\{\[]\s*)?$)) |
(:\s*(=&gt;|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(&lt;[^&lt;&gt;]*&gt;)|[^&lt;&gt;(),=])+=\s*(
((async\s+)?(
(function\s*[(&lt;*]) |
@ -5911,11 +5914,96 @@
<array>
<dict>
<key>include</key>
<string>#type</string>
<string>#destructuring-parameter</string>
</dict>
<dict>
<key>match</key>
<string>(?x)(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?&lt;!=|:)(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
(&lt;) |
([(]\s*(
([)]) |
(\.\.\.) |
([_$[:alnum:]]+\s*(
([:,?=])|
([)]\s*=&gt;)
))
))
)) |
(:\s*((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*)?[\(]\s*([\{\[]\s*)?$)))</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function.ts variable.language.this.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.function.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator.optional.ts</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>(?x)(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?&lt;!=|:)(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=:)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.parameter.ts variable.language.this.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>variable.parameter.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator.optional.ts</string>
</dict>
</dict>
</dict>
<dict>
<key>include</key>
<string>#function-parameters</string>
<string>#type-annotation</string>
</dict>
<dict>
<key>name</key>
<string>punctuation.separator.parameter.ts</string>
<key>match</key>
<string>,</string>
</dict>
<dict>
<key>include</key>
<string>#type</string>
</dict>
</array>
</dict>

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

@ -530,6 +530,7 @@
))
))
)) |
(:\s*([\(]\s*([\{\[]\s*)?$)) |
(:\s*(=&gt;|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(&lt;[^&lt;&gt;]*&gt;)|[^&lt;&gt;(),=])+=\s*(
((async\s+)?(
(function\s*[(&lt;*]) |
@ -975,6 +976,7 @@
))
))
)) |
(:\s*([\(]\s*([\{\[]\s*)?$)) |
(:\s*(=&gt;|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(&lt;[^&lt;&gt;]*&gt;)|[^&lt;&gt;(),=])+=\s*(
((async\s+)?(
(function\s*[(&lt;*]) |
@ -1443,6 +1445,7 @@
))
))
)) |
(:\s*([\(]\s*([\{\[]\s*)?$)) |
(:\s*(=&gt;|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(&lt;[^&lt;&gt;]*&gt;)|[^&lt;&gt;(),=])+=\s*(
((async\s+)?(
(function\s*[(&lt;*]) |
@ -5857,11 +5860,96 @@
<array>
<dict>
<key>include</key>
<string>#type</string>
<string>#destructuring-parameter</string>
</dict>
<dict>
<key>match</key>
<string>(?x)(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?&lt;!=|:)(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
(&lt;) |
([(]\s*(
([)]) |
(\.\.\.) |
([_$[:alnum:]]+\s*(
([:,?=])|
([)]\s*=&gt;)
))
))
)) |
(:\s*([\(]\s*([\{\[]\s*)?$)))</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function.tsx variable.language.this.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.function.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator.optional.tsx</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>(?x)(?:(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?&lt;!=|:)(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=:)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>variable.parameter.tsx variable.language.this.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>variable.parameter.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>keyword.operator.optional.tsx</string>
</dict>
</dict>
</dict>
<dict>
<key>include</key>
<string>#function-parameters</string>
<string>#type-annotation</string>
</dict>
<dict>
<key>name</key>
<string>punctuation.separator.parameter.tsx</string>
<key>match</key>
<string>,</string>
</dict>
<dict>
<key>include</key>
<string>#type</string>
</dict>
</array>
</dict>

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

@ -0,0 +1,234 @@
original file
-----------------------------------
class c {
private _forEachCell(
terminal: ITerminal,
firstRow: number,
lastRow: number,
callback: (
code: number,
char: string,
width: number,
x: number,
y: number,
fg: number,
bg: number,
flags: number
) => void
): void {
}
}
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>class c {
^^^^^
source.ts meta.class.ts storage.type.class.ts
^
source.ts meta.class.ts
^
source.ts meta.class.ts entity.name.type.class.ts
^
source.ts meta.class.ts
^
source.ts meta.class.ts punctuation.definition.block.ts
> private _forEachCell(
^
source.ts meta.class.ts
^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts storage.modifier.ts
^
source.ts meta.class.ts meta.method.declaration.ts
^^^^^^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.definition.method.ts entity.name.function.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
> terminal: ITerminal,
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts
^^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts entity.name.type.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts punctuation.separator.parameter.ts
> firstRow: number,
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts
^^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts punctuation.separator.parameter.ts
> lastRow: number,
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts
^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts punctuation.separator.parameter.ts
> callback: (
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts
^^^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts entity.name.function.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.brace.round.ts
> code: number,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> char: string,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> width: number,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> x: number,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> y: number,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> fg: number,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> bg: number,
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts punctuation.separator.parameter.ts
> flags: number
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts variable.parameter.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.type.annotation.ts support.type.primitive.ts
> ) => void
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.paren.cover.ts meta.brace.round.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.function.return.ts storage.type.function.arrow.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.function.return.ts
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.function.return.ts support.type.primitive.ts
> ): void {
^^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.return.type.ts keyword.operator.type.annotation.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.return.type.ts
^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.return.type.ts support.type.primitive.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.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 punctuation.definition.block.ts
>}
^
source.ts meta.class.ts punctuation.definition.block.ts

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

@ -0,0 +1,18 @@
class c {
private _forEachCell(
terminal: ITerminal,
firstRow: number,
lastRow: number,
callback: (
code: number,
char: string,
width: number,
x: number,
y: number,
fg: number,
bg: number,
flags: number
) => void
): void {
}
}