-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the method declaration detection to handle complete typeparameter…
… list on single line Fixes #720
- Loading branch information
1 parent
31b00a7
commit d8c9720
Showing
5 changed files
with
188 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
original file | ||
----------------------------------- | ||
class Bar { | ||
myFunc1 = () => | ||
1 < 2 && | ||
2 > 1 && | ||
FOO < FOOO; | ||
myFunc2 = () => | ||
1 < 2 && | ||
2 > 1 && | ||
FOO < FOOO; | ||
} | ||
----------------------------------- | ||
|
||
Grammar: TypeScript.tmLanguage | ||
----------------------------------- | ||
>class Bar { | ||
^^^^^ | ||
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 | ||
> myFunc1 = () => | ||
^^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^^^^^^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.definition.property.ts entity.name.function.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts keyword.operator.assignment.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.begin.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.end.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts | ||
^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts storage.type.function.arrow.ts | ||
> 1 < 2 && | ||
^^^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts keyword.operator.relational.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^^ | ||
source.ts meta.class.ts meta.field.declaration.ts keyword.operator.logical.ts | ||
> 2 > 1 && | ||
^^^^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts keyword.operator.relational.ts | ||
^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts | ||
^^ | ||
source.ts meta.class.ts keyword.operator.logical.ts | ||
> FOO < FOOO; | ||
^^^^ | ||
source.ts meta.class.ts | ||
^^^ | ||
source.ts meta.class.ts variable.other.constant.ts | ||
^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts keyword.operator.relational.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^^^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.definition.property.ts variable.object.property.ts | ||
^ | ||
source.ts meta.class.ts punctuation.terminator.statement.ts | ||
> myFunc2 = () => | ||
^^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^^^^^^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.definition.property.ts entity.name.function.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts keyword.operator.assignment.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.begin.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts meta.parameters.ts punctuation.definition.parameters.end.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts | ||
^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts storage.type.function.arrow.ts | ||
> 1 < 2 && | ||
^^^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.arrow.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts keyword.operator.relational.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^^ | ||
source.ts meta.class.ts meta.field.declaration.ts keyword.operator.logical.ts | ||
> 2 > 1 && | ||
^^^^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts keyword.operator.relational.ts | ||
^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts constant.numeric.decimal.ts | ||
^ | ||
source.ts meta.class.ts | ||
^^ | ||
source.ts meta.class.ts keyword.operator.logical.ts | ||
> FOO < FOOO; | ||
^^^^ | ||
source.ts meta.class.ts | ||
^^^ | ||
source.ts meta.class.ts variable.other.constant.ts | ||
^ | ||
source.ts meta.class.ts | ||
^ | ||
source.ts meta.class.ts keyword.operator.relational.ts | ||
^ | ||
source.ts meta.class.ts meta.field.declaration.ts | ||
^^^^ | ||
source.ts meta.class.ts meta.field.declaration.ts meta.definition.property.ts variable.object.property.ts | ||
^ | ||
source.ts meta.class.ts punctuation.terminator.statement.ts | ||
>} | ||
^ | ||
source.ts meta.class.ts punctuation.definition.block.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Bar { | ||
myFunc1 = () => | ||
1 < 2 && | ||
2 > 1 && | ||
FOO < FOOO; | ||
myFunc2 = () => | ||
1 < 2 && | ||
2 > 1 && | ||
FOO < FOOO; | ||
} |