Sdk: add lambda completion for positional arguments

Created on 17 Jan 2020  路  9Comments  路  Source: dart-lang/sdk

Tracking issue for positional argument support for function body completion; follow-up from https://github.com/dart-lang/sdk/issues/25267.

analyzer-completion area-analyzer

Most helpful comment

SOMEONE GIVE AN OSCAR TO THIS GUY

All 9 comments

FWIW, some progress...

where_lambda

SOMEONE GIVE AN OSCAR TO THIS GUY

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

Hey @shinayser, there's actually an existing language issue for that: https://github.com/dart-lang/language/issues/265

@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").

@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

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!

@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"

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!

Was this page helpful?
0 / 5 - 0 ratings