Many irrelevant suggestions appear, and they may be autoselected by default, when using optional parameters
See original GitHub issueHere, I created a Flutter stateless widget with the stless snippet, and after typing appBar:
the first suggestion is stless
and I have to scroll all the way up to see the AppBar()
suggestion.
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: ,
);
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Dealing with Optional Parameters in Go | by Peter Malina
Legend says Go does not support optional parameters or method overloading, as it may be confusing or fragile in practice. However, there are...
Read more >Optional Parameters in Go? - Stack Overflow
Go doesn't support optional parameters , default values and function overloading but you can use some tricks to implement the same.
Read more >Named and Optional Arguments - C# Programming Guide
Named arguments in C# specify arguments by name, not position. Optional arguments can be omitted.
Read more >Create a Query Suggestions index for InstantSearch.js - Algolia
By default, the Query Suggestions builder indexes all popular searches that meet the default configuration values as suggestions. Without ...
Read more >Using Python Optional Arguments When Defining Functions
In this tutorial, you'll learn about Python optional arguments and how to define functions with default values. You'll also learn how to create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s often valid to type these items, because you could be writing something like:
or
Snippets are also always valid, because their contents could contain anything (for example you could have a snippet of code that returns a decoration).
The completion options actually from from the SDK so any changes would need to be made there (though based on the above, I don’t think the things you want to go away will). They are sorted by a rank, however, so it’s possible that could be tuned if there are items that should be at the top that are appearing down the list.
Unfortunately VS code has many defaults that result in quirks like this (which is why I’ve started collecting them in the recommended settings page, which we may point users at in the future). The issue isn’t isolated to Dart, TypeScript has exactly the same thing:
If you think the default in VS Code should be changed, you could open an issue in the VS Code repo (I’d certainly 👍 it if you post the link here - it makes me sad that we need to document all the “bad” defaults for reasons like this).
I’ve added this to the recommended settings page but I don’t think there’s anything more I can do here. Even the TypeScript extension has had the same issue reported, and the fix is to modify the setting. I agree this isn’t great, but I don’t want to override peoples settings.