Skip to content

Named Parameters: a Smarter & Useful Code Completion #3588

Open
@Ale-Digitale

Description

@Ale-Digitale

If you try to invoke code completion on Widgets' Constructors Named Parameters, you get a suggestion list that you can filter by:

  • Alphabetically ( useful only if you DO REMEMBER what you have to complete the code with )

  • by Relevance ( I wonder... how this "relevance" is being generated ? Randomly ? 😁 )

Let's make some examples. I expect to have INTELLIJ suggesting me:

for Padding::

  • EdgeInsets.only
  • EdgeInsets.all
  • ... and so on

for Decoration: (inside a Container)

  • BoxDecoration
  • ... and so on

for Decoration: (inside a Textfield)

  • InputDecoration
  • ... and so on

for Margin:

  • EdgeInsets.only
  • EdgeInsets.all
  • ... and so on

Instead, now, regardless of the named parameter you're trying to complete, we got:

Build (BuildContext context)
new
this
false
null

What are these actually useful for ? You aren't going to complete your code with them. They're like "noise" for you... while you're trying to remember what you must put there in your code.

So, right now, code-completion for many named parameters, is almost completely useless, or at least, it's very very inefficient.

I think a named-parameters-aware-auto-completion would lead to:

  • FASTER CODING
  • HELPING ( especially beginners ) to remember things, speeding up the steep learning curve
  • OPTIMIZE TIME, avoiding hours spent bouncing back and forth between IDE and API Docs

So, i wonder, isn't there a way to prioritize the useful auto-completion results and list them by REAL EFFECTIVE USEFULNESS ? In such a way that the auto completion suggests you the things that are compatible / pertinent to the code where you invoked it.

Please someone let me know. Thank you !

( @scheglov sorry for the disturb, I mention you because I just did a search and i found this: #998 ... but as I can see things are still unchanged since last year. Is anyone taking this topic forward ? )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions