Version 2.18.0-8.0.dev
Merge commit 'dafe4704772281576f6cc0d5c293a9fbae60e204' into 'dev'
diff --git a/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart b/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
index f0d8533..d394ef0 100644
--- a/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
+++ b/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
@@ -76,7 +76,7 @@
var stopwatch = Stopwatch()..start();
Future _complete(int offset) async {
- await test.complete(filePath, offset);
+ await test.complete(filePath, offset, isWarmUp: false);
completionCount++;
}
diff --git a/pkg/analysis_server/benchmark/perf/flutter_completion_benchmark.dart b/pkg/analysis_server/benchmark/perf/flutter_completion_benchmark.dart
index a874443..a2fe460 100644
--- a/pkg/analysis_server/benchmark/perf/flutter_completion_benchmark.dart
+++ b/pkg/analysis_server/benchmark/perf/flutter_completion_benchmark.dart
@@ -144,10 +144,6 @@
// about all these libraries. We change a method body, so the API
// signature is the same, and we are able to reload these libraries
// from bytes. But this still costs something.
- // There is also a spill-over from the previous test - we send a lot
- // (about 5MB) of available declarations after each change. This makes
- // completion response times very large.
- // TODO(scheglov) Remove the previous sentence when improved.
// Total number of suggestions: 3429.
// Filtered to: 133.
// Long name: completion-mediumLibraryCycle-mediumFile-smallBody
@@ -219,7 +215,7 @@
await test.openFile(filePath, fileContent);
- Future<void> perform() async {
+ Future<void> perform({required bool isWarmUp}) async {
var completionOffset = prefixEnd;
if (insertStringGenerator != null) {
@@ -234,7 +230,7 @@
);
}
- await test.complete(filePath, completionOffset);
+ await test.complete(filePath, completionOffset, isWarmUp: isWarmUp);
if (insertStringGenerator != null) {
await test.updateFile(filePath, fileContent);
@@ -246,13 +242,13 @@
// The sustained performance is much more important.
const kWarmUpCount = 5;
for (var i = 0; i < kWarmUpCount; i++) {
- await perform();
+ await perform(isWarmUp: true);
}
const kRepeatCount = 5;
final timer = Stopwatch()..start();
for (var i = 0; i < kRepeatCount; i++) {
- await perform();
+ await perform(isWarmUp: false);
}
await test.closeFile(filePath);
diff --git a/pkg/analysis_server/benchmark/perf/memory_tests.dart b/pkg/analysis_server/benchmark/perf/memory_tests.dart
index 307b009..7836814 100644
--- a/pkg/analysis_server/benchmark/perf/memory_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/memory_tests.dart
@@ -21,7 +21,7 @@
abstract class AbstractBenchmarkTest {
Future<void> get analysisFinished;
Future<void> closeFile(String filePath);
- Future<void> complete(String filePath, int offset);
+ Future<void> complete(String filePath, int offset, {required bool isWarmUp});
void debugStdio();
Future<int> getMemoryUsage();
Future<void> openFile(String filePath, String contents);
@@ -44,22 +44,13 @@
_test.sendAnalysisUpdateContent({filePath: RemoveContentOverlay()});
@override
- Future<void> complete(String filePath, int offset) async {
- // Create a new non-broadcast stream and subscribe to
- // test.onCompletionResults before sending a request.
- // Otherwise we could skip results which where posted to
- // test.onCompletionResults after request is sent but
- // before subscribing to test.onCompletionResults.
- final completionResults = StreamController<CompletionResultsParams>();
- completionResults.sink.addStream(_test.onCompletionResults);
-
- var result = await _test.sendCompletionGetSuggestions(filePath, offset);
-
- var future = completionResults.stream
- .where((CompletionResultsParams params) =>
- params.id == result.id && params.isLast)
- .first;
- await future;
+ Future<void> complete(
+ String filePath,
+ int offset, {
+ required bool isWarmUp,
+ }) async {
+ await _test.sendCompletionGetSuggestions2(filePath, offset, 100,
+ timeout: isWarmUp ? 60 * 1000 : 0);
}
@override
@@ -80,7 +71,6 @@
_test.dartSdkPath = dartSdkPath;
await _test.setUp();
await _test.subscribeToStatusNotifications();
- await _test.subscribeToAvailableSuggestions();
await _test.sendAnalysisSetAnalysisRoots(roots, []);
}
@@ -129,16 +119,6 @@
/// After every test, the server is stopped.
Future shutdown() async => await shutdownIfNeeded();
- /// Enable using available suggestions during completion.
- Future<void> subscribeToAvailableSuggestions() async {
- await server.send(
- 'completion.setSubscriptions',
- CompletionSetSubscriptionsParams(
- [CompletionService.AVAILABLE_SUGGESTION_SETS],
- ).toJson(),
- );
- }
-
/// Enable [ServerService.STATUS] notifications so that [analysisFinished]
/// can be used.
Future subscribeToStatusNotifications() async {
@@ -168,7 +148,7 @@
}
@override
- Future<void> complete(String filePath, int offset) {
+ Future<void> complete(String filePath, int offset, {required bool isWarmUp}) {
final contents = _fileContents[filePath]!;
final position = _test.positionFromOffset(offset, contents);
return _test.getCompletion(Uri.file(filePath), position);
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 2b8352b..ef379b2 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -320,51 +320,25 @@
/// Handle a [request] that was read from the communication channel.
void handleRequest(Request request) {
performance.logRequestTiming(request.clientRequestTime);
+ // Because we don't `await` the execution of the handlers, we wrap the
+ // execution in order to have one central place to handle exceptions.
runZonedGuarded(() {
var cancellationToken = CancelableToken();
cancellationTokens[request.id] = cancellationToken;
var generator = handlerGenerators[request.method];
if (generator != null) {
- try {
- var handler = generator(this, request, cancellationToken);
- handler.handle();
- } on InconsistentAnalysisException {
- sendResponse(Response.contentModified(request));
- } on RequestFailure catch (exception) {
- sendResponse(exception.response);
- } catch (exception, stackTrace) {
- var error =
- RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
- error.stackTrace = stackTrace.toString();
- var response = Response(request.id, error: error);
- sendResponse(response);
- }
+ var handler = generator(this, request, cancellationToken);
+ handler.handle();
} else {
// TODO(brianwilkerson) When all the handlers are in [handlerGenerators]
// remove local variable and for loop below.
var count = handlers.length;
for (var i = 0; i < count; i++) {
- try {
- var response =
- handlers[i].handleRequest(request, cancellationToken);
- if (response == Response.DELAYED_RESPONSE) {
- return;
- }
- if (response != null) {
- sendResponse(response);
- return;
- }
- } on InconsistentAnalysisException {
- sendResponse(Response.contentModified(request));
+ var response = handlers[i].handleRequest(request, cancellationToken);
+ if (response == Response.DELAYED_RESPONSE) {
return;
- } on RequestFailure catch (exception) {
- sendResponse(exception.response);
- return;
- } catch (exception, stackTrace) {
- var error = RequestError(
- RequestErrorCode.SERVER_ERROR, exception.toString());
- error.stackTrace = stackTrace.toString();
- var response = Response(request.id, error: error);
+ }
+ if (response != null) {
sendResponse(response);
return;
}
@@ -372,15 +346,28 @@
sendResponse(Response.unknownRequest(request));
}
}, (exception, stackTrace) {
- instrumentationService.logException(
- FatalException(
- 'Failed to handle request: ${request.method}',
- exception,
- stackTrace,
- ),
- null,
- crashReportingAttachmentsBuilder.forException(exception),
- );
+ if (exception is InconsistentAnalysisException) {
+ sendResponse(Response.contentModified(request));
+ } else if (exception is RequestFailure) {
+ sendResponse(exception.response);
+ } else {
+ // Log the exception.
+ instrumentationService.logException(
+ FatalException(
+ 'Failed to handle request: ${request.method}',
+ exception,
+ stackTrace,
+ ),
+ null,
+ crashReportingAttachmentsBuilder.forException(exception),
+ );
+ // Then return an error response to the client.
+ var error =
+ RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
+ error.stackTrace = stackTrace.toString();
+ var response = Response(request.id, error: error);
+ sendResponse(response);
+ }
});
}
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index c63b5e7..00f542e 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -86,75 +86,75 @@
/// A list of the generators used to produce assists.
static const List<ProducerGenerator> generators = [
- AddDiagnosticPropertyReference.newInstance,
- AddNotNullAssert.newInstance,
- AddReturnType.newInstance,
- AddTypeAnnotation.newInstanceBulkFixable,
- AssignToLocalVariable.newInstance,
- ConvertAddAllToSpread.newInstance,
- ConvertClassToEnum.newInstance,
- ConvertClassToMixin.newInstance,
- ConvertConditionalExpressionToIfElement.newInstance,
- ConvertDocumentationIntoBlock.newInstance,
- ConvertDocumentationIntoLine.newInstance,
- ConvertIntoAsyncBody.newInstance,
- ConvertIntoBlockBody.newInstance,
- ConvertIntoFinalField.newInstance,
- ConvertIntoForIndex.newInstance,
- ConvertIntoGetter.newInstance,
- ConvertIntoIsNot.newInstance,
- ConvertIntoIsNotEmpty.newInstance,
- ConvertMapFromIterableToForLiteral.newInstance,
- ConvertPartOfToUri.newInstance,
- ConvertToDoubleQuotes.newInstance,
- ConvertToExpressionFunctionBody.newInstance,
- ConvertToFieldParameter.newInstance,
- ConvertToGenericFunctionSyntax.newInstance,
- ConvertToIntLiteral.newInstance,
- ConvertToListLiteral.newInstance,
- ConvertToMapLiteral.newInstance,
- ConvertToMultilineString.newInstance,
- ConvertToNormalParameter.newInstance,
- ConvertToNullAware.newInstance,
- ConvertToPackageImport.newInstance,
- ConvertToRelativeImport.newInstance,
- ConvertToSetLiteral.newInstance,
- ConvertToSingleQuotes.newInstance,
- ConvertToSuperParameters.newInstance,
- EncapsulateField.newInstance,
- ExchangeOperands.newInstance,
- FlutterConvertToChildren.newInstance,
- FlutterConvertToStatefulWidget.newInstance,
- FlutterMoveDown.newInstance,
- FlutterMoveUp.newInstance,
- FlutterRemoveWidget.newInstance,
- FlutterSwapWithChild.newInstance,
- FlutterSwapWithParent.newInstance,
- FlutterWrapBuilder.newInstance,
- FlutterWrapGeneric.newInstance,
- FlutterWrapStreamBuilder.newInstance,
- ImportAddShow.newInstance,
- InlineInvocation.newInstance,
- IntroduceLocalCastType.newInstance,
- InvertIfStatement.newInstance,
- JoinIfWithInner.newInstance,
- JoinIfWithOuter.newInstance,
- JoinVariableDeclaration.newInstance,
- RemoveTypeAnnotation.newInstance,
- ReplaceConditionalWithIfElse.newInstance,
- ReplaceIfElseWithConditional.newInstance,
- ReplaceWithVar.newInstance,
- ShadowField.newInstance,
- SortChildPropertyLast.newInstance,
- SplitAndCondition.newInstance,
- SplitVariableDeclaration.newInstance,
- UseCurlyBraces.newInstance,
+ AddDiagnosticPropertyReference.new,
+ AddNotNullAssert.new,
+ AddReturnType.new,
+ AddTypeAnnotation.bulkFixable,
+ AssignToLocalVariable.new,
+ ConvertAddAllToSpread.new,
+ ConvertClassToEnum.new,
+ ConvertClassToMixin.new,
+ ConvertConditionalExpressionToIfElement.new,
+ ConvertDocumentationIntoBlock.new,
+ ConvertDocumentationIntoLine.new,
+ ConvertIntoAsyncBody.new,
+ ConvertIntoBlockBody.new,
+ ConvertIntoFinalField.new,
+ ConvertIntoForIndex.new,
+ ConvertIntoGetter.new,
+ ConvertIntoIsNot.new,
+ ConvertIntoIsNotEmpty.new,
+ ConvertMapFromIterableToForLiteral.new,
+ ConvertPartOfToUri.new,
+ ConvertToDoubleQuotes.new,
+ ConvertToExpressionFunctionBody.new,
+ ConvertToFieldParameter.new,
+ ConvertToGenericFunctionSyntax.new,
+ ConvertToIntLiteral.new,
+ ConvertToListLiteral.new,
+ ConvertToMapLiteral.new,
+ ConvertToMultilineString.new,
+ ConvertToNormalParameter.new,
+ ConvertToNullAware.new,
+ ConvertToPackageImport.new,
+ ConvertToRelativeImport.new,
+ ConvertToSetLiteral.new,
+ ConvertToSingleQuotes.new,
+ ConvertToSuperParameters.new,
+ EncapsulateField.new,
+ ExchangeOperands.new,
+ FlutterConvertToChildren.new,
+ FlutterConvertToStatefulWidget.new,
+ FlutterMoveDown.new,
+ FlutterMoveUp.new,
+ FlutterRemoveWidget.new,
+ FlutterSwapWithChild.new,
+ FlutterSwapWithParent.new,
+ FlutterWrapBuilder.new,
+ FlutterWrapGeneric.new,
+ FlutterWrapStreamBuilder.new,
+ ImportAddShow.new,
+ InlineInvocation.new,
+ IntroduceLocalCastType.new,
+ InvertIfStatement.new,
+ JoinIfWithInner.new,
+ JoinIfWithOuter.new,
+ JoinVariableDeclaration.new,
+ RemoveTypeAnnotation.new,
+ ReplaceConditionalWithIfElse.new,
+ ReplaceIfElseWithConditional.new,
+ ReplaceWithVar.new,
+ ShadowField.new,
+ SortChildPropertyLast.new,
+ SplitAndCondition.new,
+ SplitVariableDeclaration.new,
+ UseCurlyBraces.new,
];
/// A list of the multi-generators used to produce assists.
static const List<MultiProducerGenerator> multiGenerators = [
- FlutterWrap.newInstance,
- SurroundWith.newInstance,
+ FlutterWrap.new,
+ SurroundWith.new,
];
final DartAssistContext assistContext;
diff --git a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
index 3104866..05fdc77 100644
--- a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
+++ b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
@@ -48,7 +48,7 @@
static const Map<ErrorCode, List<MultiProducerGenerator>>
nonLintMultiProducerMap = {
CompileTimeErrorCode.EXTENDS_NON_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
// TODO(brianwilkerson) The following fix fails if an invocation of the
// function is the argument that needs to be removed.
@@ -61,67 +61,67 @@
// DataDriven.newInstance,
// ],
CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.INVALID_OVERRIDE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.MIXIN_OF_NON_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_FUNCTION: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_GETTER: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_METHOD: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_SETTER: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.DEPRECATED_MEMBER_USE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD: [
- DataDriven.newInstance,
+ DataDriven.new,
],
};
@@ -320,15 +320,15 @@
// apply it first.
var context = correctionContext(definingUnit, directivesOrderingError);
if (context != null) {
- await _generateFix(context, OrganizeImports.newInstance(),
+ await _generateFix(context, OrganizeImports(),
directivesOrderingError.errorCode.name);
}
} else {
for (var error in unusedImportErrors) {
var context = correctionContext(definingUnit, error);
if (context != null) {
- await _generateFix(context, RemoveUnusedImport.newInstance(),
- error.errorCode.name);
+ await _generateFix(
+ context, RemoveUnusedImport(), error.errorCode.name);
}
}
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart
index 2ba981e..a26c922 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart
@@ -16,7 +16,9 @@
final bool isForMissingReturn;
/// Initialize a newly created producer.
- AddAsync(this.isForMissingReturn);
+ AddAsync() : isForMissingReturn = false;
+
+ AddAsync.missingReturn() : isForMissingReturn = true;
@override
// Not predictably the correct action.
@@ -77,12 +79,6 @@
}
return false;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddAsync missingReturn() => AddAsync(true);
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddAsync newInstance() => AddAsync(false);
}
/// An AST visitor used to find return statements in function bodies.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_await.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_await.dart
index b04494a..889c88c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_await.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_await.dart
@@ -26,7 +26,4 @@
builder.addSimpleInsertion(node.offset, 'await ');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddAwait newInstance() => AddAwait();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_const.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_const.dart
index de6f8d5..9d288c9 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_const.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_const.dart
@@ -92,9 +92,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddConst newInstance() => AddConst();
}
class _ConstRangeFinder extends RecursiveAstVisitor<void> {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart
index af2fe16..efb33d2 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart
@@ -213,8 +213,4 @@
bool _isIterable(DartType type) {
return type.asInstanceOf(typeProvider.iterableElement) != null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddDiagnosticPropertyReference newInstance() =>
- AddDiagnosticPropertyReference();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_eol_at_end_of_file.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_eol_at_end_of_file.dart
index 3dd8cad..bf5ed76 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_eol_at_end_of_file.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_eol_at_end_of_file.dart
@@ -35,7 +35,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddEolAtEndOfFile newInstance() => AddEolAtEndOfFile();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart
index 612635d..54a7bce 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart
@@ -135,7 +135,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddExplicitCast newInstance() => AddExplicitCast();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_field_formal_parameters.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_field_formal_parameters.dart
index c392597..b2e5dbe 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_field_formal_parameters.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_field_formal_parameters.dart
@@ -88,7 +88,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddFieldFormalParameters newInstance() => AddFieldFormalParameters();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart
index f55c2e9..c8320f8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart
@@ -172,7 +172,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddKeyToConstructors newInstance() => AddKeyToConstructors();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart
index 733d4ea..35d0f87 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart
@@ -91,7 +91,4 @@
builder.addSimpleInsertion(offset, 'late ');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddLate newInstance() => AddLate();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_leading_newline_to_string.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_leading_newline_to_string.dart
index d078389..4d8d622 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_leading_newline_to_string.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_leading_newline_to_string.dart
@@ -32,7 +32,4 @@
builder.addSimpleInsertion(stringLiteral.contentsOffset, eol);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddLeadingNewlineToString newInstance() => AddLeadingNewlineToString();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart
index 61fbebc..41b97d1 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart
@@ -94,7 +94,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddMissingEnumCaseClauses newInstance() => AddMissingEnumCaseClauses();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart
index c383fc4..a6fb1cd 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart
@@ -102,8 +102,4 @@
}
return constantNames;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddMissingEnumLikeCaseClauses newInstance() =>
- AddMissingEnumLikeCaseClauses();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart
index 04adf5d..41b6c47 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart
@@ -36,9 +36,6 @@
yield _AddMissingOptionalPositionalParameter(context);
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddMissingParameter newInstance() => AddMissingParameter();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart
index 0dd82a1..0a88534 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart
@@ -75,7 +75,4 @@
await addParameter(parameterList?.leftParenthesis.end, '{', '}');
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddMissingParameterNamed newInstance() => AddMissingParameterNamed();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart
index 2d5231c..e818a51 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart
@@ -135,8 +135,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddMissingRequiredArgument newInstance() =>
- AddMissingRequiredArgument();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_ne_null.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_ne_null.dart
index 125d12f..d68b0ac 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_ne_null.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_ne_null.dart
@@ -38,7 +38,4 @@
problemMessage.offset + problemMessage.length, ' != null');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddNeNull newInstance() => AddNeNull();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_not_null_assert.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_not_null_assert.dart
index ac57617..f0510f3 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_not_null_assert.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_not_null_assert.dart
@@ -77,7 +77,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static AddNotNullAssert newInstance() => AddNotNullAssert();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart
index 33c5944..8883d2b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart
@@ -135,7 +135,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddNullCheck newInstance() => AddNullCheck();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart
index cecf11f..d50eb1e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart
@@ -47,7 +47,4 @@
});
builder.setSelection(exitPosition);
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddOverride newInstance() => AddOverride();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_required.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_required.dart
index b0ff6b9..1ce6f0c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_required.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_required.dart
@@ -30,7 +30,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddRequired newInstance() => AddRequired();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_required_keyword.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_required_keyword.dart
index cf83196..7a7b402 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_required_keyword.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_required_keyword.dart
@@ -40,7 +40,4 @@
builder.addSimpleInsertion(insertOffset, 'required ');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddRequiredKeyword newInstance() => AddRequiredKeyword();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_return_null.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_return_null.dart
index 8b37810..ec7e11b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_return_null.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_return_null.dart
@@ -70,7 +70,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddReturnNull newInstance() => AddReturnNull();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart
index 9e06b2f..fecc01d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart
@@ -128,9 +128,6 @@
}
return baseType;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddReturnType newInstance() => AddReturnType();
}
/// Copied from lib/src/services/refactoring/extract_method.dart", but
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_static.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_static.dart
index 4ee5960..1896e88 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_static.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_static.dart
@@ -23,7 +23,4 @@
builder.addSimpleInsertion(offset, 'static ');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddStatic newInstance() => AddStatic();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart
index 86f5968..f1357b4 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart
@@ -48,10 +48,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddSuperConstructorInvocation newInstance() =>
- AddSuperConstructorInvocation();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_switch_case_break.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_switch_case_break.dart
index fc4225d..cc16d98 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_switch_case_break.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_switch_case_break.dart
@@ -31,7 +31,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddSwitchCaseBreak newInstance() => AddSwitchCaseBreak();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart
index 1b4aed0..a7948d5 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart
@@ -38,7 +38,4 @@
builder.addSimpleInsertion(lastNode.end, ',');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddTrailingComma newInstance() => AddTrailingComma();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart
index 9bb8c12..a075f8a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart
@@ -24,9 +24,16 @@
@override
bool canBeAppliedToFile;
- AddTypeAnnotation(bool multi)
- : canBeAppliedInBulk = multi,
- canBeAppliedToFile = multi;
+ /// Initialize a newly created instance that can't apply bulk and in-file
+ /// fixes.
+ AddTypeAnnotation()
+ : canBeAppliedInBulk = false,
+ canBeAppliedToFile = false;
+
+ /// Initialize a newly created instance that can apply bulk and in-file fixes.
+ AddTypeAnnotation.bulkFixable()
+ : canBeAppliedInBulk = true,
+ canBeAppliedToFile = true;
@override
AssistKind get assistKind => DartAssistKind.ADD_TYPE_ANNOTATION;
@@ -188,13 +195,6 @@
}
return visitor.bestType;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static AddTypeAnnotation newInstance() => AddTypeAnnotation(false);
-
- /// Return an instance of this class that can apply bulk and in-file fixes.
- /// Used as a tear-off in `FixProcessor`.
- static AddTypeAnnotation newInstanceBulkFixable() => AddTypeAnnotation(true);
}
class _AssignedTypeCollector extends RecursiveAstVisitor<void> {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart b/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart
index 90903cd..3b00724 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart
@@ -80,9 +80,6 @@
return analysisOptions?.isLintEnabled(name) ?? false;
}
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static AssignToLocalVariable newInstance() => AssignToLocalVariable();
-
/// Return `true` if the given [statement] resulted from a recovery case that
/// would make the change create even worse errors than the original code.
static bool _hasPrecedingStatementRecovery(Statement statement) {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart
index 54c57a4..fc50a38 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart
@@ -69,9 +69,6 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ChangeArgumentName newInstance() => ChangeArgumentName();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart
index f474802..e9659b6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart
@@ -23,9 +23,20 @@
/// The name to which the undefined name will be changed.
String _proposedName = '';
- /// Initialize a newly created instance that will propose elements of the
- /// given [_kind].
- ChangeTo(this._kind);
+ /// Initialize a newly created instance that will propose classes and mixins.
+ ChangeTo.annotation() : _kind = _ReplacementKind.annotation;
+
+ /// Initialize a newly created instance that will propose classes and mixins.
+ ChangeTo.classOrMixin() : _kind = _ReplacementKind.classOrMixin;
+
+ /// Initialize a newly created instance that will propose functions.
+ ChangeTo.function() : _kind = _ReplacementKind.function;
+
+ /// Initialize a newly created instance that will propose getters and setters.
+ ChangeTo.getterOrSetter() : _kind = _ReplacementKind.getterOrSetter;
+
+ /// Initialize a newly created instance that will propose methods.
+ ChangeTo.method() : _kind = _ReplacementKind.method;
@override
List<Object> get fixArguments => [_proposedName];
@@ -227,26 +238,6 @@
finder._updateList(getExtensionMembers(element));
}
}
-
- /// Return an instance of this class that will propose classes and mixins.
- /// Used as a tear-off in `FixProcessor`.
- static ChangeTo annotation() => ChangeTo(_ReplacementKind.annotation);
-
- /// Return an instance of this class that will propose classes and mixins.
- /// Used as a tear-off in `FixProcessor`.
- static ChangeTo classOrMixin() => ChangeTo(_ReplacementKind.classOrMixin);
-
- /// Return an instance of this class that will propose functions. Used as a
- /// tear-off in `FixProcessor`.
- static ChangeTo function() => ChangeTo(_ReplacementKind.function);
-
- /// Return an instance of this class that will propose getters and setters.
- /// Used as a tear-off in `FixProcessor`.
- static ChangeTo getterOrSetter() => ChangeTo(_ReplacementKind.getterOrSetter);
-
- /// Return an instance of this class that will propose methods. Used as a
- /// tear-off in `FixProcessor`.
- static ChangeTo method() => ChangeTo(_ReplacementKind.method);
}
/// Helper for finding [Element] with name closest to the given.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_to_nearest_precise_value.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_to_nearest_precise_value.dart
index 4cd612f..8795f66 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/change_to_nearest_precise_value.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/change_to_nearest_precise_value.dart
@@ -36,8 +36,4 @@
builder.addSimpleReplacement(range.node(integer), _correction);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ChangeToNearestPreciseValue newInstance() =>
- ChangeToNearestPreciseValue();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart
index d6b1d16..1582f94 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart
@@ -64,7 +64,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ChangeToStaticAccess newInstance() => ChangeToStaticAccess();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_type_annotation.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_type_annotation.dart
index 0d13f8c..a84c667 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/change_type_annotation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/change_type_annotation.dart
@@ -54,7 +54,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ChangeTypeAnnotation newInstance() => ChangeTypeAnnotation();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart
index 394b4df..0d3aa94 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart
@@ -135,7 +135,4 @@
builder.addDeletion(range.node(invocation));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertAddAllToSpread newInstance() => ConvertAddAllToSpread();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart
index 61cf3f9..e5bc0de 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart
@@ -65,9 +65,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertClassToEnum newInstance() => ConvertClassToEnum();
}
/// A superclass for the [_EnumVisitor] and [_NonEnumVisitor].
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart
index f3184e4..d530aef 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart
@@ -69,9 +69,6 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertClassToMixin newInstance() => ConvertClassToMixin();
}
/// A visitor used to find all of the classes that define members referenced via
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_conditional_expression_to_if_element.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_conditional_expression_to_if_element.dart
index 20c7189..b686773 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_conditional_expression_to_if_element.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_conditional_expression_to_if_element.dart
@@ -58,8 +58,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertConditionalExpressionToIfElement newInstance() =>
- ConvertConditionalExpressionToIfElement();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart
index 7068e136..8dccf91 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart
@@ -42,8 +42,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertDocumentationIntoBlock newInstance() =>
- ConvertDocumentationIntoBlock();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_line.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_line.dart
index d1a401e..659f521 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_line.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_line.dart
@@ -84,8 +84,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertDocumentationIntoLine newInstance() =>
- ConvertDocumentationIntoLine();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart
index 3556de0..f77bf47 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart
@@ -46,7 +46,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertFlutterChild newInstance() => ConvertFlutterChild();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_children.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_children.dart
index c105653..883d0e9 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_children.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_children.dart
@@ -44,7 +44,4 @@
String source, String indentOld, String indentNew) {
return source.replaceAll(RegExp('^$indentOld', multiLine: true), indentNew);
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertFlutterChildren newInstance() => ConvertFlutterChildren();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart
index 2da9100..7ee4818 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart
@@ -87,9 +87,6 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertForEachToForLoop newInstance() => ConvertForEachToForLoop();
}
class _ReturnVisitor extends RecursiveAstVisitor<void> {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart
index 8a6b2c8..f08db2e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart
@@ -43,7 +43,4 @@
builder.convertFunctionFromSyncToAsync(body, typeProvider);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoAsyncBody newInstance() => ConvertIntoAsyncBody();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart
index 6f97951..61d60b6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart
@@ -104,7 +104,4 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoBlockBody newInstance() => ConvertIntoBlockBody();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart
index 4e9ee8e..c16bfeb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart
@@ -88,7 +88,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoFinalField newInstance() => ConvertIntoFinalField();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart
index f7df358..0982c01 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart
@@ -90,7 +90,4 @@
'$prefix$indent$loopVariable = $listName[$indexName];$eol');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoForIndex newInstance() => ConvertIntoForIndex();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart
index a1f4d53..bb9bebd 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart
@@ -62,7 +62,4 @@
builder.addSimpleReplacement(replacementRange, code);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoGetter newInstance() => ConvertIntoGetter();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not.dart
index 6810483..e62e3e3 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not.dart
@@ -85,7 +85,4 @@
builder.addSimpleInsertion(isExpression_final.isOperator.end, '!');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoIsNot newInstance() => ConvertIntoIsNot();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not_empty.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not_empty.dart
index 2e7cecb..cc2ed4d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not_empty.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_is_not_empty.dart
@@ -66,7 +66,4 @@
range.node(isEmptyIdentifier_final), 'isNotEmpty');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertIntoIsNotEmpty newInstance() => ConvertIntoIsNotEmpty();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart
index 3829631..4039211 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart
@@ -145,10 +145,6 @@
});
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertMapFromIterableToForLiteral newInstance() =>
- ConvertMapFromIterableToForLiteral();
-
static Expression? _extractBody(FunctionExpression expression) {
var body = expression.body;
if (body is ExpressionFunctionBody) {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
index c841c0f..0839c88 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
@@ -35,7 +35,4 @@
builder.addSimpleReplacement(replacementRange, "'$uri'");
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertPartOfToUri newInstance() => ConvertPartOfToUri();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_quotes.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_quotes.dart
index 7f643b6..710f159 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_quotes.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_quotes.dart
@@ -57,9 +57,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertQuotes newInstance() => ConvertQuotes();
}
class ConvertToDoubleQuotes extends _ConvertQuotes {
@@ -80,9 +77,6 @@
@override
bool get _fromDouble => false;
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToDoubleQuotes newInstance() => ConvertToDoubleQuotes();
}
class ConvertToSingleQuotes extends _ConvertQuotes {
@@ -103,9 +97,6 @@
@override
bool get _fromDouble => true;
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToSingleQuotes newInstance() => ConvertToSingleQuotes();
}
abstract class _ConvertQuotes extends CorrectionProducer {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_cascade.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_cascade.dart
index 818a11c..675cf7f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_cascade.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_cascade.dart
@@ -60,9 +60,6 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToCascade newInstance() => ConvertToCascade();
}
class _TargetAndOperator {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_contains.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_contains.dart
index b77def6..63bd7e8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_contains.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_contains.dart
@@ -156,9 +156,6 @@
// so we should never reach this point.
return NegationStyle.none;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToContains newInstance() => ConvertToContains();
}
/// An indication of whether the `contains` test should be negated, not negated,
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart
index 31d1539..e7d299b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart
@@ -107,8 +107,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToExpressionFunctionBody newInstance() =>
- ConvertToExpressionFunctionBody();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_field_parameter.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_field_parameter.dart
index fde8eca..2b3e173 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_field_parameter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_field_parameter.dart
@@ -85,9 +85,6 @@
});
}
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertToFieldParameter newInstance() => ConvertToFieldParameter();
-
static _Context? _findParameter(AstNode node) {
var parent = node.parent;
if (parent is SimpleFormalParameter) {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_function_declaration.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_function_declaration.dart
index 63cea99..8f8cbc3 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_function_declaration.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_function_declaration.dart
@@ -106,8 +106,4 @@
var i = variables.indexOf(variable);
return i > 0 ? variables[i - 1] : null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToFunctionDeclaration newInstance() =>
- ConvertToFunctionDeclaration();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_generic_function_syntax.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_generic_function_syntax.dart
index 16d56cc..e899a17 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_generic_function_syntax.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_generic_function_syntax.dart
@@ -113,8 +113,4 @@
builder.addSimpleReplacement(range.node(node), replacement);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToGenericFunctionSyntax newInstance() =>
- ConvertToGenericFunctionSyntax();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_null.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_null.dart
index 8d092f4..2d7cbd2 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_null.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_null.dart
@@ -59,7 +59,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToIfNull newInstance() => ConvertToIfNull();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart
index 19764bb..4cc61ae 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart
@@ -94,8 +94,4 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToInitializingFormal newInstance() =>
- ConvertToInitializingFormal();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_int_literal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_int_literal.dart
index 824807c..03661b8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_int_literal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_int_literal.dart
@@ -52,7 +52,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToIntLiteral newInstance() => ConvertToIntLiteral();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_list_literal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_list_literal.dart
index 8d9d8d4..62d6308 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_list_literal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_list_literal.dart
@@ -62,7 +62,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToListLiteral newInstance() => ConvertToListLiteral();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_map_literal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_map_literal.dart
index cbc6f18..1502cd0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_map_literal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_map_literal.dart
@@ -71,7 +71,4 @@
element == typeProvider.mapElement ||
(element.name == 'LinkedHashMap' &&
element.library.name == 'dart.collection');
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToMapLiteral newInstance() => ConvertToMapLiteral();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_multiline_string.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_multiline_string.dart
index 0807076..20d33b5 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_multiline_string.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_multiline_string.dart
@@ -38,7 +38,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertToMultilineString newInstance() => ConvertToMultilineString();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_named_arguments.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_named_arguments.dart
index 228d9f9..cb4eade 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_named_arguments.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_named_arguments.dart
@@ -91,7 +91,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToNamedArguments newInstance() => ConvertToNamedArguments();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_normal_parameter.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_normal_parameter.dart
index d7a7c65..f4bec66 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_normal_parameter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_normal_parameter.dart
@@ -51,7 +51,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertToNormalParameter newInstance() => ConvertToNormalParameter();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware.dart
index f1fe1bf..b93e4bd 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware.dart
@@ -112,7 +112,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToNullAware newInstance() => ConvertToNullAware();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_spread.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_spread.dart
index 920b2f2..063efc5 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_spread.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_spread.dart
@@ -21,7 +21,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToNullAwareSpread newInstance() => ConvertToNullAwareSpread();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_on_type.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_on_type.dart
index a47567a..8c48362 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_on_type.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_on_type.dart
@@ -48,7 +48,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToOnType newInstance() => ConvertToOnType();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_package_import.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_package_import.dart
index 7d3b150..74ef3fc 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_package_import.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_package_import.dart
@@ -65,7 +65,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToPackageImport newInstance() => ConvertToPackageImport();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_raw_string.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_raw_string.dart
index 0ccd810..b9523f1 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_raw_string.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_raw_string.dart
@@ -48,7 +48,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToRawString newInstance() => ConvertToRawString();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_relative_import.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_relative_import.dart
index 49bedd1..c179e68 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_relative_import.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_relative_import.dart
@@ -89,7 +89,4 @@
);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToRelativeImport newInstance() => ConvertToRelativeImport();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart
index 158a890..2ba09b0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart
@@ -207,7 +207,4 @@
}
return _hasUnambiguousElement(creation);
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToSetLiteral newInstance() => ConvertToSetLiteral();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
index 4522ffc..4f150ee 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
@@ -408,9 +408,6 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ConvertToSuperParameters newInstance() => ConvertToSuperParameters();
}
/// Information about a single parameter.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_where_type.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_where_type.dart
index b4b93c4..639bcd8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_where_type.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_where_type.dart
@@ -77,7 +77,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ConvertToWhereType newInstance() => ConvertToWhereType();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart
index 9998f30..95dc29b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart
@@ -118,7 +118,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateClass newInstance() => CreateClass();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart
index 1e367b0..439f0f4 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart
@@ -153,7 +153,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateConstructor newInstance() => CreateConstructor();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart
index e125e84..90f757c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart
@@ -173,8 +173,4 @@
builder.write(fieldName);
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateConstructorForFinalFields newInstance() =>
- CreateConstructorForFinalFields();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart
index 3fd0c99..2c94494 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart
@@ -38,9 +38,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateConstructorSuper newInstance() => CreateConstructorSuper();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_field.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_field.dart
index 3073989..287df7c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_field.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_field.dart
@@ -137,7 +137,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateField newInstance() => CreateField();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart
index 9241efc..152e61b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart
@@ -57,7 +57,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateFile newInstance() => CreateFile();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_function.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_function.dart
index 1a8aaf4..6db3b29 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_function.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_function.dart
@@ -64,7 +64,4 @@
builder.addLinkedPosition(range.node(node), 'NAME');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateFunction newInstance() => CreateFunction();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart
index cdc8339..60620d7 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart
@@ -118,7 +118,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateGetter newInstance() => CreateGetter();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_local_variable.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_local_variable.dart
index 22b464e..a685de0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_local_variable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_local_variable.dart
@@ -61,7 +61,4 @@
builder.addLinkedPosition(range.node(node), 'NAME');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateLocalVariable newInstance() => CreateLocalVariable();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_method.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_method.dart
index 1774efe..04a0cf8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_method.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_method.dart
@@ -27,6 +27,21 @@
CreateMethod(this._kind, this.canBeAppliedInBulk, this.canBeAppliedToFile);
+ /// Initialize a newly created instance that will create either an equals
+ /// (operator =) or `hashCode` method based on the existing other half of the
+ /// pair.
+ CreateMethod.equalsOrHashCode()
+ : _kind = _MethodKind.equalsOrHashCode,
+ canBeAppliedInBulk = true,
+ canBeAppliedToFile = true;
+
+ /// Initialize a newly created instance that will create a method based on an
+ /// invocation of an undefined method.
+ CreateMethod.method()
+ : _kind = _MethodKind.method,
+ canBeAppliedInBulk = false,
+ canBeAppliedToFile = false;
+
@override
List<Object> get fixArguments => [_memberName];
@@ -202,17 +217,6 @@
}
});
}
-
- /// Return an instance of this class that will create either an equals
- /// (operator =) or `hashCode` method based on the existing other half of the
- /// pair. Used as a tear-off in `FixProcessor`.
- static CreateMethod equalsOrHashCode() =>
- CreateMethod(_MethodKind.equalsOrHashCode, true, true);
-
- /// Return an instance of this class that will create a method based on an
- /// invocation of an undefined method. Used as a tear-off in `FixProcessor`.
- static CreateMethod method() =>
- CreateMethod(_MethodKind.method, false, false);
}
/// A representation of the kind of element that should be suggested.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
index 3695dfa..ba94cc0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart
@@ -173,7 +173,4 @@
_fixKind = DartFixKind.CREATE_METHOD;
_functionName = name;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateMethodOrFunction newInstance() => CreateMethodOrFunction();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_missing_overrides.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_missing_overrides.dart
index 36a1566..d7c6894 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_missing_overrides.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_missing_overrides.dart
@@ -124,7 +124,4 @@
});
builder.setSelection(Position(file, location.offset));
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateMissingOverrides newInstance() => CreateMissingOverrides();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart
index 4769c4a..1bbc953 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart
@@ -105,7 +105,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateMixin newInstance() => CreateMixin();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart
index e885c0e..86a1ed0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart
@@ -39,7 +39,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateNoSuchMethod newInstance() => CreateNoSuchMethod();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart
index 569e134..9acc150 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart
@@ -118,7 +118,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static CreateSetter newInstance() => CreateSetter();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart b/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart
index f7c9e13..ba96a6c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart
@@ -63,9 +63,6 @@
}
return transformSets;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static DataDriven newInstance() => DataDriven();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart b/pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart
index 9bbf4d8..a714bcd 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart
@@ -112,7 +112,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static EncapsulateField newInstance() => EncapsulateField();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/exchange_operands.dart b/pkg/analysis_server/lib/src/services/correction/dart/exchange_operands.dart
index 9d1f05d..2244dc9 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/exchange_operands.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/exchange_operands.dart
@@ -63,7 +63,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ExchangeOperands newInstance() => ExchangeOperands();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart b/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart
index b9557d0..ee1735a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart
@@ -39,7 +39,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ExtendClassForMixin newInstance() => ExtendClassForMixin();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart b/pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart
index bdb9fc7..706d0b4 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart
@@ -133,9 +133,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ExtractLocalVariable newInstance() => ExtractLocalVariable();
}
class _ExpressionEncoder {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart
index 7f9a104..5ff9369 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart
@@ -80,7 +80,4 @@
builder.addSimpleReplacement(range.node(childArg), newChildArgSrc);
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterConvertToChildren newInstance() => FlutterConvertToChildren();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart
index e57083d..4e73f85 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart
@@ -254,10 +254,6 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterConvertToStatefulWidget newInstance() =>
- FlutterConvertToStatefulWidget();
}
class _FieldFinder extends RecursiveAstVisitor<void> {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart
index 1e2fa0f..7c2d12a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart
@@ -44,7 +44,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterMoveDown newInstance() => FlutterMoveDown();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart
index 8513af7..4d922cc 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart
@@ -43,7 +43,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterMoveUp newInstance() => FlutterMoveUp();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart
index 596a3f5..fc06a4f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart
@@ -88,7 +88,4 @@
builder.addSimpleReplacement(range.node(widgetCreation), childText);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterRemoveWidget newInstance() => FlutterRemoveWidget();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_child.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_child.dart
index c254da0..9e95655 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_child.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_child.dart
@@ -109,7 +109,4 @@
await swapParentAndChild(builder, parent, child);
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterSwapWithChild newInstance() => FlutterSwapWithChild();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_parent.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_parent.dart
index 701c73e..7ed3b81 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_parent.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_parent.dart
@@ -27,7 +27,4 @@
await swapParentAndChild(builder, expr, child);
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterSwapWithParent newInstance() => FlutterSwapWithParent();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap.dart
index 552f56e..3c75ac0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap.dart
@@ -87,9 +87,6 @@
yield _FlutterWrapColumn(firstWidget, lastWidget);
yield _FlutterWrapRow(firstWidget, lastWidget);
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterWrap newInstance() => FlutterWrap();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_builder.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_builder.dart
index 752a414..013cc77 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_builder.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_builder.dart
@@ -61,7 +61,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterWrapBuilder newInstance() => FlutterWrapBuilder();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_generic.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_generic.dart
index 5fcd235..72b790f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_generic.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_generic.dart
@@ -55,7 +55,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterWrapGeneric newInstance() => FlutterWrapGeneric();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_stream_builder.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_stream_builder.dart
index ce2f849..ccab9e7 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_stream_builder.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap_stream_builder.dart
@@ -66,7 +66,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static FlutterWrapStreamBuilder newInstance() => FlutterWrapStreamBuilder();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/ignore_diagnostic.dart b/pkg/analysis_server/lib/src/services/correction/dart/ignore_diagnostic.dart
index a876fd0..6e5d8ee 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/ignore_diagnostic.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/ignore_diagnostic.dart
@@ -75,9 +75,6 @@
'ignore_for_file',
);
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static IgnoreDiagnosticInFile newInstance() => IgnoreDiagnosticInFile();
}
class IgnoreDiagnosticOnLine extends AbstractIgnoreDiagnostic {
@@ -95,7 +92,4 @@
'ignore',
);
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static IgnoreDiagnosticOnLine newInstance() => IgnoreDiagnosticOnLine();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/import_add_show.dart b/pkg/analysis_server/lib/src/services/correction/dart/import_add_show.dart
index 4b923a3..20fa0ec 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/import_add_show.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/import_add_show.dart
@@ -48,9 +48,6 @@
builder.addSimpleInsertion(importDirective.end - 1, showCombinator);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ImportAddShow newInstance() => ImportAddShow();
}
class _ReferenceFinder extends RecursiveAstVisitor<void> {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart b/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart
index d39f695..4536421 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart
@@ -22,7 +22,31 @@
class ImportLibrary extends MultiCorrectionProducer {
final _ImportKind _importKind;
- ImportLibrary(this._importKind);
+ /// Initialize a newly created instance that will add an import of
+ /// `dart:async`.
+ ImportLibrary.dartAsync() : _importKind = _ImportKind.dartAsync;
+
+ /// Initialize a newly created instance that will add an import for an
+ /// extension.
+ ImportLibrary.forExtension() : _importKind = _ImportKind.forExtension;
+
+ /// Initialize a newly created instance that will add an import for a member
+ /// of an extension.
+ ImportLibrary.forExtensionMember()
+ : _importKind = _ImportKind.forExtensionMember;
+
+ /// Initialize a newly created instance that will add an import for a
+ /// top-level function.
+ ImportLibrary.forFunction() : _importKind = _ImportKind.forFunction;
+
+ /// Initialize a newly created instance that will add an import for a
+ /// top-level variable.
+ ImportLibrary.forTopLevelVariable()
+ : _importKind = _ImportKind.forTopLevelVariable;
+
+ /// Initialize a newly created instance that will add an import for a type
+ /// (class or mixin).
+ ImportLibrary.forType() : _importKind = _ImportKind.forType;
@override
Stream<CorrectionProducer> get producers async* {
@@ -358,31 +382,6 @@
return null;
}
-
- /// Return an instance of this class that will add an import of `dart:async`.
- /// Used as a tear-off in `FixProcessor`.
- static ImportLibrary dartAsync() => ImportLibrary(_ImportKind.dartAsync);
-
- /// Return an instance of this class that will add an import for an extension.
- /// Used as a tear-off in `FixProcessor`.
- static ImportLibrary forExtension() =>
- ImportLibrary(_ImportKind.forExtension);
-
- static ImportLibrary forExtensionMember() =>
- ImportLibrary(_ImportKind.forExtensionMember);
-
- /// Return an instance of this class that will add an import for a top-level
- /// function. Used as a tear-off in `FixProcessor`.
- static ImportLibrary forFunction() => ImportLibrary(_ImportKind.forFunction);
-
- /// Return an instance of this class that will add an import for a top-level
- /// variable. Used as a tear-off in `FixProcessor`.
- static ImportLibrary forTopLevelVariable() =>
- ImportLibrary(_ImportKind.forTopLevelVariable);
-
- /// Return an instance of this class that will add an import for a type (class
- /// or mixin). Used as a tear-off in `FixProcessor`.
- static ImportLibrary forType() => ImportLibrary(_ImportKind.forType);
}
/// A correction processor that can add an import using an absolute URI.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart b/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart
index 8378dad..a7c40fb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart
@@ -76,7 +76,4 @@
builder.addDeletion(range.node(invocation));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static InlineInvocation newInstance() => InlineInvocation();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart b/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart
index 0ae8706..2c5328d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart
@@ -143,9 +143,6 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static InlineTypedef newInstance() => InlineTypedef();
}
class _ReferenceFinder extends RecursiveAstVisitor {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart b/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart
index c2bf057..75d561d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart
@@ -35,7 +35,4 @@
final node = this.node;
return node is SimpleIdentifier && node.name == 'await';
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static InsertSemicolon newInstance() => InsertSemicolon();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/introduce_local_cast_type.dart b/pkg/analysis_server/lib/src/services/correction/dart/introduce_local_cast_type.dart
index e3c3b29..359e946 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/introduce_local_cast_type.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/introduce_local_cast_type.dart
@@ -87,9 +87,6 @@
return null;
}
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static IntroduceLocalCastType newInstance() => IntroduceLocalCastType();
-
static Expression? _getCondition(AstNode node) {
if (node is IfStatement) {
return node.condition;
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/invert_if_statement.dart b/pkg/analysis_server/lib/src/services/correction/dart/invert_if_statement.dart
index 20e22c9..c46421a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/invert_if_statement.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/invert_if_statement.dart
@@ -37,7 +37,4 @@
builder.addSimpleReplacement(range.node(elseStatement), thenSource);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static InvertIfStatement newInstance() => InvertIfStatement();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart b/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart
index 9b123a07..2e18a4e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart
@@ -61,7 +61,4 @@
'if ($condition) {$eol$newSource$prefix}');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static JoinIfWithInner newInstance() => JoinIfWithInner();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart b/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart
index 5d17b46..d6a0857 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart
@@ -67,7 +67,4 @@
'if ($condition) {$eol$newSource$prefix}');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static JoinIfWithOuter newInstance() => JoinIfWithOuter();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/join_variable_declaration.dart b/pkg/analysis_server/lib/src/services/correction/dart/join_variable_declaration.dart
index 8b97a1d..54a8773 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/join_variable_declaration.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/join_variable_declaration.dart
@@ -153,7 +153,4 @@
);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static JoinVariableDeclaration newInstance() => JoinVariableDeclaration();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_class_abstract.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_class_abstract.dart
index a06ba35..d667d2f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_class_abstract.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_class_abstract.dart
@@ -29,7 +29,4 @@
enclosingClass.classKeyword.offset, 'abstract ');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeClassAbstract newInstance() => MakeClassAbstract();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_conditional_on_debug_mode.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_conditional_on_debug_mode.dart
index af6ad99..dc0822b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_conditional_on_debug_mode.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_conditional_on_debug_mode.dart
@@ -49,8 +49,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeConditionalOnDebugMode newInstance() =>
- MakeConditionalOnDebugMode();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_field_not_final.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_field_not_final.dart
index 374d184..e667453 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_field_not_final.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_field_not_final.dart
@@ -91,7 +91,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeFieldNotFinal newInstance() => MakeFieldNotFinal();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart
index 16025e4..f492510 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart
@@ -58,9 +58,6 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeFieldPublic newInstance() => MakeFieldPublic();
}
extension on DartFileEditBuilder {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart
index a9b1c89..9bf265c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart
@@ -106,7 +106,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeFinal newInstance() => MakeFinal();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_return_type_nullable.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_return_type_nullable.dart
index 146e42b..0b53087 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_return_type_nullable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_return_type_nullable.dart
@@ -67,9 +67,6 @@
});
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeReturnTypeNullable newInstance() => MakeReturnTypeNullable();
-
static TypeAnnotation? _getReturnTypeNode(FunctionBody body) {
var function = body.parent;
if (function is FunctionExpression) {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_variable_not_final.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_variable_not_final.dart
index f3f1695..8a77e88 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_variable_not_final.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_variable_not_final.dart
@@ -57,7 +57,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeVariableNotFinal newInstance() => MakeVariableNotFinal();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_variable_nullable.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_variable_nullable.dart
index 6f25968..3dca9c8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_variable_nullable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_variable_nullable.dart
@@ -249,7 +249,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MakeVariableNullable newInstance() => MakeVariableNullable();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/move_type_arguments_to_class.dart b/pkg/analysis_server/lib/src/services/correction/dart/move_type_arguments_to_class.dart
index 82676c6..9f1cc96 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/move_type_arguments_to_class.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/move_type_arguments_to_class.dart
@@ -42,7 +42,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static MoveTypeArgumentsToClass newInstance() => MoveTypeArgumentsToClass();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart b/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart
index d655cc3..9969fe0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart
@@ -36,7 +36,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static OrganizeImports newInstance() => OrganizeImports();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart b/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart
index 4756866..07e51bb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart
@@ -56,7 +56,4 @@
});
_qualifiedName = '$containerName.${memberName.name}';
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static QualifyReference newInstance() => QualifyReference();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_abstract.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_abstract.dart
index 7a6dc30b..325b629 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_abstract.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_abstract.dart
@@ -31,7 +31,4 @@
builder.addDeletion(SourceRange(offset, i - offset));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveAbstract newInstance() => RemoveAbstract();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_annotation.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_annotation.dart
index 2c03724..93362fb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_annotation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_annotation.dart
@@ -67,7 +67,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveAnnotation newInstance() => RemoveAnnotation();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_argument.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_argument.dart
index 7e370f9..b2c6d81 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_argument.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_argument.dart
@@ -44,7 +44,4 @@
builder.addDeletion(sourceRange);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveArgument newInstance() => RemoveArgument();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_assignment.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_assignment.dart
index 8f95178..1fe3431 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_assignment.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_assignment.dart
@@ -46,7 +46,4 @@
builder.addDeletion(sourceRange);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveAssignment newInstance() => RemoveAssignment();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_await.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_await.dart
index c2b61a4..d1731f4 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_await.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_await.dart
@@ -32,7 +32,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveAwait newInstance() => RemoveAwait();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart
index b7e5f96..22d67fa 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart
@@ -118,7 +118,4 @@
builder.addDeletion(operatorAndOperand);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveComparison newInstance() => RemoveComparison();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart
index 93441bb..832dd64e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart
@@ -14,9 +14,6 @@
class RemoveConst extends _RemoveConst {
@override
FixKind get fixKind => DartFixKind.REMOVE_CONST;
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveConst newInstance() => RemoveConst();
}
class RemoveUnnecessaryConst extends _RemoveConst {
@@ -31,9 +28,6 @@
@override
FixKind get multiFixKind => DartFixKind.REMOVE_UNNECESSARY_CONST_MULTI;
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryConst newInstance() => RemoveUnnecessaryConst();
}
abstract class _RemoveConst extends CorrectionProducer {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_constructor_name.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_constructor_name.dart
index 059bb3b..e168cf6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_constructor_name.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_constructor_name.dart
@@ -33,7 +33,4 @@
builder.addDeletion(range.startStart(dotToken, identifier.token.next!));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveConstructorName newInstance() => RemoveConstructorName();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart
index 7f70107..8260a5b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart
@@ -70,7 +70,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveDeadCode newInstance() => RemoveDeadCode();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_if_null.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_if_null.dart
index 96e641f..c7e68b9 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_if_null.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_if_null.dart
@@ -66,7 +66,4 @@
}
return null;
}
-
- /// Returns an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveDeadIfNull newInstance() => RemoveDeadIfNull();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_deprecated_new_in_comment_reference.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_deprecated_new_in_comment_reference.dart
index 73c944b..71da358 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_deprecated_new_in_comment_reference.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_deprecated_new_in_comment_reference.dart
@@ -58,8 +58,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveDeprecatedNewInCommentReference newInstance() =>
- RemoveDeprecatedNewInCommentReference();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart
index 9f0b741..c8f71ce 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart
@@ -47,7 +47,4 @@
builder.addDeletion(utils.getLinesRange(deletionRange));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveDuplicateCase newInstance() => RemoveDuplicateCase();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_catch.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_catch.dart
index 8ff002d..d6843f6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_catch.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_catch.dart
@@ -42,7 +42,4 @@
builder.addDeletion(utils.getLinesRange(range.node(catchClause)));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveEmptyCatch newInstance() => RemoveEmptyCatch();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_constructor_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_constructor_body.dart
index 7e3caca..40471fb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_constructor_body.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_constructor_body.dart
@@ -34,8 +34,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveEmptyConstructorBody newInstance() =>
- RemoveEmptyConstructorBody();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_else.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_else.dart
index 4c04ffb..b3522ef 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_else.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_else.dart
@@ -39,7 +39,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveEmptyElse newInstance() => RemoveEmptyElse();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_statement.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_statement.dart
index 77fdb936..2f3184d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_statement.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_empty_statement.dart
@@ -30,7 +30,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveEmptyStatement newInstance() => RemoveEmptyStatement();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_if_null_operator.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_if_null_operator.dart
index 3607814..70c2d1b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_if_null_operator.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_if_null_operator.dart
@@ -43,7 +43,4 @@
builder.addDeletion(sourceRange);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveIfNullOperator newInstance() => RemoveIfNullOperator();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_initializer.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_initializer.dart
index a2fb8c5..764a2dd 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_initializer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_initializer.dart
@@ -49,7 +49,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveInitializer newInstance() => RemoveInitializer();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_interpolation_braces.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_interpolation_braces.dart
index 5194a85..849547e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_interpolation_braces.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_interpolation_braces.dart
@@ -36,7 +36,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveInterpolationBraces newInstance() => RemoveInterpolationBraces();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_leading_underscore.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_leading_underscore.dart
index 918c2a7..756474d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_leading_underscore.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_leading_underscore.dart
@@ -75,7 +75,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveLeadingUnderscore newInstance() => RemoveLeadingUnderscore();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_method_declaration.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_method_declaration.dart
index 6436484..63dde15 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_method_declaration.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_method_declaration.dart
@@ -31,7 +31,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveMethodDeclaration newInstance() => RemoveMethodDeclaration();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart
index 889378a..a7a7d50 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart
@@ -45,9 +45,6 @@
}
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveNameFromCombinator newInstance() => RemoveNameFromCombinator();
-
static SourceRange? rangeForCombinator(Combinator combinator) {
var parent = combinator.parent;
if (parent is NamespaceDirective) {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_non_null_assertion.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_non_null_assertion.dart
index e420e7c..bb1ee6c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_non_null_assertion.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_non_null_assertion.dart
@@ -36,7 +36,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveNonNullAssertion newInstance() => RemoveNonNullAssertion();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_operator.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_operator.dart
index 5b0c572..e06d26a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_operator.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_operator.dart
@@ -33,7 +33,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveOperator newInstance() => RemoveOperator();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_parameters_in_getter_declaration.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_parameters_in_getter_declaration.dart
index 236ac60..69409b5 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_parameters_in_getter_declaration.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_parameters_in_getter_declaration.dart
@@ -10,6 +10,8 @@
import 'package:analyzer_plugin/utilities/range_factory.dart';
class RemoveParametersInGetterDeclaration extends CorrectionProducer {
+ RemoveParametersInGetterDeclaration();
+
@override
FixKind get fixKind => DartFixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION;
@@ -30,8 +32,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveParametersInGetterDeclaration newInstance() =>
- RemoveParametersInGetterDeclaration();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_parentheses_in_getter_invocation.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_parentheses_in_getter_invocation.dart
index 97e5d0f8..f1fb465 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_parentheses_in_getter_invocation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_parentheses_in_getter_invocation.dart
@@ -22,8 +22,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveParenthesesInGetterInvocation newInstance() =>
- RemoveParenthesesInGetterInvocation();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart
index ff50a63..e8ee546 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart
@@ -43,7 +43,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveQuestionMark newInstance() => RemoveQuestionMark();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_returned_value.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_returned_value.dart
index 9de0538..395a578 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_returned_value.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_returned_value.dart
@@ -31,7 +31,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveReturnedValue newInstance() => RemoveReturnedValue();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_this_expression.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_this_expression.dart
index c19ced4..db41dc1 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_this_expression.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_this_expression.dart
@@ -47,7 +47,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveThisExpression newInstance() => RemoveThisExpression();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart
index 257390f..0b1f3c6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart
@@ -107,7 +107,4 @@
builder.addDeletion(range.startStart(type, type.endToken.next!));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveTypeAnnotation newInstance() => RemoveTypeAnnotation();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_type_arguments.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_type_arguments.dart
index 85c70ba1..5493f3a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_type_arguments.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_type_arguments.dart
@@ -24,7 +24,4 @@
builder.addDeletion(range.node(typeArguments));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveTypeArguments newInstance() => RemoveTypeArguments();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_cast.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_cast.dart
index 850bba2..4fb5817 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_cast.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_cast.dart
@@ -36,7 +36,4 @@
builder.removeEnclosingParentheses(asExpression);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryCast newInstance() => RemoveUnnecessaryCast();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart
index 01f447a..7dbcafc 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart
@@ -49,7 +49,4 @@
builder.addDeletion(range.startStart(lateToken, lateToken.next!));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryLate newInstance() => RemoveUnnecessaryLate();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_new.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_new.dart
index 9fbb010..c8f9b1d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_new.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_new.dart
@@ -38,7 +38,4 @@
builder.addDeletion(range.startStart(newToken, newToken.next!));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryNew newInstance() => RemoveUnnecessaryNew();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_parentheses.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_parentheses.dart
index 9575e00..e9230f7 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_parentheses.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_parentheses.dart
@@ -33,8 +33,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryParentheses newInstance() =>
- RemoveUnnecessaryParentheses();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_raw_string.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_raw_string.dart
index 4c3e05a..4a9a337 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_raw_string.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_raw_string.dart
@@ -31,8 +31,4 @@
builder.addDeletion(SourceRange(offset, 1));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryRawString newInstance() =>
- RemoveUnnecessaryRawString();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_escape.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_escape.dart
index 6e4d118..e0d858e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_escape.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_escape.dart
@@ -32,8 +32,4 @@
builder.addDeletion(SourceRange(offset, 1));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryStringEscape newInstance() =>
- RemoveUnnecessaryStringEscape();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_interpolation.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_interpolation.dart
index 02394bf..c4cfa93 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_interpolation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_string_interpolation.dart
@@ -49,8 +49,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnnecessaryStringInterpolation newInstance() =>
- RemoveUnnecessaryStringInterpolation();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart
index 25d4016..b63afe5 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart
@@ -71,9 +71,6 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedElement newInstance() => RemoveUnusedElement();
}
class RemoveUnusedField extends _RemoveUnused {
@@ -216,9 +213,6 @@
}
return result;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedField newInstance() => RemoveUnusedField();
}
class _ElementReferenceCollector extends RecursiveAstVisitor<void> {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_clause.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_clause.dart
index 09a3c41..15eb4ef 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_clause.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_clause.dart
@@ -40,7 +40,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedCatchClause newInstance() => RemoveUnusedCatchClause();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_stack.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_stack.dart
index 1ee1908..7efccd8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_stack.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_stack.dart
@@ -40,7 +40,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedCatchStack newInstance() => RemoveUnusedCatchStack();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_import.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_import.dart
index 02fb02d..b41c71f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_import.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_import.dart
@@ -35,7 +35,4 @@
builder.addDeletion(utils.getLinesRange(range.node(importDirective)));
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedImport newInstance() => RemoveUnusedImport();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_label.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_label.dart
index b06462f..39b504f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_label.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_label.dart
@@ -30,7 +30,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedLabel newInstance() => RemoveUnusedLabel();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart
index bfc7681..3bec4f2 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart
@@ -107,7 +107,4 @@
return null;
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedLocalVariable newInstance() => RemoveUnusedLocalVariable();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_parameter.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_parameter.dart
index e18ebec..bba655f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_parameter.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_parameter.dart
@@ -101,7 +101,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RemoveUnusedParameter newInstance() => RemoveUnusedParameter();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/rename_to_camel_case.dart b/pkg/analysis_server/lib/src/services/correction/dart/rename_to_camel_case.dart
index 289767c..3323ec6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/rename_to_camel_case.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/rename_to_camel_case.dart
@@ -77,7 +77,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static RenameToCamelCase newInstance() => RenameToCamelCase();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_Null_with_void.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_Null_with_void.dart
index 1c4fa5c..cb0a56d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_Null_with_void.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_Null_with_void.dart
@@ -31,7 +31,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceNullWithVoid newInstance() => ReplaceNullWithVoid();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_boolean_with_bool.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_boolean_with_bool.dart
index bc3a361..8fa616d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_boolean_with_bool.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_boolean_with_bool.dart
@@ -33,7 +33,4 @@
builder.addSimpleReplacement(range.error(analysisError), 'bool');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceBooleanWithBool newInstance() => ReplaceBooleanWithBool();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_cascade_with_dot.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_cascade_with_dot.dart
index 7760419..a3a0112 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_cascade_with_dot.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_cascade_with_dot.dart
@@ -83,7 +83,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceCascadeWithDot newInstance() => ReplaceCascadeWithDot();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_colon_with_equals.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_colon_with_equals.dart
index 511d045..33761e6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_colon_with_equals.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_colon_with_equals.dart
@@ -38,7 +38,4 @@
builder.addSimpleReplacement(range.token(separator), ' =');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceColonWithEquals newInstance() => ReplaceColonWithEquals();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart
index 7dee07a..215b32e 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart
@@ -136,8 +136,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ReplaceConditionalWithIfElse newInstance() =>
- ReplaceConditionalWithIfElse();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_container_with_sized_box.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_container_with_sized_box.dart
index 08c9126..446c1f4 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_container_with_sized_box.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_container_with_sized_box.dart
@@ -32,8 +32,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceContainerWithSizedBox newInstance() =>
- ReplaceContainerWithSizedBox();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_const.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_const.dart
index 4ba1c22..ac56fdf 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_const.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_const.dart
@@ -34,7 +34,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceFinalWithConst newInstance() => ReplaceFinalWithConst();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_var.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_var.dart
index ae69609..dda88df 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_var.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_var.dart
@@ -34,7 +34,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceFinalWithVar newInstance() => ReplaceFinalWithVar();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_if_else_with_conditional.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_if_else_with_conditional.dart
index 85e9599..9a9dc23 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_if_else_with_conditional.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_if_else_with_conditional.dart
@@ -65,8 +65,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static ReplaceIfElseWithConditional newInstance() =>
- ReplaceIfElseWithConditional();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_new_with_const.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_new_with_const.dart
index 5e4b9b6..b48d470 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_new_with_const.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_new_with_const.dart
@@ -37,7 +37,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceNewWithConst newInstance() => ReplaceNewWithConst();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_null_check_with_cast.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_null_check_with_cast.dart
index 8f2faf8..0be2ee8 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_null_check_with_cast.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_null_check_with_cast.dart
@@ -46,7 +46,4 @@
' as ${operandType.getDisplayString(withNullability: false)}');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceNullCheckWithCast newInstance() => ReplaceNullCheckWithCast();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_null_with_closure.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_null_with_closure.dart
index 47c2e81..11241cb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_null_with_closure.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_null_with_closure.dart
@@ -58,7 +58,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceNullWithClosure newInstance() => ReplaceNullWithClosure();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type.dart
index 89adc99..92a695b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type.dart
@@ -105,7 +105,4 @@
}
return false;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceReturnType newInstance() => ReplaceReturnType();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_future.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_future.dart
index dfa48e4..1891962 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_future.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_future.dart
@@ -41,9 +41,6 @@
});
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceReturnTypeFuture newInstance() => ReplaceReturnTypeFuture();
-
static TypeAnnotation? _getTypeAnnotation(AstNode node) {
var function = node.thisOrAncestorOfType<FunctionDeclaration>();
if (function != null) {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_iterable.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_iterable.dart
index cc491aa..1c2b177 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_iterable.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_iterable.dart
@@ -38,7 +38,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceReturnTypeIterable newInstance() => ReplaceReturnTypeIterable();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_stream.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_stream.dart
index 829ebe6..bc38772 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_stream.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_stream.dart
@@ -38,7 +38,4 @@
});
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceReturnTypeStream newInstance() => ReplaceReturnTypeStream();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_var_with_dynamic.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_var_with_dynamic.dart
index 1991391..c3b6eff 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_var_with_dynamic.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_var_with_dynamic.dart
@@ -22,7 +22,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceVarWithDynamic newInstance() => ReplaceVarWithDynamic();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_brackets.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_brackets.dart
index 49ff4a0..e4eacf5 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_brackets.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_brackets.dart
@@ -33,7 +33,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithBrackets newInstance() => ReplaceWithBrackets();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_conditional_assignment.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_conditional_assignment.dart
index 4574077..5183e63 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_conditional_assignment.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_conditional_assignment.dart
@@ -48,10 +48,6 @@
}
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithConditionalAssignment newInstance() =>
- ReplaceWithConditionalAssignment();
-
static Statement _uniqueStatement(Statement statement) {
if (statement is Block) {
return _uniqueStatement(statement.statements.first);
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_eight_digit_hex.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_eight_digit_hex.dart
index 08271c9..17a4ab6 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_eight_digit_hex.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_eight_digit_hex.dart
@@ -48,7 +48,4 @@
builder.addSimpleReplacement(range.node(node), _replacement);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithEightDigitHex newInstance() => ReplaceWithEightDigitHex();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_extension_name.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_extension_name.dart
index 6bac2bd..5c05dba 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_extension_name.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_extension_name.dart
@@ -42,7 +42,4 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithExtensionName newInstance() => ReplaceWithExtensionName();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_filled.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_filled.dart
index 176694e..68a8075 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_filled.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_filled.dart
@@ -31,7 +31,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithFilled newInstance() => ReplaceWithFilled();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_identifier.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_identifier.dart
index 665f8e6..461563b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_identifier.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_identifier.dart
@@ -33,7 +33,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithIdentifier newInstance() => ReplaceWithIdentifier();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_interpolation.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_interpolation.dart
index 71adedb..ec84ddd 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_interpolation.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_interpolation.dart
@@ -157,9 +157,6 @@
}
return false;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithInterpolation newInstance() => ReplaceWithInterpolation();
}
class _StringStyle {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_empty.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_empty.dart
index 4ce36fe..566480a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_empty.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_empty.dart
@@ -45,9 +45,6 @@
});
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithIsEmpty newInstance() => ReplaceWithIsEmpty();
-
static _Replacement? _analyzeBinaryExpression(BinaryExpression binary) {
var operator = binary.operator.type;
var rightValue = _getIntValue(binary.rightOperand);
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_not_null_aware.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_not_null_aware.dart
index 2dad480..2e5671a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_not_null_aware.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_not_null_aware.dart
@@ -68,7 +68,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithNotNullAware newInstance() => ReplaceWithNotNullAware();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_null_aware.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_null_aware.dart
index d990668..821cd87 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_null_aware.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_null_aware.dart
@@ -13,7 +13,9 @@
/// The kind of correction to be made.
final _CorrectionKind correctionKind;
- ReplaceWithNullAware(this.correctionKind);
+ ReplaceWithNullAware.inChain() : correctionKind = _CorrectionKind.inChain;
+
+ ReplaceWithNullAware.single() : correctionKind = _CorrectionKind.single;
@override
// NNBD makes this obsolete in the "chain" application; for the "single"
@@ -82,14 +84,6 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithNullAware inChain() =>
- ReplaceWithNullAware(_CorrectionKind.inChain);
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithNullAware single() =>
- ReplaceWithNullAware(_CorrectionKind.single);
}
/// The kinds of corrections supported by [ReplaceWithNullAware].
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_tear_off.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_tear_off.dart
index 9c84f73..1465c28 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_tear_off.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_tear_off.dart
@@ -71,7 +71,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithTearOff newInstance() => ReplaceWithTearOff();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart
index b1236c9..49ddf35 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart
@@ -169,7 +169,4 @@
}
return node.thisOrAncestorOfType<TypeAnnotation>();
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ReplaceWithVar newInstance() => ReplaceWithVar();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart b/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart
index b18b4ef..9d880a9 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart
@@ -113,9 +113,6 @@
}
return null;
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static ShadowField newInstance() => ShadowField();
}
/// A utility that will find any references to a setter within an AST structure.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/sort_child_property_last.dart b/pkg/analysis_server/lib/src/services/correction/dart/sort_child_property_last.dart
index 06ed486..fbfb214 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/sort_child_property_last.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/sort_child_property_last.dart
@@ -98,7 +98,4 @@
return flutter.findNamedExpression(node, 'child') ??
flutter.findNamedExpression(node, 'children');
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static SortChildPropertyLast newInstance() => SortChildPropertyLast();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/sort_constructor_first.dart b/pkg/analysis_server/lib/src/services/correction/dart/sort_constructor_first.dart
index 3eb4641..f0a7e65 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/sort_constructor_first.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/sort_constructor_first.dart
@@ -43,7 +43,4 @@
);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static SortConstructorFirst newInstance() => SortConstructorFirst();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart b/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart
index bfbcb2a..46b54ee 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/sort_unnamed_constructor_first.dart
@@ -53,8 +53,4 @@
);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static SortUnnamedConstructorFirst newInstance() =>
- SortUnnamedConstructorFirst();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/split_and_condition.dart b/pkg/analysis_server/lib/src/services/correction/dart/split_and_condition.dart
index 028d245..41b23dc 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/split_and_condition.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/split_and_condition.dart
@@ -96,7 +96,4 @@
}
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static SplitAndCondition newInstance() => SplitAndCondition();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/split_variable_declaration.dart b/pkg/analysis_server/lib/src/services/correction/dart/split_variable_declaration.dart
index dee927b..8233e82 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/split_variable_declaration.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/split_variable_declaration.dart
@@ -68,7 +68,4 @@
builder.addSimpleInsertion(variable.name.end, ';' + eol + indent + name);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static SplitVariableDeclaration newInstance() => SplitVariableDeclaration();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart b/pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart
index 87abf94..4664cce 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart
@@ -68,9 +68,6 @@
yield _SurroundWithWhile(
statementsRange, indentOld, indentNew, indentedCode);
}
-
- /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
- static SurroundWith newInstance() => SurroundWith();
}
/// A correction processor that can make one of the possible change computed by
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/update_sdk_constraints.dart b/pkg/analysis_server/lib/src/services/correction/dart/update_sdk_constraints.dart
index 68e682f..377da02 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/update_sdk_constraints.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/update_sdk_constraints.dart
@@ -16,8 +16,24 @@
final String _minimumVersion;
/// Initialize a newly created instance that will update the SDK constraints
- /// to the [minimumVersion].
- UpdateSdkConstraints(this._minimumVersion);
+ /// to '2.14.0'.
+ UpdateSdkConstraints.version_2_14_0() : _minimumVersion = '2.14.0';
+
+ /// Initialize a newly created instance that will update the SDK constraints
+ /// to '2.1.0'.
+ UpdateSdkConstraints.version_2_1_0() : _minimumVersion = '2.1.0';
+
+ /// Initialize a newly created instance that will update the SDK constraints
+ /// to '2.2.0'.
+ UpdateSdkConstraints.version_2_2_0() : _minimumVersion = '2.2.0';
+
+ /// Initialize a newly created instance that will update the SDK constraints
+ /// to '2.2.0'.
+ UpdateSdkConstraints.version_2_2_2() : _minimumVersion = '2.2.2';
+
+ /// Initialize a newly created instance that will update the SDK constraints
+ /// to '2.2.0'.
+ UpdateSdkConstraints.version_2_6_0() : _minimumVersion = '2.6.0';
@override
// Too nuanced to do unattended.
@@ -80,25 +96,4 @@
}
return null;
}
-
- /// Return an instance of this class that will update the SDK constraints to
- /// '2.14.0'. Used as a tear-off in `FixProcessor`.
- static UpdateSdkConstraints version_2_14_0() =>
- UpdateSdkConstraints('2.14.0');
-
- /// Return an instance of this class that will update the SDK constraints to
- /// '2.1.0'. Used as a tear-off in `FixProcessor`.
- static UpdateSdkConstraints version_2_1_0() => UpdateSdkConstraints('2.1.0');
-
- /// Return an instance of this class that will update the SDK constraints to
- /// '2.2.0'. Used as a tear-off in `FixProcessor`.
- static UpdateSdkConstraints version_2_2_0() => UpdateSdkConstraints('2.2.0');
-
- /// Return an instance of this class that will update the SDK constraints to
- /// '2.2.0'. Used as a tear-off in `FixProcessor`.
- static UpdateSdkConstraints version_2_2_2() => UpdateSdkConstraints('2.2.2');
-
- /// Return an instance of this class that will update the SDK constraints to
- /// '2.2.0'. Used as a tear-off in `FixProcessor`.
- static UpdateSdkConstraints version_2_6_0() => UpdateSdkConstraints('2.6.0');
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_const.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_const.dart
index 110432e..17aeb6d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_const.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_const.dart
@@ -28,7 +28,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseConst newInstance() => UseConst();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart
index cdf82a9..7a08f4c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart
@@ -148,7 +148,4 @@
builder.addSimpleInsertion(body.end, '$eol$prefix}');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseCurlyBraces newInstance() => UseCurlyBraces();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_effective_integer_division.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_effective_integer_division.dart
index 56c4583..9f0c50f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_effective_integer_division.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_effective_integer_division.dart
@@ -46,8 +46,4 @@
}
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseEffectiveIntegerDivision newInstance() =>
- UseEffectiveIntegerDivision();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_eq_eq_null.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_eq_eq_null.dart
index 075f326..74b2e08 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_eq_eq_null.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_eq_eq_null.dart
@@ -34,7 +34,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseEqEqNull newInstance() => UseEqEqNull();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_is_not_empty.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_is_not_empty.dart
index f3dffff..b3a925a 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_is_not_empty.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_is_not_empty.dart
@@ -47,7 +47,4 @@
builder.addSimpleReplacement(range.node(identifier), 'isNotEmpty');
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseIsNotEmpty newInstance() => UseIsNotEmpty();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_not_eq_null.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_not_eq_null.dart
index e7f633c..a0d0ab2 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_not_eq_null.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_not_eq_null.dart
@@ -34,7 +34,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseNotEqNull newInstance() => UseNotEqNull();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/use_rethrow.dart b/pkg/analysis_server/lib/src/services/correction/dart/use_rethrow.dart
index 63add29..cfd3789 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/use_rethrow.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/use_rethrow.dart
@@ -31,7 +31,4 @@
});
}
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static UseRethrow newInstance() => UseRethrow();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_future.dart b/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_future.dart
index cbe9212..ac2e5c9 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_future.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_future.dart
@@ -40,7 +40,4 @@
);
});
}
-
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static WrapInFuture newInstance() => WrapInFuture();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_text.dart b/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_text.dart
index 9915a0a..3adaca2 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_text.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/wrap_in_text.dart
@@ -44,9 +44,6 @@
});
}
- /// Return an instance of this class. Used as a tear-off in `FixProcessor`.
- static WrapInText newInstance() => WrapInText();
-
static _Context? _extractContextInformation(AstNode node) {
if (node is Expression) {
var parent = node.parent;
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 33d338e..a24a679 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -347,344 +347,344 @@
/// the unique name must be used here.
static final Map<String, List<ProducerGenerator>> lintProducerMap = {
LintNames.always_declare_return_types: [
- AddReturnType.newInstance,
+ AddReturnType.new,
],
LintNames.always_require_non_null_named_parameters: [
- AddRequired.newInstance,
+ AddRequired.new,
],
LintNames.always_specify_types: [
- AddTypeAnnotation.newInstanceBulkFixable,
+ AddTypeAnnotation.bulkFixable,
],
LintNames.always_use_package_imports: [
- ConvertToPackageImport.newInstance,
+ ConvertToPackageImport.new,
],
LintNames.annotate_overrides: [
- AddOverride.newInstance,
+ AddOverride.new,
],
LintNames.avoid_annotating_with_dynamic: [
- RemoveTypeAnnotation.newInstance,
+ RemoveTypeAnnotation.new,
],
LintNames.avoid_empty_else: [
- RemoveEmptyElse.newInstance,
+ RemoveEmptyElse.new,
],
LintNames.avoid_escaping_inner_quotes: [
- ConvertQuotes.newInstance,
+ ConvertQuotes.new,
],
LintNames.avoid_function_literals_in_foreach_calls: [
- ConvertForEachToForLoop.newInstance,
+ ConvertForEachToForLoop.new,
],
LintNames.avoid_init_to_null: [
- RemoveInitializer.newInstance,
+ RemoveInitializer.new,
],
LintNames.avoid_null_checks_in_equality_operators: [
- RemoveComparison.newInstance,
+ RemoveComparison.new,
],
LintNames.avoid_print: [
- MakeConditionalOnDebugMode.newInstance,
+ MakeConditionalOnDebugMode.new,
],
LintNames.avoid_private_typedef_functions: [
- InlineTypedef.newInstance,
+ InlineTypedef.new,
],
LintNames.avoid_redundant_argument_values: [
- RemoveArgument.newInstance,
+ RemoveArgument.new,
],
LintNames.avoid_relative_lib_imports: [
- ConvertToPackageImport.newInstance,
+ ConvertToPackageImport.new,
],
LintNames.avoid_return_types_on_setters: [
- RemoveTypeAnnotation.newInstance,
+ RemoveTypeAnnotation.new,
],
LintNames.avoid_returning_null_for_future: [
// TODO(brianwilkerson) Consider applying in bulk.
- AddAsync.newInstance,
- WrapInFuture.newInstance,
+ AddAsync.new,
+ WrapInFuture.new,
],
LintNames.avoid_returning_null_for_void: [
- RemoveReturnedValue.newInstance,
+ RemoveReturnedValue.new,
],
LintNames.avoid_single_cascade_in_expression_statements: [
// TODO(brianwilkerson) This fix should be applied to some non-lint
// diagnostics and should also be available as an assist.
- ReplaceCascadeWithDot.newInstance,
+ ReplaceCascadeWithDot.new,
],
LintNames.avoid_types_as_parameter_names: [
- ConvertToOnType.newInstance,
+ ConvertToOnType.new,
],
LintNames.avoid_types_on_closure_parameters: [
- ReplaceWithIdentifier.newInstance,
- RemoveTypeAnnotation.newInstance,
+ ReplaceWithIdentifier.new,
+ RemoveTypeAnnotation.new,
],
LintNames.avoid_unused_constructor_parameters: [
- RemoveUnusedParameter.newInstance,
+ RemoveUnusedParameter.new,
],
LintNames.avoid_unnecessary_containers: [
- FlutterRemoveWidget.newInstance,
+ FlutterRemoveWidget.new,
],
LintNames.avoid_void_async: [
- ReplaceReturnTypeFuture.newInstance,
+ ReplaceReturnTypeFuture.new,
],
LintNames.await_only_futures: [
- RemoveAwait.newInstance,
+ RemoveAwait.new,
],
LintNames.cascade_invocations: [
- ConvertToCascade.newInstance,
+ ConvertToCascade.new,
],
LintNames.curly_braces_in_flow_control_structures: [
- UseCurlyBraces.newInstance,
+ UseCurlyBraces.new,
],
LintNames.diagnostic_describe_all_properties: [
- AddDiagnosticPropertyReference.newInstance,
+ AddDiagnosticPropertyReference.new,
],
LintNames.directives_ordering: [
- OrganizeImports.newInstance,
+ OrganizeImports.new,
],
LintNames.empty_catches: [
- RemoveEmptyCatch.newInstance,
+ RemoveEmptyCatch.new,
],
LintNames.empty_constructor_bodies: [
- RemoveEmptyConstructorBody.newInstance,
+ RemoveEmptyConstructorBody.new,
],
LintNames.empty_statements: [
- RemoveEmptyStatement.newInstance,
- ReplaceWithBrackets.newInstance,
+ RemoveEmptyStatement.new,
+ ReplaceWithBrackets.new,
],
LintNames.eol_at_end_of_file: [
- AddEolAtEndOfFile.newInstance,
+ AddEolAtEndOfFile.new,
],
LintNames.exhaustive_cases: [
- AddMissingEnumLikeCaseClauses.newInstance,
+ AddMissingEnumLikeCaseClauses.new,
],
LintNames.hash_and_equals: [
CreateMethod.equalsOrHashCode,
],
LintNames.leading_newlines_in_multiline_strings: [
- AddLeadingNewlineToString.newInstance,
+ AddLeadingNewlineToString.new,
],
LintNames.no_duplicate_case_values: [
- RemoveDuplicateCase.newInstance,
+ RemoveDuplicateCase.new,
],
LintNames.no_leading_underscores_for_library_prefixes: [
- RemoveLeadingUnderscore.newInstance,
+ RemoveLeadingUnderscore.new,
],
LintNames.no_leading_underscores_for_local_identifiers: [
- RemoveLeadingUnderscore.newInstance,
+ RemoveLeadingUnderscore.new,
],
LintNames.non_constant_identifier_names: [
- RenameToCamelCase.newInstance,
+ RenameToCamelCase.new,
],
LintNames.null_check_on_nullable_type_parameter: [
- ReplaceNullCheckWithCast.newInstance,
+ ReplaceNullCheckWithCast.new,
],
LintNames.null_closures: [
- ReplaceNullWithClosure.newInstance,
+ ReplaceNullWithClosure.new,
],
LintNames.omit_local_variable_types: [
- ReplaceWithVar.newInstance,
+ ReplaceWithVar.new,
],
LintNames.prefer_adjacent_string_concatenation: [
- RemoveOperator.newInstance,
+ RemoveOperator.new,
],
LintNames.prefer_collection_literals: [
- ConvertToListLiteral.newInstance,
- ConvertToMapLiteral.newInstance,
- ConvertToSetLiteral.newInstance,
+ ConvertToListLiteral.new,
+ ConvertToMapLiteral.new,
+ ConvertToSetLiteral.new,
],
LintNames.prefer_conditional_assignment: [
- ReplaceWithConditionalAssignment.newInstance,
+ ReplaceWithConditionalAssignment.new,
],
LintNames.prefer_const_constructors: [
- AddConst.newInstance,
- ReplaceNewWithConst.newInstance,
+ AddConst.new,
+ ReplaceNewWithConst.new,
],
LintNames.prefer_const_constructors_in_immutables: [
- AddConst.newInstance,
+ AddConst.new,
],
LintNames.prefer_const_declarations: [
- ReplaceFinalWithConst.newInstance,
+ ReplaceFinalWithConst.new,
],
LintNames.prefer_const_literals_to_create_immutables: [
- AddConst.newInstance,
+ AddConst.new,
],
LintNames.prefer_contains: [
- ConvertToContains.newInstance,
+ ConvertToContains.new,
],
LintNames.prefer_double_quotes: [
- ConvertToDoubleQuotes.newInstance,
+ ConvertToDoubleQuotes.new,
],
LintNames.prefer_equal_for_default_values: [
- ReplaceColonWithEquals.newInstance,
+ ReplaceColonWithEquals.new,
],
LintNames.prefer_expression_function_bodies: [
- ConvertToExpressionFunctionBody.newInstance,
+ ConvertToExpressionFunctionBody.new,
],
LintNames.prefer_final_fields: [
- MakeFinal.newInstance,
+ MakeFinal.new,
],
LintNames.prefer_final_in_for_each: [
- MakeFinal.newInstance,
+ MakeFinal.new,
],
LintNames.prefer_final_locals: [
- MakeFinal.newInstance,
+ MakeFinal.new,
],
LintNames.prefer_final_parameters: [
- MakeFinal.newInstance,
+ MakeFinal.new,
],
LintNames.prefer_for_elements_to_map_fromIterable: [
- ConvertMapFromIterableToForLiteral.newInstance,
+ ConvertMapFromIterableToForLiteral.new,
],
LintNames.prefer_function_declarations_over_variables: [
- ConvertToFunctionDeclaration.newInstance,
+ ConvertToFunctionDeclaration.new,
],
LintNames.prefer_generic_function_type_aliases: [
- ConvertToGenericFunctionSyntax.newInstance,
+ ConvertToGenericFunctionSyntax.new,
],
LintNames.prefer_if_elements_to_conditional_expressions: [
- ConvertConditionalExpressionToIfElement.newInstance,
+ ConvertConditionalExpressionToIfElement.new,
],
LintNames.prefer_if_null_operators: [
- ConvertToIfNull.newInstance,
+ ConvertToIfNull.new,
],
LintNames.prefer_initializing_formals: [
- ConvertToInitializingFormal.newInstance,
+ ConvertToInitializingFormal.new,
],
LintNames.prefer_inlined_adds: [
- ConvertAddAllToSpread.newInstance,
- InlineInvocation.newInstance,
+ ConvertAddAllToSpread.new,
+ InlineInvocation.new,
],
LintNames.prefer_int_literals: [
- ConvertToIntLiteral.newInstance,
+ ConvertToIntLiteral.new,
],
LintNames.prefer_interpolation_to_compose_strings: [
- ReplaceWithInterpolation.newInstance,
+ ReplaceWithInterpolation.new,
],
LintNames.prefer_is_empty: [
- ReplaceWithIsEmpty.newInstance,
+ ReplaceWithIsEmpty.new,
],
LintNames.prefer_is_not_empty: [
- UseIsNotEmpty.newInstance,
+ UseIsNotEmpty.new,
],
LintNames.prefer_is_not_operator: [
- ConvertIntoIsNot.newInstance,
+ ConvertIntoIsNot.new,
],
LintNames.prefer_iterable_whereType: [
- ConvertToWhereType.newInstance,
+ ConvertToWhereType.new,
],
LintNames.prefer_null_aware_operators: [
- ConvertToNullAware.newInstance,
+ ConvertToNullAware.new,
],
LintNames.prefer_relative_imports: [
- ConvertToRelativeImport.newInstance,
+ ConvertToRelativeImport.new,
],
LintNames.prefer_single_quotes: [
- ConvertToSingleQuotes.newInstance,
+ ConvertToSingleQuotes.new,
],
LintNames.prefer_spread_collections: [
- ConvertAddAllToSpread.newInstance,
+ ConvertAddAllToSpread.new,
],
LintNames.prefer_typing_uninitialized_variables: [
- AddTypeAnnotation.newInstanceBulkFixable,
+ AddTypeAnnotation.bulkFixable,
],
LintNames.prefer_void_to_null: [
- ReplaceNullWithVoid.newInstance,
+ ReplaceNullWithVoid.new,
],
LintNames.require_trailing_commas: [
- AddTrailingComma.newInstance,
+ AddTrailingComma.new,
],
LintNames.sized_box_for_whitespace: [
- ReplaceContainerWithSizedBox.newInstance,
+ ReplaceContainerWithSizedBox.new,
],
LintNames.slash_for_doc_comments: [
- ConvertDocumentationIntoLine.newInstance,
+ ConvertDocumentationIntoLine.new,
],
LintNames.sort_child_properties_last: [
- SortChildPropertyLast.newInstance,
+ SortChildPropertyLast.new,
],
LintNames.sort_constructors_first: [
- SortConstructorFirst.newInstance,
+ SortConstructorFirst.new,
],
LintNames.sort_unnamed_constructors_first: [
- SortUnnamedConstructorFirst.newInstance,
+ SortUnnamedConstructorFirst.new,
],
LintNames.type_annotate_public_apis: [
- AddTypeAnnotation.newInstanceBulkFixable,
+ AddTypeAnnotation.bulkFixable,
],
LintNames.type_init_formals: [
- RemoveTypeAnnotation.newInstance,
+ RemoveTypeAnnotation.new,
],
LintNames.unawaited_futures: [
- AddAwait.newInstance,
+ AddAwait.new,
],
LintNames.unnecessary_brace_in_string_interps: [
- RemoveInterpolationBraces.newInstance,
+ RemoveInterpolationBraces.new,
],
LintNames.unnecessary_const: [
- RemoveUnnecessaryConst.newInstance,
+ RemoveUnnecessaryConst.new,
],
LintNames.unnecessary_constructor_name: [
- RemoveConstructorName.newInstance,
+ RemoveConstructorName.new,
],
LintNames.unnecessary_final: [
- ReplaceFinalWithVar.newInstance,
+ ReplaceFinalWithVar.new,
],
LintNames.unnecessary_getters_setters: [
- MakeFieldPublic.newInstance,
+ MakeFieldPublic.new,
],
LintNames.unnecessary_lambdas: [
- ReplaceWithTearOff.newInstance,
+ ReplaceWithTearOff.new,
],
LintNames.unnecessary_late: [
- RemoveUnnecessaryLate.newInstance,
+ RemoveUnnecessaryLate.new,
],
LintNames.unnecessary_new: [
- RemoveUnnecessaryNew.newInstance,
+ RemoveUnnecessaryNew.new,
],
LintNames.unnecessary_null_aware_assignments: [
- RemoveAssignment.newInstance,
+ RemoveAssignment.new,
],
LintNames.unnecessary_null_in_if_null_operators: [
- RemoveIfNullOperator.newInstance,
+ RemoveIfNullOperator.new,
],
LintNames.unnecessary_nullable_for_final_variable_declarations: [
- RemoveQuestionMark.newInstance,
+ RemoveQuestionMark.new,
],
LintNames.unnecessary_overrides: [
- RemoveMethodDeclaration.newInstance,
+ RemoveMethodDeclaration.new,
],
LintNames.unnecessary_parenthesis: [
- RemoveUnnecessaryParentheses.newInstance,
+ RemoveUnnecessaryParentheses.new,
],
LintNames.unnecessary_raw_strings: [
- RemoveUnnecessaryRawString.newInstance,
+ RemoveUnnecessaryRawString.new,
],
LintNames.unnecessary_string_escapes: [
- RemoveUnnecessaryStringEscape.newInstance,
+ RemoveUnnecessaryStringEscape.new,
],
LintNames.unnecessary_string_interpolations: [
- RemoveUnnecessaryStringInterpolation.newInstance,
+ RemoveUnnecessaryStringInterpolation.new,
],
LintNames.unnecessary_this: [
- RemoveThisExpression.newInstance,
+ RemoveThisExpression.new,
],
LintNames.use_enums: [
- ConvertClassToEnum.newInstance,
+ ConvertClassToEnum.new,
],
LintNames.use_full_hex_values_for_flutter_colors: [
- ReplaceWithEightDigitHex.newInstance,
+ ReplaceWithEightDigitHex.new,
],
LintNames.use_function_type_syntax_for_parameters: [
- ConvertToGenericFunctionSyntax.newInstance,
+ ConvertToGenericFunctionSyntax.new,
],
LintNames.use_key_in_widget_constructors: [
- AddKeyToConstructors.newInstance,
+ AddKeyToConstructors.new,
],
LintNames.use_raw_strings: [
- ConvertToRawString.newInstance,
+ ConvertToRawString.new,
],
LintNames.use_rethrow_when_possible: [
- UseRethrow.newInstance,
+ UseRethrow.new,
],
LintNames.use_super_parameters: [
- ConvertToSuperParameters.newInstance,
+ ConvertToSuperParameters.new,
],
};
@@ -700,47 +700,47 @@
ImportLibrary.forType,
],
CompileTimeErrorCode.EXTENDS_NON_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forType,
],
CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS: [
- AddMissingParameter.newInstance,
- DataDriven.newInstance,
+ AddMissingParameter.new,
+ DataDriven.new,
],
CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED: [
- AddMissingParameter.newInstance,
- DataDriven.newInstance,
+ AddMissingParameter.new,
+ DataDriven.new,
],
CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forType,
],
CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS: [
- AddSuperConstructorInvocation.newInstance,
+ AddSuperConstructorInvocation.new,
],
CompileTimeErrorCode.INVALID_ANNOTATION: [
ImportLibrary.forTopLevelVariable,
ImportLibrary.forType,
],
CompileTimeErrorCode.INVALID_OVERRIDE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.MIXIN_OF_NON_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forType,
],
CompileTimeErrorCode.NEW_WITH_NON_TYPE: [
ImportLibrary.forType,
],
CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT: [
- AddSuperConstructorInvocation.newInstance,
+ AddSuperConstructorInvocation.new,
],
CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT: [
- AddSuperConstructorInvocation.newInstance,
- CreateConstructorSuper.newInstance,
+ AddSuperConstructorInvocation.new,
+ CreateConstructorSuper.new,
],
CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE: [
ImportLibrary.forType,
@@ -752,7 +752,7 @@
ImportLibrary.forType,
],
CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME: [
ImportLibrary.forType,
@@ -762,72 +762,72 @@
ImportLibrary.forType,
],
CompileTimeErrorCode.UNDEFINED_CLASS: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forType,
],
CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT: [
- AddSuperConstructorInvocation.newInstance,
+ AddSuperConstructorInvocation.new,
],
CompileTimeErrorCode.UNDEFINED_FUNCTION: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forExtension,
ImportLibrary.forFunction,
ImportLibrary.forType,
],
CompileTimeErrorCode.UNDEFINED_GETTER: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forExtensionMember,
ImportLibrary.forTopLevelVariable,
ImportLibrary.forType,
],
CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forExtension,
ImportLibrary.forFunction,
ImportLibrary.forTopLevelVariable,
ImportLibrary.forType,
],
CompileTimeErrorCode.UNDEFINED_METHOD: [
- DataDriven.newInstance,
+ DataDriven.new,
ImportLibrary.forExtensionMember,
ImportLibrary.forFunction,
ImportLibrary.forType,
],
CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [
- ChangeArgumentName.newInstance,
- DataDriven.newInstance,
+ ChangeArgumentName.new,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_OPERATOR: [
ImportLibrary.forExtensionMember,
],
CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.UNDEFINED_SETTER: [
- DataDriven.newInstance,
+ DataDriven.new,
// TODO(brianwilkerson) Support ImportLibrary for non-extension members.
ImportLibrary.forExtensionMember,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION: [
- DataDriven.newInstance,
+ DataDriven.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.DEPRECATED_MEMBER_USE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD: [
- DataDriven.newInstance,
+ DataDriven.new,
],
HintCode.SDK_VERSION_ASYNC_EXPORTED_FROM_CORE: [
ImportLibrary.dartAsync,
@@ -840,252 +840,252 @@
/// [lintProducerMap].
static const Map<ErrorCode, List<ProducerGenerator>> nonLintProducerMap = {
CompileTimeErrorCode.ASSIGNMENT_TO_FINAL: [
- MakeFieldNotFinal.newInstance,
- AddLate.newInstance,
+ MakeFieldNotFinal.new,
+ AddLate.new,
],
CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL: [
- MakeVariableNotFinal.newInstance,
+ MakeVariableNotFinal.new,
],
CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE: [
- AddNullCheck.newInstance,
- WrapInText.newInstance,
+ AddNullCheck.new,
+ WrapInText.new,
],
CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT: [
- AddAsync.newInstance,
+ AddAsync.new,
],
CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT: [
- AddAsync.newInstance,
+ AddAsync.new,
],
CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY: [
AddAsync.missingReturn,
],
CompileTimeErrorCode.CAST_TO_NON_TYPE: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
- CreateMixin.newInstance,
+ CreateClass.new,
+ CreateMixin.new,
],
CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER: [
- ConvertIntoBlockBody.newInstance,
- CreateNoSuchMethod.newInstance,
- MakeClassAbstract.newInstance,
+ ConvertIntoBlockBody.new,
+ CreateNoSuchMethod.new,
+ MakeClassAbstract.new,
],
CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE: [
- UseConst.newInstance,
+ UseConst.new,
],
CompileTimeErrorCode.CONST_INSTANCE_FIELD: [
- AddStatic.newInstance,
+ AddStatic.new,
],
CompileTimeErrorCode.CONST_WITH_NON_CONST: [
- RemoveConst.newInstance,
+ RemoveConst.new,
],
CompileTimeErrorCode.CONST_WITH_NON_TYPE: [
ChangeTo.classOrMixin,
],
CompileTimeErrorCode.DEFAULT_LIST_CONSTRUCTOR: [
- ConvertToListLiteral.newInstance,
- ReplaceWithFilled.newInstance,
+ ConvertToListLiteral.new,
+ ReplaceWithFilled.new,
],
CompileTimeErrorCode.EXTENDS_NON_CLASS: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
+ CreateClass.new,
],
CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER: [
- ReplaceWithExtensionName.newInstance,
+ ReplaceWithExtensionName.new,
],
CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS: [
- CreateConstructor.newInstance,
+ CreateConstructor.new,
],
CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED: [
- CreateConstructor.newInstance,
- ConvertToNamedArguments.newInstance,
+ CreateConstructor.new,
+ ConvertToNamedArguments.new,
],
CompileTimeErrorCode.FINAL_NOT_INITIALIZED: [
- AddLate.newInstance,
- CreateConstructorForFinalFields.newInstance,
+ AddLate.new,
+ CreateConstructorForFinalFields.new,
],
CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1: [
- AddFieldFormalParameters.newInstance,
+ AddFieldFormalParameters.new,
],
CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2: [
- AddFieldFormalParameters.newInstance,
+ AddFieldFormalParameters.new,
],
CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS: [
- AddFieldFormalParameters.newInstance,
+ AddFieldFormalParameters.new,
],
CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE: [
- ReplaceReturnTypeStream.newInstance,
+ ReplaceReturnTypeStream.new,
],
CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE: [
- ReplaceReturnTypeFuture.newInstance,
+ ReplaceReturnTypeFuture.new,
],
CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE: [
- ReplaceReturnTypeIterable.newInstance,
+ ReplaceReturnTypeIterable.new,
],
CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
+ CreateClass.new,
],
CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD: [
- CreateField.newInstance,
+ CreateField.new,
],
CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER: [
- ChangeToStaticAccess.newInstance,
+ ChangeToStaticAccess.new,
],
CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE: [
- ChangeToNearestPreciseValue.newInstance,
+ ChangeToNearestPreciseValue.new,
],
CompileTimeErrorCode.INVALID_ANNOTATION: [
ChangeTo.annotation,
- CreateClass.newInstance,
+ CreateClass.new,
],
CompileTimeErrorCode.INVALID_ASSIGNMENT: [
- AddExplicitCast.newInstance,
- AddNullCheck.newInstance,
- ChangeTypeAnnotation.newInstance,
- MakeVariableNullable.newInstance,
+ AddExplicitCast.new,
+ AddNullCheck.new,
+ ChangeTypeAnnotation.new,
+ MakeVariableNullable.new,
],
CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION: [
- RemoveParenthesesInGetterInvocation.newInstance,
+ RemoveParenthesesInGetterInvocation.new,
],
CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER: [
- AddRequiredKeyword.newInstance,
- MakeVariableNullable.newInstance,
+ AddRequiredKeyword.new,
+ MakeVariableNullable.new,
],
CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_WITH_ANNOTATION: [
- AddRequiredKeyword.newInstance,
+ AddRequiredKeyword.new,
],
CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT: [
- AddMissingRequiredArgument.newInstance,
+ AddMissingRequiredArgument.new,
],
CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE: [
- ExtendClassForMixin.newInstance,
+ ExtendClassForMixin.new,
],
CompileTimeErrorCode.MIXIN_OF_NON_CLASS: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
+ CreateClass.new,
],
CompileTimeErrorCode.NEW_WITH_NON_TYPE: [
ChangeTo.classOrMixin,
],
CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR: [
- CreateConstructor.newInstance,
+ CreateConstructor.new,
],
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS:
[
- CreateMissingOverrides.newInstance,
- CreateNoSuchMethod.newInstance,
- MakeClassAbstract.newInstance,
+ CreateMissingOverrides.new,
+ CreateNoSuchMethod.new,
+ MakeClassAbstract.new,
],
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR: [
- CreateMissingOverrides.newInstance,
- CreateNoSuchMethod.newInstance,
- MakeClassAbstract.newInstance,
+ CreateMissingOverrides.new,
+ CreateNoSuchMethod.new,
+ MakeClassAbstract.new,
],
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE: [
- CreateMissingOverrides.newInstance,
- CreateNoSuchMethod.newInstance,
- MakeClassAbstract.newInstance,
+ CreateMissingOverrides.new,
+ CreateNoSuchMethod.new,
+ MakeClassAbstract.new,
],
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE: [
- CreateMissingOverrides.newInstance,
- CreateNoSuchMethod.newInstance,
- MakeClassAbstract.newInstance,
+ CreateMissingOverrides.new,
+ CreateNoSuchMethod.new,
+ MakeClassAbstract.new,
],
CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO: [
- CreateMissingOverrides.newInstance,
- CreateNoSuchMethod.newInstance,
- MakeClassAbstract.newInstance,
+ CreateMissingOverrides.new,
+ CreateNoSuchMethod.new,
+ MakeClassAbstract.new,
],
CompileTimeErrorCode.NON_BOOL_CONDITION: [
- AddNeNull.newInstance,
+ AddNeNull.new,
],
CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR: [
- AddConst.newInstance,
+ AddConst.new,
],
CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT: [
- CreateClass.newInstance,
- CreateMixin.newInstance,
+ CreateClass.new,
+ CreateMixin.new,
],
CompileTimeErrorCode.NOT_A_TYPE: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
- CreateMixin.newInstance,
+ CreateClass.new,
+ CreateMixin.new,
],
CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD: [
- AddLate.newInstance,
+ AddLate.new,
],
CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE: [
- RemoveQuestionMark.newInstance,
+ RemoveQuestionMark.new,
],
CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE: [
- RemoveQuestionMark.newInstance,
+ RemoveQuestionMark.new,
],
CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE: [
- RemoveQuestionMark.newInstance,
+ RemoveQuestionMark.new,
],
CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE: [
- RemoveQuestionMark.newInstance,
+ RemoveQuestionMark.new,
],
CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION: [
- MakeReturnTypeNullable.newInstance,
- ReplaceReturnType.newInstance,
+ MakeReturnTypeNullable.new,
+ ReplaceReturnType.new,
],
CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD: [
- MakeReturnTypeNullable.newInstance,
- ReplaceReturnType.newInstance,
+ MakeReturnTypeNullable.new,
+ ReplaceReturnType.new,
],
CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY: [
- AddSwitchCaseBreak.newInstance,
+ AddSwitchCaseBreak.new,
],
CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
- CreateMixin.newInstance,
+ CreateClass.new,
+ CreateMixin.new,
],
CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE: [
- AddNullCheck.newInstance,
+ AddNullCheck.new,
],
CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE: [
- AddNullCheck.newInstance,
- ExtractLocalVariable.newInstance,
+ AddNullCheck.new,
+ ExtractLocalVariable.new,
ReplaceWithNullAware.single,
],
CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE: [
- AddNullCheck.newInstance,
+ AddNullCheck.new,
],
CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE: [
- AddNullCheck.newInstance,
- ExtractLocalVariable.newInstance,
+ AddNullCheck.new,
+ ExtractLocalVariable.new,
ReplaceWithNullAware.single,
],
CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION: [
- AddNullCheck.newInstance,
+ AddNullCheck.new,
],
CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR: [
- AddNullCheck.newInstance,
+ AddNullCheck.new,
],
CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD: [
- AddNullCheck.newInstance,
- ConvertToNullAwareSpread.newInstance,
+ AddNullCheck.new,
+ ConvertToNullAwareSpread.new,
],
CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH: [
- AddNullCheck.newInstance,
+ AddNullCheck.new,
],
CompileTimeErrorCode.UNDEFINED_ANNOTATION: [
ChangeTo.annotation,
- CreateClass.newInstance,
+ CreateClass.new,
],
CompileTimeErrorCode.UNDEFINED_CLASS: [
ChangeTo.classOrMixin,
- CreateClass.newInstance,
- CreateMixin.newInstance,
+ CreateClass.new,
+ CreateMixin.new,
],
CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN: [
- ReplaceBooleanWithBool.newInstance,
+ ReplaceBooleanWithBool.new,
],
CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER: [
ChangeTo.getterOrSetter,
- CreateGetter.newInstance,
+ CreateGetter.new,
],
CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD: [
ChangeTo.method,
@@ -1093,155 +1093,155 @@
],
CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER: [
ChangeTo.getterOrSetter,
- CreateSetter.newInstance,
+ CreateSetter.new,
],
CompileTimeErrorCode.UNDEFINED_FUNCTION: [
ChangeTo.function,
- CreateClass.newInstance,
- CreateFunction.newInstance,
+ CreateClass.new,
+ CreateFunction.new,
],
CompileTimeErrorCode.UNDEFINED_GETTER: [
ChangeTo.getterOrSetter,
- CreateClass.newInstance,
- CreateField.newInstance,
- CreateGetter.newInstance,
- CreateLocalVariable.newInstance,
- CreateMethodOrFunction.newInstance,
- CreateMixin.newInstance,
+ CreateClass.new,
+ CreateField.new,
+ CreateGetter.new,
+ CreateLocalVariable.new,
+ CreateMethodOrFunction.new,
+ CreateMixin.new,
],
CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [
ChangeTo.getterOrSetter,
- CreateClass.newInstance,
- CreateField.newInstance,
- CreateGetter.newInstance,
- CreateLocalVariable.newInstance,
- CreateMethodOrFunction.newInstance,
- CreateMixin.newInstance,
- CreateSetter.newInstance,
+ CreateClass.new,
+ CreateField.new,
+ CreateGetter.new,
+ CreateLocalVariable.new,
+ CreateMethodOrFunction.new,
+ CreateMixin.new,
+ CreateSetter.new,
],
CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT: [
- AddAsync.newInstance,
+ AddAsync.new,
],
CompileTimeErrorCode.UNDEFINED_METHOD: [
ChangeTo.method,
- CreateClass.newInstance,
- CreateFunction.newInstance,
+ CreateClass.new,
+ CreateFunction.new,
CreateMethod.method,
],
CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [
- AddMissingParameterNamed.newInstance,
- ConvertFlutterChild.newInstance,
- ConvertFlutterChildren.newInstance,
+ AddMissingParameterNamed.new,
+ ConvertFlutterChild.new,
+ ConvertFlutterChildren.new,
],
CompileTimeErrorCode.UNDEFINED_SETTER: [
ChangeTo.getterOrSetter,
- CreateField.newInstance,
- CreateSetter.newInstance,
+ CreateField.new,
+ CreateSetter.new,
],
CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER: [
// TODO(brianwilkerson) Consider adding fixes to create a field, getter,
// method or setter. The existing _addFix methods would need to be
// updated so that only the appropriate subset is generated.
- QualifyReference.newInstance,
+ QualifyReference.new,
],
CompileTimeErrorCode
.UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE: [
// TODO(brianwilkerson) Consider adding fixes to create a field, getter,
// method or setter. The existing producers would need to be updated so
// that only the appropriate subset is generated.
- QualifyReference.newInstance,
+ QualifyReference.new,
],
CompileTimeErrorCode.URI_DOES_NOT_EXIST: [
- CreateFile.newInstance,
+ CreateFile.new,
],
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [
- MoveTypeArgumentsToClass.newInstance,
- RemoveTypeArguments.newInstance,
+ MoveTypeArgumentsToClass.new,
+ RemoveTypeArguments.new,
],
CompileTimeErrorCode.YIELD_OF_INVALID_TYPE: [
- MakeReturnTypeNullable.newInstance,
+ MakeReturnTypeNullable.new,
],
HintCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE: [
- AddReturnNull.newInstance,
+ AddReturnNull.new,
],
HintCode.CAN_BE_NULL_AFTER_NULL_AWARE: [
ReplaceWithNullAware.inChain,
],
HintCode.DEAD_CODE: [
- RemoveDeadCode.newInstance,
+ RemoveDeadCode.new,
],
HintCode.DEAD_CODE_CATCH_FOLLOWING_CATCH: [
// TODO(brianwilkerson) Add a fix to move the unreachable catch clause to
// a place where it can be reached (when possible).
- RemoveDeadCode.newInstance,
+ RemoveDeadCode.new,
],
HintCode.DEAD_CODE_ON_CATCH_SUBTYPE: [
// TODO(brianwilkerson) Add a fix to move the unreachable catch clause to
// a place where it can be reached (when possible).
- RemoveDeadCode.newInstance,
+ RemoveDeadCode.new,
],
HintCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE: [
- RemoveDeprecatedNewInCommentReference.newInstance,
+ RemoveDeprecatedNewInCommentReference.new,
],
HintCode.DIVISION_OPTIMIZATION: [
- UseEffectiveIntegerDivision.newInstance,
+ UseEffectiveIntegerDivision.new,
],
HintCode.DUPLICATE_HIDDEN_NAME: [
- RemoveNameFromCombinator.newInstance,
+ RemoveNameFromCombinator.new,
],
HintCode.DUPLICATE_IMPORT: [
- RemoveUnusedImport.newInstance,
+ RemoveUnusedImport.new,
],
HintCode.DUPLICATE_SHOWN_NAME: [
- RemoveNameFromCombinator.newInstance,
+ RemoveNameFromCombinator.new,
],
// TODO(brianwilkerson) Add a fix to convert the path to a package: import.
// HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE: [],
HintCode.INVALID_FACTORY_ANNOTATION: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.INVALID_IMMUTABLE_ANNOTATION: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.INVALID_LITERAL_ANNOTATION: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.INVALID_REQUIRED_NAMED_PARAM: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.INVALID_REQUIRED_POSITIONAL_PARAM: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.INVALID_SEALED_ANNOTATION: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.MISSING_REQUIRED_PARAM: [
- AddMissingRequiredArgument.newInstance,
+ AddMissingRequiredArgument.new,
],
HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS: [
- AddMissingRequiredArgument.newInstance,
+ AddMissingRequiredArgument.new,
],
HintCode.MISSING_RETURN: [
AddAsync.missingReturn,
],
HintCode.NULLABLE_TYPE_IN_CATCH_CLAUSE: [
- RemoveQuestionMark.newInstance,
+ RemoveQuestionMark.new,
],
HintCode.OVERRIDE_ON_NON_OVERRIDING_FIELD: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER: [
- RemoveAnnotation.newInstance,
+ RemoveAnnotation.new,
],
// TODO(brianwilkerson) Add a fix to normalize the path.
// HintCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT: [],
@@ -1273,31 +1273,31 @@
UpdateSdkConstraints.version_2_2_2,
],
HintCode.TYPE_CHECK_IS_NOT_NULL: [
- UseNotEqNull.newInstance,
+ UseNotEqNull.new,
],
HintCode.TYPE_CHECK_IS_NULL: [
- UseEqEqNull.newInstance,
+ UseEqEqNull.new,
],
HintCode.UNDEFINED_HIDDEN_NAME: [
- RemoveNameFromCombinator.newInstance,
+ RemoveNameFromCombinator.new,
],
HintCode.UNDEFINED_SHOWN_NAME: [
- RemoveNameFromCombinator.newInstance,
+ RemoveNameFromCombinator.new,
],
HintCode.UNNECESSARY_CAST: [
- RemoveUnnecessaryCast.newInstance,
+ RemoveUnnecessaryCast.new,
],
HintCode.UNNECESSARY_IMPORT: [
- RemoveUnusedImport.newInstance,
+ RemoveUnusedImport.new,
],
// HintCode.UNNECESSARY_NO_SUCH_METHOD: [
// TODO(brianwilkerson) Add a fix to remove the method.
// ],
HintCode.UNNECESSARY_NULL_COMPARISON_FALSE: [
- RemoveComparison.newInstance,
+ RemoveComparison.new,
],
HintCode.UNNECESSARY_NULL_COMPARISON_TRUE: [
- RemoveComparison.newInstance,
+ RemoveComparison.new,
],
// HintCode.UNNECESSARY_TYPE_CHECK_FALSE: [
// TODO(brianwilkerson) Add a fix to remove the type check.
@@ -1306,61 +1306,61 @@
// TODO(brianwilkerson) Add a fix to remove the type check.
// ],
HintCode.UNUSED_CATCH_CLAUSE: [
- RemoveUnusedCatchClause.newInstance,
+ RemoveUnusedCatchClause.new,
],
HintCode.UNUSED_CATCH_STACK: [
- RemoveUnusedCatchStack.newInstance,
+ RemoveUnusedCatchStack.new,
],
HintCode.UNUSED_ELEMENT: [
- RemoveUnusedElement.newInstance,
+ RemoveUnusedElement.new,
],
HintCode.UNUSED_FIELD: [
- RemoveUnusedField.newInstance,
+ RemoveUnusedField.new,
],
HintCode.UNUSED_IMPORT: [
- RemoveUnusedImport.newInstance,
+ RemoveUnusedImport.new,
],
HintCode.UNUSED_LABEL: [
- RemoveUnusedLabel.newInstance,
+ RemoveUnusedLabel.new,
],
HintCode.UNUSED_LOCAL_VARIABLE: [
- RemoveUnusedLocalVariable.newInstance,
+ RemoveUnusedLocalVariable.new,
],
HintCode.UNUSED_SHOWN_NAME: [
- RemoveNameFromCombinator.newInstance,
+ RemoveNameFromCombinator.new,
],
ParserErrorCode.ABSTRACT_CLASS_MEMBER: [
- RemoveAbstract.newInstance,
+ RemoveAbstract.new,
],
ParserErrorCode.EXPECTED_TOKEN: [
- InsertSemicolon.newInstance,
+ InsertSemicolon.new,
],
ParserErrorCode.GETTER_WITH_PARAMETERS: [
- RemoveParametersInGetterDeclaration.newInstance,
+ RemoveParametersInGetterDeclaration.new,
],
ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE: [
- AddTypeAnnotation.newInstance,
+ AddTypeAnnotation.new,
],
ParserErrorCode.MISSING_FUNCTION_BODY: [
- ConvertIntoBlockBody.newInstance,
+ ConvertIntoBlockBody.new,
],
ParserErrorCode.VAR_AS_TYPE_NAME: [
- ReplaceVarWithDynamic.newInstance,
+ ReplaceVarWithDynamic.new,
],
StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION: [
- RemoveDeadIfNull.newInstance,
+ RemoveDeadIfNull.new,
],
StaticWarningCode.INVALID_NULL_AWARE_OPERATOR: [
- ReplaceWithNotNullAware.newInstance,
+ ReplaceWithNotNullAware.new,
],
StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT: [
- ReplaceWithNotNullAware.newInstance,
+ ReplaceWithNotNullAware.new,
],
StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH: [
- AddMissingEnumCaseClauses.newInstance,
+ AddMissingEnumCaseClauses.new,
],
StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION: [
- RemoveNonNullAssertion.newInstance,
+ RemoveNonNullAssertion.new,
],
};
@@ -1454,8 +1454,8 @@
if (errorCode is LintCode || errorCode is HintCode) {
var generators = [
- IgnoreDiagnosticOnLine.newInstance,
- IgnoreDiagnosticInFile.newInstance,
+ IgnoreDiagnosticOnLine.new,
+ IgnoreDiagnosticInFile.new,
];
for (var generator in generators) {
await compute(generator());
diff --git a/pkg/analysis_server/test/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index cfc2ead..068bd50 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -82,7 +82,7 @@
expect(error.message, equals('mock request exception'));
expect(error.stackTrace, isNotNull);
expect(error.stackTrace, isNotEmpty);
- channel.expectMsgCount(responseCount: 1, notificationCount: 1);
+ channel.expectMsgCount(responseCount: 1, notificationCount: 2);
});
}
@@ -95,7 +95,7 @@
var response = await channel.sendRequest(request, throwOnError: false);
expect(response.id, equals('0'));
expect(response.error, isNull);
- channel.expectMsgCount(responseCount: 1, notificationCount: 2);
+ channel.expectMsgCount(responseCount: 2, notificationCount: 2);
expect(channel.notificationsReceived[1].event, SERVER_NOTIFICATION_ERROR);
}
diff --git a/tools/VERSION b/tools/VERSION
index 1e75bc9..562e238 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 18
PATCH 0
-PRERELEASE 7
+PRERELEASE 8
PRERELEASE_PATCH 0
\ No newline at end of file