Skip to content

Commit a59bae3

Browse files
bwilkersonCommit Queue
authored andcommitted
Cleanup code in analysis_server_plugin
Change-Id: I596a5a516136b4bd024b8f72b11df6eb641075ee Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412680 Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Phil Quitslund <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent e9683ac commit a59bae3

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

pkg/analysis_server/lib/src/services/correction/dart/change_to.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class ChangeTo extends ResolvedCorrectionProducer {
167167
} else if (targetIdentifierElement is ExtensionElement2) {
168168
_updateFinderWithExtensionMembers(finder, targetIdentifierElement);
169169
} else {
170-
var interfaceElement = getTargetInterfaceElement2(target);
170+
var interfaceElement = getTargetInterfaceElement(target);
171171
if (interfaceElement != null) {
172172
_updateFinderWithClassMembers(finder, interfaceElement);
173173
}

pkg/analysis_server/lib/src/services/correction/dart/create_field.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ class CreateField extends CreateFieldOrGetter {
2121

2222
@override
2323
CorrectionApplicability get applicability =>
24-
// TODO(applicability): comment on why.
25-
CorrectionApplicability
26-
.singleLocation;
24+
// TODO(applicability): comment on why.
25+
CorrectionApplicability.singleLocation;
2726

2827
@override
2928
List<String> get fixArguments => [_fieldName];
@@ -156,7 +155,7 @@ class CreateField extends CreateFieldOrGetter {
156155
var staticModifier = false;
157156
InterfaceElement2? targetClassElement;
158157
if (target != null) {
159-
targetClassElement = getTargetInterfaceElement2(target);
158+
targetClassElement = getTargetInterfaceElement(target);
160159
// Maybe static.
161160
if (target is Identifier) {
162161
var targetIdentifier = target;

pkg/analysis_server/lib/src/services/correction/dart/create_method.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class CreateMethod extends ResolvedCorrectionProducer {
133133
staticModifier = inStaticContext;
134134
}
135135
} else {
136-
var targetClassElement = getTargetInterfaceElement2(target);
136+
var targetClassElement = getTargetInterfaceElement(target);
137137
if (targetClassElement == null) {
138138
return;
139139
}

pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ abstract class ResolvedCorrectionProducer
458458

459459
/// Returns the class element associated with the [target], or `null` if there
460460
/// is no such element.
461-
InterfaceElement2? getTargetInterfaceElement2(Expression target) {
461+
InterfaceElement2? getTargetInterfaceElement(Expression target) {
462462
var type = target.staticType;
463463
if (type is InterfaceType) {
464464
return type.element3;

pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class AnalyzerConverter {
238238
return null;
239239
}
240240

241-
parameters.sort(_preferRequiredParams2);
241+
parameters.sort(_preferRequiredParams);
242242

243243
var sb = StringBuffer();
244244
var closeOptionalString = '';
@@ -370,7 +370,7 @@ class AnalyzerConverter {
370370
}
371371

372372
/// Sort required named parameters before optional ones.
373-
int _preferRequiredParams2(
373+
int _preferRequiredParams(
374374
analyzer.FormalParameterElement e1,
375375
analyzer.FormalParameterElement e2,
376376
) {

pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class InheritedReferenceContributor
4545
return;
4646
}
4747
containingLibrary = request.result.libraryElement2;
48-
_computeSuggestionsForClass2(
48+
_computeSuggestionsForClass(
4949
collector, target, classDecl.declaredFragment!.element, optype);
5050
}
5151

@@ -73,7 +73,7 @@ class InheritedReferenceContributor
7373
classElement = classDecl.declaredFragment!.element;
7474
}
7575
containingLibrary = request.result.libraryElement2;
76-
_computeSuggestionsForClass2(collector, target, classElement, optype,
76+
_computeSuggestionsForClass(collector, target, classElement, optype,
7777
skipChildClass: skipChildClass);
7878
}
7979

@@ -104,7 +104,7 @@ class InheritedReferenceContributor
104104
}
105105
}
106106

107-
void _computeSuggestionsForClass2(CompletionCollector collector,
107+
void _computeSuggestionsForClass(CompletionCollector collector,
108108
CompletionTarget target, ClassElement2 classElement, OpType optype,
109109
{bool skipChildClass = true}) {
110110
var isFunctionalArgument = target.isFunctionalArgument();

0 commit comments

Comments
 (0)