File tree Expand file tree Collapse file tree 4 files changed +1193
-1157
lines changed
lib/src/services/correction
test/src/services/correction/fix Expand file tree Collapse file tree 4 files changed +1193
-1157
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ class CreateMethodOrFunction extends ResolvedCorrectionProducer {
27
27
28
28
factory CreateMethodOrFunction ({required CorrectionProducerContext context}) {
29
29
if (context is StubCorrectionProducerContext ) {
30
- return CreateMethodOrFunction ._(context: context);
30
+ return CreateMethodOrFunction ._(
31
+ context: context,
32
+ fixKind: DartFixKind .CREATE_FUNCTION_TEAROFF ,
33
+ );
31
34
}
32
35
33
36
if (context.node case SimpleIdentifier node) {
@@ -54,18 +57,21 @@ class CreateMethodOrFunction extends ResolvedCorrectionProducer {
54
57
targetElement: targetElement,
55
58
fixKind:
56
59
targetElement is InterfaceElement
57
- ? DartFixKind .CREATE_METHOD
58
- : DartFixKind .CREATE_FUNCTION ,
60
+ ? DartFixKind .CREATE_METHOD_TEAROFF
61
+ : DartFixKind .CREATE_FUNCTION_TEAROFF ,
59
62
);
60
63
}
61
64
62
- return CreateMethodOrFunction ._(context: context);
65
+ return CreateMethodOrFunction ._(
66
+ context: context,
67
+ fixKind: DartFixKind .CREATE_FUNCTION_TEAROFF ,
68
+ );
63
69
}
64
70
65
71
CreateMethodOrFunction ._({
66
72
required super .context,
67
73
Element ? targetElement,
68
- this .fixKind = DartFixKind . CREATE_METHOD ,
74
+ required this .fixKind,
69
75
}) : _targetElement = targetElement;
70
76
71
77
@override
Original file line number Diff line number Diff line change @@ -808,6 +808,11 @@ abstract final class DartFixKind {
808
808
DartFixKindPriority .standard - 1 ,
809
809
"Create function '{0}'" ,
810
810
);
811
+ static const CREATE_FUNCTION_TEAROFF = FixKind (
812
+ 'dart.fix.create.function.tearoff' ,
813
+ DartFixKindPriority .standard - 1 ,
814
+ "Create function '{0}'" ,
815
+ );
811
816
static const CREATE_GETTER = FixKind (
812
817
'dart.fix.create.getter' ,
813
818
DartFixKindPriority .standard,
@@ -823,6 +828,11 @@ abstract final class DartFixKind {
823
828
DartFixKindPriority .standard,
824
829
"Create method '{0}'" ,
825
830
);
831
+ static const CREATE_METHOD_TEAROFF = FixKind (
832
+ 'dart.fix.create.method.tearoff' ,
833
+ DartFixKindPriority .standard,
834
+ "Create method '{0}'" ,
835
+ );
826
836
827
837
// TODO(pq): used by LintNames.hash_and_equals; consider removing.
828
838
static const CREATE_METHOD_MULTI = FixKind (
You can’t perform that action at this time.
0 commit comments