Skip to content

Improve args handling #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 69 additions & 29 deletions baselines/CommentsInDeclarations.hx.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ interface /**/ ITest /**/ extends /**/ IBase /**/ {} /**/
typedef /**/ WinHandle /**/ = /**/ hl.Abstract /**/ <@:const 5 /**/>;
enum Color /**/ </**/ T> /**/ {} /**/

public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "",
/**/ @:const value2:T2 = SomeClass.Constant,
value2:/**/{ /**/ ?foo /**/ : /**/ Dynamic /**/ <String> /**/ }):Void
public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "" /**/,
/**/ @:const /**/ value2:T2 = SomeClass.Constant,
value2:/**/{ /**/ ?foo /**/ : /**/ Dynamic /**/ <String> /**/ }, /**/.../**/args:Rest/**/):Void
{
}

-----------------------------------

>class /**/ Main /**/ extends /**/ openfl.display.DisplayObject /**/ {} /**/
Expand Down Expand Up @@ -325,7 +326,7 @@ public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "",
>
^
source.hx
>public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "",
>public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "" /**/,
^^^^^^
source.hx storage.modifier.hx
^
Expand Down Expand Up @@ -394,7 +395,13 @@ public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "",
source.hx meta.method.hx meta.parameters.hx string.quoted.double.hx punctuation.definition.string.end.hx
^
source.hx meta.method.hx meta.parameters.hx
> /**/ @:const value2:T2 = SomeClass.Constant,
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^
source.hx meta.method.hx meta.parameters.hx
> /**/ @:const /**/ value2:T2 = SomeClass.Constant,
^^^^
source.hx meta.method.hx meta.parameters.hx
^^
Expand All @@ -409,27 +416,33 @@ public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "",
source.hx meta.method.hx meta.parameters.hx storage.modifier.metadata.hx
^
source.hx meta.method.hx meta.parameters.hx
^^^^^^
source.hx meta.method.hx meta.parameters.hx variable.parameter.hx
^
source.hx meta.method.hx meta.parameters.hx keyword.operator.type.annotation.hx
^^
source.hx meta.method.hx meta.parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.parameters.hx
^
source.hx meta.method.hx meta.parameters.hx keyword.operator.assignment.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^
source.hx meta.method.hx meta.parameters.hx
^^^^^^
source.hx meta.method.hx meta.parameters.hx variable.parameter.hx
^
source.hx meta.method.hx meta.parameters.hx
^^^^^^^^^
source.hx meta.method.hx meta.parameters.hx keyword.operator.type.annotation.hx
^^
source.hx meta.method.hx meta.parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.parameters.hx support.package.hx
^^^^^^^^
source.hx meta.method.hx meta.parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.parameters.hx
> value2:/**/{ /**/ ?foo /**/ : /**/ Dynamic /**/ <String> /**/ }):Void
^
source.hx meta.method.hx meta.parameters.hx
^
source.hx meta.method.hx meta.parameters.hx keyword.operator.assignment.hx
^
source.hx meta.method.hx meta.parameters.hx
^^^^^^^^^
source.hx meta.method.hx meta.parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.parameters.hx support.package.hx
^^^^^^^^
source.hx meta.method.hx meta.parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.parameters.hx
> value2:/**/{ /**/ ?foo /**/ : /**/ Dynamic /**/ <String> /**/ }, /**/.../**/args:Rest/**/):Void
^^^^
source.hx meta.method.hx meta.parameters.hx
^^^^^^
Expand Down Expand Up @@ -499,14 +512,41 @@ public function dispatch2(/**/?/**/value1/**/:/**/T1/**/<T2>/**/ = /**/ "",
^
source.hx meta.method.hx meta.parameters.hx meta.block.hx punctuation.definition.block.end.hx
^
source.hx meta.method.hx meta.parameters.hx punctuation.definition.parameters.end.hx
source.hx meta.method.hx meta.parameters.hx
^
source.hx meta.method.hx keyword.operator.type.annotation.hx
^^^^
source.hx meta.method.hx support.class.builtin.hx
source.hx meta.method.hx meta.parameters.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^^
source.hx meta.method.hx meta.parameters.hx keyword.operator.rest.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^^^
source.hx meta.method.hx meta.parameters.hx variable.parameter.hx
^
source.hx meta.method.hx meta.parameters.hx keyword.operator.type.annotation.hx
^^^^
source.hx meta.method.hx meta.parameters.hx entity.name.type.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^
source.hx meta.method.hx meta.parameters.hx punctuation.definition.parameters.end.hx
^
source.hx meta.method.hx keyword.operator.type.annotation.hx
^^^^
source.hx meta.method.hx support.class.builtin.hx
>{
^
source.hx meta.method.hx punctuation.definition.block.begin.hx
>}
^
source.hx meta.method.hx meta.method.block.hx punctuation.definition.block.end.hx
source.hx meta.method.hx meta.method.block.hx punctuation.definition.block.end.hx
>
^
source.hx
108 changes: 108 additions & 0 deletions baselines/Issue39.hx.baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
original file
-----------------------------------
@:put('/thumbnail')
function uploadThumbnail(/* body:RealSource */):Promise<OutgoingResponse>;

@:get
function image():Promise<OutgoingResponse>;

-----------------------------------

>@:put('/thumbnail')
^
source.hx punctuation.metadata.hx
^^^^
source.hx variable.metadata.hx
^
source.hx meta.brace.round.hx
^
source.hx string.quoted.single.hx punctuation.definition.string.begin.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx
^
source.hx string.quoted.single.hx punctuation.definition.string.end.hx
^
source.hx meta.brace.round.hx
>function uploadThumbnail(/* body:RealSource */):Promise<OutgoingResponse>;
^^^^^^^^
source.hx meta.method.hx storage.type.function.hx
^
source.hx meta.method.hx
^^^^^^^^^^^^^^^
source.hx meta.method.hx entity.name.function.hx
^
source.hx meta.method.hx meta.parameters.hx punctuation.definition.parameters.begin.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^^^^^^^^^^^^^^^^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx
^^
source.hx meta.method.hx meta.parameters.hx comment.block.hx punctuation.definition.comment.hx
^
source.hx meta.method.hx meta.parameters.hx punctuation.definition.parameters.end.hx
^
source.hx meta.method.hx keyword.operator.type.annotation.hx
^^^^^^^
source.hx meta.method.hx entity.name.type.hx
^
source.hx meta.method.hx meta.type-parameters.hx punctuation.definition.typeparameters.begin.hx
^^^^^^^^^^^^^^^^
source.hx meta.method.hx meta.type-parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.type-parameters.hx punctuation.definition.typeparameters.end.hx
^
source.hx meta.method.hx punctuation.terminator.hx
>
^
source.hx
>@:get
^
source.hx punctuation.metadata.hx
^
source.hx variable.metadata.hx
^^^
source.hx variable.metadata.hx
>function image():Promise<OutgoingResponse>;
^^^^^^^^
source.hx meta.method.hx storage.type.function.hx
^
source.hx meta.method.hx
^^^^^
source.hx meta.method.hx entity.name.function.hx
^
source.hx meta.method.hx meta.parameters.hx punctuation.definition.parameters.begin.hx
^
source.hx meta.method.hx meta.parameters.hx punctuation.definition.parameters.end.hx
^
source.hx meta.method.hx keyword.operator.type.annotation.hx
^^^^^^^
source.hx meta.method.hx entity.name.type.hx
^
source.hx meta.method.hx meta.type-parameters.hx punctuation.definition.typeparameters.begin.hx
^^^^^^^^^^^^^^^^
source.hx meta.method.hx meta.type-parameters.hx entity.name.type.hx
^
source.hx meta.method.hx meta.type-parameters.hx punctuation.definition.typeparameters.end.hx
^
source.hx meta.method.hx punctuation.terminator.hx
>
^
source.hx
Loading