Skip to content
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

[display] @signature completion and unnamed arguments #6064

Closed
nadako opened this issue Feb 28, 2017 · 7 comments
Closed

[display] @signature completion and unnamed arguments #6064

nadako opened this issue Feb 28, 2017 · 7 comments
Labels
feature-ide IDE / Editor support

Comments

@nadako
Copy link
Member

nadako commented Feb 28, 2017

Haxe returns the following for @signature completion for callback types (and thus empty argument names):

"{"signatures":[{"label":"(:Int, :Int):Void","parameters":[{"label":":Int"},{"label":":Int"}]}],"activeParameter":0,"activeSignature":0}"

Not technically wrong, but looks ugly and makes VS Code go crazy:

Before @signature was a thing, I solved that by adding generic a,b,c,etc. names to unnamed arguments. Maybe we should do the same for @signature too. Thoughts? @Simn @Gama11

@nadako nadako added the feature-ide IDE / Editor support label Feb 28, 2017
@nadako
Copy link
Member Author

nadako commented Feb 28, 2017

I guess I'll work this around by injecting argument names on haxe-languageserver for now.

Gama11 added a commit to vshaxe/haxe-language-server that referenced this issue Mar 1, 2017
@Simn
Copy link
Member

Simn commented Mar 2, 2017

I don't think Haxe should invent names here. It's up to the IDE how it wants to display this case.

@Simn Simn closed this as completed Mar 2, 2017
@nadako
Copy link
Member Author

nadako commented Mar 2, 2017

In this case I'd argue that the output should be properly structured instead of spitting out weird concatenated strings, which is not much better than we had before format-wise.

@nadako
Copy link
Member Author

nadako commented Mar 2, 2017

People really shouldn't have to do this: vshaxe/haxe-language-server@942470d#diff-bdfa664c96d8ab764d530048de8ed45dR47

@Simn
Copy link
Member

Simn commented Mar 2, 2017

What's wrong with s.charAt(0) == ":" ? invented + s : s?

@Gama11
Copy link
Member

Gama11 commented Mar 2, 2017

That works for the parameters, but not the label:

"label":"(:Int, :Int):Void"

@Simn
Copy link
Member

Simn commented Mar 2, 2017

Yes I agree that requires more structure. If only we had JSON output for types...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-ide IDE / Editor support
Projects
None yet
Development

No branches or pull requests

3 participants