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

Super class code completion #3734

Closed
cedvdb opened this issue Dec 16, 2021 · 1 comment
Closed

Super class code completion #3734

cedvdb opened this issue Dec 16, 2021 · 1 comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Milestone

Comments

@cedvdb
Copy link

cedvdb commented Dec 16, 2021

Currently when extending a class it is very tedious to pass each parameters to the super constructor.

This feature dart-lang/language#1855 will resolve most of the verbosity, however code completion should go a step further and be able to generate a constructor with super parameters

class House {
  final int windows;
  House({required this.windows});
}

class TestHouse extends House {
   // proposed, compiles
   TestHouse({super.windows});
   // alternatively
   TestHouse({int windows}) : super(windows: windows);
   // currently, which does not compile
   TestHouse() : super()
}
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Dec 21, 2021
…r constructor calls

Fixes Dart-Code/Dart-Code#3734.

Change-Id: I5dcae267b4989a5244c0704a4ddedba5409b2ce6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Dec 21, 2021

Fixed by dart-lang/sdk@8e40705, with dart-lang/sdk#47979 raised about supporting super initializers when available.

Thanks!

@DanTup DanTup added this to the v3.32.0 milestone Dec 21, 2021
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Dec 21, 2021
@DanTup DanTup closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants