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

Customize position of the constructor when creating constructor for the final fields #2937

Closed
orestesgaolin opened this issue Nov 5, 2020 · 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

@orestesgaolin
Copy link

Is your feature request related to a problem? Please describe.

Dart Code allows to create constructor for the final fields. It puts it by default below the fields.

CleanShot 2020-11-05 at 18 17 22

Describe the solution you'd like

I would like to be able to customize position of the constructor when it's generated. It could be either set by the analyzer lint rule sort_constructors_first or by a switch in extension settings.

Describe alternatives you've considered

Manually moving constructor to the top of the class.

Additional context

There's a popular lint rule sort_constructors_first that enforces ordering constructor at the top.

@DanTup DanTup added in lsp/analysis server Something to be fixed in the Dart analysis server in editor Relates to code editing or language features labels Nov 9, 2020
@DanTup DanTup added this to the On Deck milestone Nov 9, 2020
@DanTup DanTup modified the milestones: On Deck, v3.23.0 May 24, 2021
dart-bot pushed a commit to dart-lang/sdk that referenced this issue May 24, 2021
…tors

Fixes Dart-Code/Dart-Code#2937.

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

DanTup commented May 24, 2021

Fixed by dart-lang/sdk@899654d. As it's in the language server, it'll show up in a future Dart/Flutter SDK release (not the VS Code extension release).

@DanTup DanTup closed this as completed May 24, 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