Skip to content

Super class code completion #3734

Closed
Closed

Description

@cedvdb

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()
}

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Dec 16, 2021
  2. DanTup commented on Dec 21, 2021

    @DanTup
    Member

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

    Thanks!

  3. added this to the v3.32.0 milestone on Dec 21, 2021
  4. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    on Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions