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

add lambda completion for positional arguments #40202

Closed
pq opened this issue Jan 17, 2020 · 9 comments
Closed

add lambda completion for positional arguments #40202

pq opened this issue Jan 17, 2020 · 9 comments
Assignees
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@pq
Copy link
Member

pq commented Jan 17, 2020

Tracking issue for positional argument support for function body completion; follow-up from #25267.

@pq pq added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-completion Issues with the analysis server's code completion feature labels Jan 17, 2020
@pq pq self-assigned this Jan 17, 2020
@pq
Copy link
Member Author

pq commented Jan 17, 2020

FWIW, some progress...

where_lambda

@shinayser
Copy link

SOMEONE GIVE AN OSCAR TO THIS GUY

@shinayser
Copy link

shinayser commented Jan 17, 2020

One suggestion, if there is only one parameter, why not just call it it like in kotlin?

@greglittlefield-wf
Copy link
Contributor

Hey @shinayser, there's actually an existing language issue for that: dart-lang/language#265

@pq
Copy link
Member Author

pq commented Jan 17, 2020

@shinayser: I like the idea of (at least) abbreviating the param name (e.g., element => e).

fyi @devoncarew @InMatrix @bwilkerson (as this pertains to an ongoing discussion around "personalized completions").

@shinayser
Copy link

@pq Instead of trying to figure out what is the best case, isn't possible to leave that choice to the user?
I mean. There is a way to set the desired behavior on the pubspec.yaml?

  • Full parameter name
  • Abbreviated
  • it

@pq
Copy link
Member Author

pq commented Jan 17, 2020

isn't possible to leave that choice to the user?

This is exactly one of the ideas up for discussion. (See #40207 for a little more conversation.)

Thanks for chiming in!

@shinayser
Copy link

shinayser commented Feb 7, 2020

@pq I don't know if the problem is on my environment, but I am receiving no completion suggestions for optional positional arguments, like:

image

It should suggest () => or () { } , shouldn't?

My sdk version is:
Dart VM version: 2.8.0-dev.8.0 (Thu Feb 6 15:47:55 2020 +0100) on "windows_x64"

@pq
Copy link
Member Author

pq commented Feb 7, 2020

Ah, yes. Confirmed. This is a slightly different issue (with a different solution) than the cases above but for sure something we should support.

@shinayser: would you mind opening a fresh issue and cc'ing me? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

3 participants