Skip to content

[Declaring Constructors] Navigation with primary_constructor fragments #61809

@FMorschel

Description

@FMorschel

While reading dart-lang/language#4496 I came up with a question regarding navigation. Consider:

class C(final int x, final int y) {}

class D(super.x, super.y) extends C {
  @metadata
  this: assert(x != y) {
    print(x);
  }
}

I don't think there is (or that it makes any sense to have) a rule in the proposed syntax about the init block being the first thing in the class body (CC @eernstg @lrhn, can either of you confirm this, please? Thanks).

Now I was thinking about a similar thing to what was proposed in #54742 for navigation. Where we could display a "button" of sorts to navigate between the two. Especially if the init block is moved to the bottom of the class.

We can, of course, wait for this syntax to be fully defined before we start doing anything around here. This is simply so we don't forget to raise this question.

CC @DanTup @bwilkerson

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-navigationfeature-declaring-constructorsImplementation of the declaring constructors feature. Otherwise known as primary constructors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions