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

Quick fixes for multiple required arguments could be more useful #49775

Open
matanlurey opened this issue Aug 20, 2022 · 1 comment
Open

Quick fixes for multiple required arguments could be more useful #49775

matanlurey opened this issue Aug 20, 2022 · 1 comment
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@matanlurey
Copy link
Contributor

void example() {
  // https://dart.dev/tools/diagnostic-messages#missing_required_argument
  Listener();
}

class Listener {
  final void Function() onA;
  final void Function(String) onB;
  final void Function(String, String) onC;

  Listener({
    required this.onA,
    required this.onB,
    required this.onC,
  });
}

... produces the following quick-fixes:

I would have assumed Add all required arguments was an available quick fix, but it was not.

@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Aug 20, 2022
@scheglov scheglov added P3 A lower priority bug or feature request analyzer-quick-fix labels Aug 22, 2022
@jonahwilliams
Copy link
Contributor

When dealing with a class with a lot of named parameters - like widgets, I find myself copying and pasting other instances of that widget and filling in the differences. As error prone as that is, it feels 10x faster than trying to correctly autocomplete and quickfix a new instance.

@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants