Handle new line in variable initializer when expression ends with arrow operator
Fixes #702
This commit is contained in:
Родитель
9f36bf286d
Коммит
f17fefd8d6
|
@ -631,7 +631,7 @@ repository:
|
|||
variable-initializer:
|
||||
patterns:
|
||||
# if it is assignment with expression on same line, use end of line as end of scope
|
||||
- begin: (?<!=|!)(=)(?!=)(?=\s*\S)
|
||||
- begin: (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)
|
||||
beginCaptures:
|
||||
'1': { name: keyword.operator.assignment.ts }
|
||||
end: (?=$|^|[,);}\]]|(\s+(of|in)\s+))
|
||||
|
|
|
@ -1994,7 +1994,7 @@
|
|||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<!=|!)(=)(?!=)(?=\s*\S)</string>
|
||||
<string>(?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -1998,7 +1998,7 @@
|
|||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<!=|!)(=)(?!=)(?=\s*\S)</string>
|
||||
<string>(?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
const t = () =>
|
||||
`a`
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>const t = () =>
|
||||
^^^^^
|
||||
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.constant.ts entity.name.function.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.end.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts
|
||||
^^
|
||||
source.ts meta.var.expr.ts meta.arrow.ts storage.type.function.arrow.ts
|
||||
>`a`
|
||||
^
|
||||
source.ts meta.var.expr.ts string.template.ts punctuation.definition.string.template.begin.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts string.template.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts string.template.ts punctuation.definition.string.template.end.ts
|
|
@ -0,0 +1,2 @@
|
|||
const t = () =>
|
||||
`a`
|
Загрузка…
Ссылка в новой задаче