flutter-intellij: Code completing a named parameter doesn't show me the types that could go there
I wonder if we could show all the types of Decoration we have, when trying to code complete decoration:
in a Container?
Here’s what we see now:
Those options aren’t useful, unfortunately. However, since we know that decoration:
takes a Decoration
, could we show the options for Decoration here? (e.g. BoxDecoration)
I’m still learning the Flutter APIs, and bouncing back and forth between API docs and my IDE is less than efficient. I want to code complete my way to success! 😃
Thanks!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 36 (19 by maintainers)
Commits related to this issue
- Filter constructor completions by required type. R=brianwilkerson@google.com, devoncarew@google.com Bug: https://github.com/flutter/flutter-intellij/issues/998 Change-Id: I88eb345bfa7f0a65d135e5fdcb... — committed to dart-lang/sdk by scheglov 6 years ago
- Don't suggest generative constructors of abstract classes. So, we don't suggest EdgeInsetsGeometry for 'padding: ', even though it is the type of the parameters. But we still suggest its subclasses E... — committed to dart-lang/sdk by scheglov 6 years ago
- Suggest constructors for implicit creation in previewDart2. R=brianwilkerson@google.com Bug: https://github.com/flutter/flutter-intellij/issues/998 Change-Id: I43270f47fb43402d1a9e0f7d9814494ffd83bb... — committed to dart-lang/sdk by scheglov 6 years ago
- Set higher relevance for exact type and subtype completions. Exact type get the largest relevance boost, subtypes a smaller boost, and the rest has default relevance for its element kind. R=brianwil... — committed to dart-lang/sdk by scheglov 6 years ago
- Suggest enum constants for imported enums. So, you can complete `Column(crossAxisAlignment: ^)` and get all of the CrossAxisAlignment right away for selection. Or you can start typing `center` and by... — committed to dart-lang/sdk by scheglov 6 years ago
+1 for sorting matching types higher!
This sounds like a pretty elegant solution - we’ll still show all correct suggestions (and allow users to compete through a few expressions to their end goal) but will show the most immediately useful suggestions first.
IMO it’s all about the “relevance” of the suggestion. In this situation, types that match should have a higher relevance than suggestions that do not, and the IDE should display suggestions ranked by the relevance returned by the analysis server… more relevant suggestions first.
https://dart-review.googlesource.com/c/sdk/+/42882
Without the change:
With the change: