-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
Description
Using Dart SDK version: 3.11.0-190.0.dev (dev) (Mon Dec 1 04:03:43 2025 -0800) on "windows_x64"
The following code:
class Foo {
Foo({required int foo, required int foobar});
}shows two assists, both named "Bind all parameters to fields". with the second one only binding one parameter to a field.

But it looks like an assist with a correct text ("Bind parameter to field") exists:
sdk/pkg/analysis_server/lib/src/services/correction/assist.dart
Lines 39 to 48 in a5fe41a
| static const bindAllToFields = AssistKind( | |
| 'dart.assist.bindAllToFields', | |
| DartAssistKindPriority.default_, | |
| 'Bind all parameters to fields', | |
| ); | |
| static const bindToField = AssistKind( | |
| 'dart.assist.bindToField', | |
| DartAssistKindPriority.default_, | |
| 'Bind parameter to field', | |
| ); |
Furthermore, selecting the second assist on foo, creates this:
The placeholder-thingies where I can enter a different type or name are misplaced.
If I select the first "Bind all parameters to fields" assist, it creates this abomination:
class Foo {
Foo({required this.foo, required this.bar});
is.nar}oo;
int bar;
}More parameters create a greater mess.
Metadata
Metadata
Assignees
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.