Version 2.18.0-25.0.dev
Merge commit '046faf2edc9ce1f34613dd49ab4d471338b1a5da' into 'dev'
diff --git a/pkg/analysis_server/analysis_options.yaml b/pkg/analysis_server/analysis_options.yaml
index 5d8f3e7..1b77fd0 100644
--- a/pkg/analysis_server/analysis_options.yaml
+++ b/pkg/analysis_server/analysis_options.yaml
@@ -31,3 +31,4 @@
rules:
- depend_on_referenced_packages
- unnecessary_parenthesis
+ - use_super_parameters
diff --git a/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart b/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart
index a701840..cb9dee7 100644
--- a/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart
+++ b/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart
@@ -23,8 +23,7 @@
/// or `null` if not converting a "Read" entry.
StringBuffer? readBuffer;
- InstrumentationInputConverter(String tmpSrcDirPath, PathMap srcPathMap)
- : super(tmpSrcDirPath, srcPathMap);
+ InstrumentationInputConverter(super.tmpSrcDirPath, super.srcPathMap);
@override
Operation? convert(String line) {
diff --git a/pkg/analysis_server/benchmark/integration/log_file_input_converter.dart b/pkg/analysis_server/benchmark/integration/log_file_input_converter.dart
index bd87c70..87339e7 100644
--- a/pkg/analysis_server/benchmark/integration/log_file_input_converter.dart
+++ b/pkg/analysis_server/benchmark/integration/log_file_input_converter.dart
@@ -19,8 +19,7 @@
/// [LogFileInputConverter] converts a log file stream
/// into a series of operations to be sent to the analysis server.
class LogFileInputConverter extends CommonInputConverter {
- LogFileInputConverter(String tmpSrcDirPath, PathMap srcPathMap)
- : super(tmpSrcDirPath, srcPathMap);
+ LogFileInputConverter(super.tmpSrcDirPath, super.srcPathMap);
@override
Operation? convert(String line) {
diff --git a/pkg/analysis_server/benchmark/integration/operation.dart b/pkg/analysis_server/benchmark/integration/operation.dart
index db0bfcf..8a652aa 100644
--- a/pkg/analysis_server/benchmark/integration/operation.dart
+++ b/pkg/analysis_server/benchmark/integration/operation.dart
@@ -20,8 +20,7 @@
bool firstNotification = true;
CompletionRequestOperation(
- CommonInputConverter converter, Map<String, dynamic> json)
- : super(converter, json);
+ super.converter, super.json);
@override
Future<void>? perform(Driver driver) {
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart
index 6d5b0d8..e953ef6 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart
@@ -218,8 +218,8 @@
}
class ErrorOr<T> extends Either2<ResponseError, T> {
- ErrorOr.error(ResponseError error) : super.t1(error);
- ErrorOr.success(T result) : super.t2(result);
+ ErrorOr.error(super.error) : super.t1();
+ ErrorOr.success(super.result) : super.t2();
/// Returns the error or throws if object is not an error. Check [isError]
/// before accessing [error].
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index e51f5bb..caaf66b 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -26,7 +26,7 @@
class AnalysisDomainHandler extends AbstractRequestHandler {
/// Initialize a newly created handler to handle requests for the given
/// [server].
- AnalysisDomainHandler(AnalysisServer server) : super(server);
+ AnalysisDomainHandler(super.server);
@override
Response? handleRequest(
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index 20b1829..ecdc3d7 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_constants.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/collections.dart';
import 'package:analysis_server/src/domain_abstract.dart';
import 'package:analysis_server/src/domains/completion/available_suggestions.dart';
@@ -61,7 +60,7 @@
DartCompletionRequest? _currentRequest;
/// Initialize a new request handler for the given [server].
- CompletionDomainHandler(AnalysisServer server) : super(server);
+ CompletionDomainHandler(super.server);
/// Compute completion results for the given request and append them to the
/// stream. Clients should not call this method directly as it is
diff --git a/pkg/analysis_server/lib/src/flutter/flutter_domain.dart b/pkg/analysis_server/lib/src/flutter/flutter_domain.dart
index 0979104..2338d6e 100644
--- a/pkg/analysis_server/lib/src/flutter/flutter_domain.dart
+++ b/pkg/analysis_server/lib/src/flutter/flutter_domain.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/protocol/protocol_constants.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/domain_abstract.dart';
import 'package:analysis_server/src/protocol/protocol_internal.dart';
import 'package:analysis_server/src/protocol_server.dart';
@@ -14,7 +13,7 @@
class FlutterDomainHandler extends AbstractRequestHandler {
/// Initialize a newly created handler to handle requests for the given
/// [server].
- FlutterDomainHandler(AnalysisServer server) : super(server);
+ FlutterDomainHandler(super.server);
/// Implement the 'flutter.getWidgetDescription' request.
void getWidgetDescription(Request request) async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_errors.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_errors.dart
index 5548458..2231d2f 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_errors.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_errors.dart
@@ -4,18 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/protocol_server.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.getErrors` request.
class AnalysisGetErrorsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisGetErrorsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisGetErrorsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_hover.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_hover.dart
index 471bcfb..f2c3ff5 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_hover.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_hover.dart
@@ -6,19 +6,15 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/computer/computer_hover.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analyzer/dart/analysis/results.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.getHover` request.
class AnalysisGetHoverHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisGetHoverHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisGetHoverHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_imported_elements.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_imported_elements.dart
index 349d72d..f6217f5 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_imported_elements.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_imported_elements.dart
@@ -6,19 +6,16 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/computer/imported_elements_computer.dart';
import 'package:analysis_server/src/domain_analysis_flags.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.getImportedElements` request.
class AnalysisGetImportedElementsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisGetImportedElementsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisGetImportedElementsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_navigation.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_navigation.dart
index 4205723..5dc0820 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_navigation.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_navigation.dart
@@ -10,7 +10,6 @@
import 'package:analysis_server/src/domain_abstract.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/plugin/result_merger.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
import 'package:analyzer_plugin/src/utilities/navigation/navigation.dart';
@@ -21,9 +20,8 @@
with RequestHandlerMixin<AnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisGetNavigationHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisGetNavigationHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_signature.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_signature.dart
index fd1f9be..2a424c4 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_get_signature.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_get_signature.dart
@@ -6,18 +6,15 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/computer/computer_signature.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.getSignature` request.
class AnalysisGetSignatureHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisGetSignatureHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisGetSignatureHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_reanalyze.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_reanalyze.dart
index 0838db8..988d2e9 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_reanalyze.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_reanalyze.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.reanalyze` request.
class AnalysisReanalyzeHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisReanalyzeHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisReanalyzeHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_analysis_roots.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_analysis_roots.dart
index 089929b..01ef88f 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_analysis_roots.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_analysis_roots.dart
@@ -6,17 +6,14 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.setAnalysisRoots` request.
class AnalysisSetAnalysisRootsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisSetAnalysisRootsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisSetAnalysisRootsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_general_subscriptions.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_general_subscriptions.dart
index 8117b7c..ad15ebc 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_general_subscriptions.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_general_subscriptions.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.setGeneralSubscriptions` request.
class AnalysisSetGeneralSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisSetGeneralSubscriptionsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisSetGeneralSubscriptionsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_priority_files.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_priority_files.dart
index 8ad5cce..c8d21c2 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_priority_files.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_priority_files.dart
@@ -6,18 +6,15 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/plugin/request_converter.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.setPriorityFiles` request.
class AnalysisSetPriorityFilesHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisSetPriorityFilesHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisSetPriorityFilesHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_subscriptions.dart b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_subscriptions.dart
index af96fb0..2119c58 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analysis_set_subscriptions.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analysis_set_subscriptions.dart
@@ -6,19 +6,16 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/plugin/request_converter.dart';
import 'package:analysis_server/src/protocol/protocol_internal.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analysis.setSubscriptions` request.
class AnalysisSetSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalysisSetSubscriptionsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalysisSetSubscriptionsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analytics_enable.dart b/pkg/analysis_server/lib/src/handler/legacy/analytics_enable.dart
index 32b85c6..823b275 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analytics_enable.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analytics_enable.dart
@@ -4,19 +4,14 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analytics.enable` request.
class AnalyticsEnableHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalyticsEnableHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalyticsEnableHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analytics_is_enabled.dart b/pkg/analysis_server/lib/src/handler/legacy/analytics_is_enabled.dart
index 3d0fb9e..529d1d1 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analytics_is_enabled.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analytics_is_enabled.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analytics.isEnabled` request.
class AnalyticsIsEnabledHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalyticsIsEnabledHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalyticsIsEnabledHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analytics_send_event.dart b/pkg/analysis_server/lib/src/handler/legacy/analytics_send_event.dart
index 9e86fb6..fdb8f12 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analytics_send_event.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analytics_send_event.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analytics.sendEvent` request.
class AnalyticsSendEventHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalyticsSendEventHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalyticsSendEventHandler(
+ super.server, super.request, super.cancellationToken);
String get _clientId => server.options.clientId ?? 'client';
diff --git a/pkg/analysis_server/lib/src/handler/legacy/analytics_send_timing.dart b/pkg/analysis_server/lib/src/handler/legacy/analytics_send_timing.dart
index 61c90ab..a3266a0 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/analytics_send_timing.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/analytics_send_timing.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `analytics.sendTiming` request.
class AnalyticsSendTimingHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- AnalyticsSendTimingHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ AnalyticsSendTimingHandler(
+ super.server, super.request, super.cancellationToken);
String get _clientId => server.options.clientId ?? 'client';
diff --git a/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details.dart b/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details.dart
index 436db66..aff9a0f 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details.dart
@@ -6,10 +6,8 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analyzer/dart/analysis/session.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
/// The handler for the `completion.getSuggestionDetails` request.
@@ -20,9 +18,8 @@
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- CompletionGetSuggestionDetailsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ CompletionGetSuggestionDetailsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details2.dart b/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details2.dart
index fa00df1..34cdede 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details2.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestion_details2.dart
@@ -6,11 +6,9 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analyzer/dart/analysis/session.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
/// The handler for the `completion.getSuggestionDetails2` request.
@@ -21,9 +19,8 @@
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- CompletionGetSuggestionDetails2Handler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ CompletionGetSuggestionDetails2Handler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_diagnostics.dart b/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_diagnostics.dart
index c5305af..30f84ea 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_diagnostics.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_diagnostics.dart
@@ -4,20 +4,16 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `diagnostic.getDiagnostics` request.
class DiagnosticGetDiagnosticsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- DiagnosticGetDiagnosticsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ DiagnosticGetDiagnosticsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_server_port.dart b/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_server_port.dart
index 1fd807b..4b3295b 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_server_port.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/diagnostic_get_server_port.dart
@@ -6,17 +6,14 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `diagnostic.getServerPort` request.
class DiagnosticGetServerPortHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- DiagnosticGetServerPortHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ DiagnosticGetServerPortHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart
index 4950883..1ddaedd 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart
@@ -4,23 +4,18 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/correction/bulk_fix_processor.dart';
import 'package:analysis_server/src/services/correction/change_workspace.dart';
import 'package:analyzer/exception/exception.dart';
import 'package:analyzer/src/dart/analysis/analysis_context_collection.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `edit.bulkFixes` request.
class EditBulkFixes extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditBulkFixes(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditBulkFixes(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart
index bf1879c..bf77274 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart
@@ -6,9 +6,7 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:dart_style/src/dart_formatter.dart';
import 'package:dart_style/src/exceptions.dart';
@@ -18,9 +16,7 @@
class EditFormatHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditFormatHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditFormatHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart
index c276376..f0f1606 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart
@@ -4,13 +4,11 @@
import 'dart:async';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analyzer/src/dart/analysis/analysis_context_collection.dart';
import 'package:analyzer/src/dart/analysis/driver_based_analysis_context.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:dart_style/src/dart_formatter.dart';
import 'package:dart_style/src/exceptions.dart';
import 'package:dart_style/src/source_code.dart';
@@ -19,9 +17,8 @@
class EditFormatIfEnabledHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditFormatIfEnabledHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditFormatIfEnabledHandler(
+ super.server, super.request, super.cancellationToken);
/// Format the file at the given [filePath].
///
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_get_assists.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_get_assists.dart
index d306123..27d4485b 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_get_assists.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_get_assists.dart
@@ -17,7 +17,6 @@
import 'package:analysis_server/src/services/correction/change_workspace.dart';
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/src/exception/exception.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
@@ -27,9 +26,7 @@
with RequestHandlerMixin<AnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditGetAssistsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditGetAssistsHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart
index c1ad910..fdb2806 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart
@@ -28,7 +28,6 @@
import 'package:analyzer/src/pubspec/pubspec_validator.dart';
import 'package:analyzer/src/task/options.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
import 'package:html/parser.dart';
@@ -39,9 +38,7 @@
with RequestHandlerMixin<AnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditGetFixesHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditGetFixesHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart
index 4510a62..ba79981 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart
@@ -4,21 +4,17 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/completion/postfix/postfix_completion.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// The handler for the `edit.getPostfixCompletion` request.
class EditGetPostfixCompletionHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditGetPostfixCompletionHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditGetPostfixCompletionHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_get_statement_completion.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_get_statement_completion.dart
index c274249..b269d50 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_get_statement_completion.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_get_statement_completion.dart
@@ -4,21 +4,17 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/completion/statement/statement_completion.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// The handler for the `edit.getStatementCompletion` request.
class EditGetStatementCompletionHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditGetStatementCompletionHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditGetStatementCompletionHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_import_elements.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_import_elements.dart
index 70bf12d..ca0cf40 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_import_elements.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_import_elements.dart
@@ -6,18 +6,15 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/computer/import_elements_computer.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `edit.importElements` request.
class EditImportElementsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditImportElementsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditImportElementsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_is_postfix_completion_applicable.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_is_postfix_completion_applicable.dart
index 1a8e683..e8820d6 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_is_postfix_completion_applicable.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_is_postfix_completion_applicable.dart
@@ -4,20 +4,16 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/completion/postfix/postfix_completion.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `edit.isPostfixCompletionApplicable` request.
class EditIsPostfixCompletionApplicableHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditIsPostfixCompletionApplicableHandler(AnalysisServer server,
- Request request, CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditIsPostfixCompletionApplicableHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_list_postfix_completion_templates.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_list_postfix_completion_templates.dart
index 856e4db..042b5a8 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_list_postfix_completion_templates.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_list_postfix_completion_templates.dart
@@ -4,20 +4,16 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/completion/postfix/postfix_completion.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `edit.listPostfixCompletionTemplates` request.
class EditListPostfixCompletionTemplatesHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditListPostfixCompletionTemplatesHandler(AnalysisServer server,
- Request request, CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditListPostfixCompletionTemplatesHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart
index 7c16673..99967a5 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart
@@ -6,20 +6,17 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/correction/organize_imports.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// The handler for the `edit.organizeDirectives` request.
class EditOrganizeDirectivesHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditOrganizeDirectivesHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditOrganizeDirectivesHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart
index 1b404a1..c388655 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart
@@ -6,20 +6,16 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/correction/sort_members.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// The handler for the `edit.sortMembers` request.
class EditSortMembersHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- EditSortMembersHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ EditSortMembersHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/execution_create_context.dart b/pkg/analysis_server/lib/src/handler/legacy/execution_create_context.dart
index 67bed11..b997015 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/execution_create_context.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/execution_create_context.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `execution.createContext` request.
class ExecutionCreateContextHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ExecutionCreateContextHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ExecutionCreateContextHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/execution_delete_context.dart b/pkg/analysis_server/lib/src/handler/legacy/execution_delete_context.dart
index 07b7701..ea1aab1 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/execution_delete_context.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/execution_delete_context.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `execution.deleteContext` request.
class ExecutionDeleteContextHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ExecutionDeleteContextHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ExecutionDeleteContextHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart b/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart
index f986c9e..f02e198 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart
@@ -4,20 +4,16 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// The handler for the `execution.getSuggestions` request.
class ExecutionGetSuggestionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ExecutionGetSuggestionsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ExecutionGetSuggestionsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/execution_map_uri.dart b/pkg/analysis_server/lib/src/handler/legacy/execution_map_uri.dart
index 27c59d0..b4e3c1b7 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/execution_map_uri.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/execution_map_uri.dart
@@ -6,18 +6,14 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `execution.mapUri` request.
class ExecutionMapUriHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ExecutionMapUriHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ExecutionMapUriHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/execution_set_subscriptions.dart b/pkg/analysis_server/lib/src/handler/legacy/execution_set_subscriptions.dart
index da2d2e7..ebbb786 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/execution_set_subscriptions.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/execution_set_subscriptions.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `execution.setSubscriptions` request.
class ExecutionSetSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ExecutionSetSubscriptionsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ExecutionSetSubscriptionsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/kythe_get_kythe_entries.dart b/pkg/analysis_server/lib/src/handler/legacy/kythe_get_kythe_entries.dart
index 3ff4695..2b92067 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/kythe_get_kythe_entries.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/kythe_get_kythe_entries.dart
@@ -12,7 +12,6 @@
import 'package:analysis_server/src/plugin/result_merger.dart';
import 'package:analysis_server/src/services/kythe/kythe_visitors.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
@@ -21,9 +20,8 @@
with RequestHandlerMixin<AnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- KytheGetKytheEntriesHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ KytheGetKytheEntriesHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/server_cancel_request.dart b/pkg/analysis_server/lib/src/handler/legacy/server_cancel_request.dart
index 43b1707..2b27d58 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/server_cancel_request.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/server_cancel_request.dart
@@ -4,19 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `server.cancelRequest` request.
class ServerCancelRequestHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ServerCancelRequestHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ServerCancelRequestHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/server_get_version.dart b/pkg/analysis_server/lib/src/handler/legacy/server_get_version.dart
index 0ea83dc..3dd1ffb 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/server_get_version.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/server_get_version.dart
@@ -4,20 +4,15 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_constants.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `server.getVersion` request.
class ServerGetVersionHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ServerGetVersionHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ServerGetVersionHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/server_set_subscriptions.dart b/pkg/analysis_server/lib/src/handler/legacy/server_set_subscriptions.dart
index 0ebe036..40a8291 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/server_set_subscriptions.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/server_set_subscriptions.dart
@@ -6,17 +6,14 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `server.setSubscriptions` request.
class ServerSetSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ServerSetSubscriptionsHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ServerSetSubscriptionsHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/server_shutdown.dart b/pkg/analysis_server/lib/src/handler/legacy/server_shutdown.dart
index a582920..2533256 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/server_shutdown.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/server_shutdown.dart
@@ -4,19 +4,14 @@
import 'dart:async';
-import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler for the `server.shutdown` request.
class ServerShutdownHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- ServerShutdownHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ ServerShutdownHandler(super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/handler/legacy/unsupported_request.dart b/pkg/analysis_server/lib/src/handler/legacy/unsupported_request.dart
index b8134f6..389681f 100644
--- a/pkg/analysis_server/lib/src/handler/legacy/unsupported_request.dart
+++ b/pkg/analysis_server/lib/src/handler/legacy/unsupported_request.dart
@@ -5,17 +5,14 @@
import 'dart:async';
import 'package:analysis_server/protocol/protocol.dart';
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
-import 'package:analyzer/src/utilities/cancellation.dart';
/// The handler used for the request that are no longer supported.
class UnsupportedRequestHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
- UnsupportedRequestHandler(AnalysisServer server, Request request,
- CancellationToken cancellationToken)
- : super(server, request, cancellationToken);
+ UnsupportedRequestHandler(
+ super.server, super.request, super.cancellationToken);
@override
Future<void> handle() async {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/abstract_refactor.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/abstract_refactor.dart
index cc504be..7c080cb 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/abstract_refactor.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/abstract_refactor.dart
@@ -9,7 +9,6 @@
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/commands/simple_edit_handler.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/progress.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
@@ -22,7 +21,7 @@
/// A base class for refactoring commands that need to create Refactorings from
/// client-supplied arguments.
abstract class AbstractRefactorCommandHandler extends SimpleEditCommandHandler {
- AbstractRefactorCommandHandler(LspAnalysisServer server) : super(server);
+ AbstractRefactorCommandHandler(super.server);
@override
String get commandName => 'Perform Refactor';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/fix_all.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/fix_all.dart
index c4d005f..01f0d88 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/fix_all.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/fix_all.dart
@@ -7,14 +7,13 @@
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/commands/simple_edit_handler.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/progress.dart';
import 'package:analysis_server/src/services/correction/bulk_fix_processor.dart';
import 'package:analysis_server/src/services/correction/change_workspace.dart';
class FixAllCommandHandler extends SimpleEditCommandHandler {
- FixAllCommandHandler(LspAnalysisServer server) : super(server);
+ FixAllCommandHandler(super.server);
@override
String get commandName => 'Fix All';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart
index 2a81ac0..5ef9c07 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart
@@ -7,12 +7,11 @@
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/commands/simple_edit_handler.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/progress.dart';
import 'package:analysis_server/src/services/correction/organize_imports.dart';
class OrganizeImportsCommandHandler extends SimpleEditCommandHandler {
- OrganizeImportsCommandHandler(LspAnalysisServer server) : super(server);
+ OrganizeImportsCommandHandler(super.server);
@override
String get commandName => 'Organize Imports';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/perform_refactor.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/perform_refactor.dart
index 3690cf5..4f9fb46 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/perform_refactor.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/perform_refactor.dart
@@ -9,13 +9,12 @@
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/commands/abstract_refactor.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/progress.dart';
import 'package:analysis_server/src/protocol_server.dart';
class PerformRefactorCommandHandler extends AbstractRefactorCommandHandler {
- PerformRefactorCommandHandler(LspAnalysisServer server) : super(server);
+ PerformRefactorCommandHandler(super.server);
@override
String get commandName => 'Perform Refactor';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/send_workspace_edit.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/send_workspace_edit.dart
index de71c8c..228e211 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/send_workspace_edit.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/send_workspace_edit.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/commands/simple_edit_handler.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/progress.dart';
/// This command allows a client to request the server send it a
@@ -18,7 +17,7 @@
/// args and when the client calls the server to execute that command, the server
/// will call the client to execute workspace/applyEdit.
class SendWorkspaceEditCommandHandler extends SimpleEditCommandHandler {
- SendWorkspaceEditCommandHandler(LspAnalysisServer server) : super(server);
+ SendWorkspaceEditCommandHandler(super.server);
@override
String get commandName => 'Send Workspace Edit';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart
index 7e3ecad..7e1b851 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/simple_edit_handler.dart
@@ -6,7 +6,6 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/source_edits.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -17,7 +16,7 @@
abstract class SimpleEditCommandHandler
extends CommandHandler<ExecuteCommandParams, Object> {
- SimpleEditCommandHandler(LspAnalysisServer server) : super(server);
+ SimpleEditCommandHandler(super.server);
String get commandName;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart
index d10e4db..bb0ff93 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart
@@ -7,13 +7,12 @@
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/commands/simple_edit_handler.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/progress.dart';
import 'package:analysis_server/src/services/correction/sort_members.dart';
import 'package:analyzer/dart/analysis/results.dart';
class SortMembersCommandHandler extends SimpleEditCommandHandler {
- SortMembersCommandHandler(LspAnalysisServer server) : super(server);
+ SortMembersCommandHandler(super.server);
@override
String get commandName => 'Sort Members';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/commands/validate_refactor.dart b/pkg/analysis_server/lib/src/lsp/handlers/commands/validate_refactor.dart
index 6c54c7c..402e934 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/commands/validate_refactor.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/commands/validate_refactor.dart
@@ -8,13 +8,12 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/commands/abstract_refactor.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/progress.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analyzer/dart/analysis/session.dart';
class ValidateRefactorCommandHandler extends AbstractRefactorCommandHandler {
- ValidateRefactorCommandHandler(LspAnalysisServer server) : super(server);
+ ValidateRefactorCommandHandler(super.server);
@override
String get commandName => 'Validate Refactor';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart
index af7f163..4eff16c 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_diagnostic_server.dart
@@ -7,11 +7,10 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class DiagnosticServerHandler
extends MessageHandler<void, DartDiagnosticServer> {
- DiagnosticServerHandler(LspAnalysisServer server) : super(server);
+ DiagnosticServerHandler(super.server);
@override
Method get handlesMessage => CustomMethods.diagnosticServer;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_reanalyze.dart b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_reanalyze.dart
index 3b5caac..065424d 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_reanalyze.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_reanalyze.dart
@@ -6,10 +6,9 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class ReanalyzeHandler extends MessageHandler<void, void> {
- ReanalyzeHandler(LspAnalysisServer server) : super(server);
+ ReanalyzeHandler(super.server);
@override
Method get handlesMessage => CustomMethods.reanalyze;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_super.dart b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_super.dart
index af2d137..6cfac88 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_super.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/custom/handler_super.dart
@@ -6,14 +6,13 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/search/type_hierarchy.dart';
import 'package:collection/collection.dart';
class SuperHandler
extends MessageHandler<TextDocumentPositionParams, Location?> {
- SuperHandler(LspAnalysisServer server) : super(server);
+ SuperHandler(super.server);
@override
Method get handlesMessage => CustomMethods.super_;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_cancel_request.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_cancel_request.dart
index 0707e09..bbda2f8 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_cancel_request.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_cancel_request.dart
@@ -5,12 +5,11 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class CancelRequestHandler extends MessageHandler<CancelParams, void> {
final Map<String, CancelableToken> _tokens = {};
- CancelRequestHandler(LspAnalysisServer server) : super(server);
+ CancelRequestHandler(super.server);
@override
Method get handlesMessage => Method.cancelRequest;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_change_workspace_folders.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_change_workspace_folders.dart
index e270255..a171a36 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_change_workspace_folders.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_change_workspace_folders.dart
@@ -5,15 +5,13 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class WorkspaceFoldersHandler
extends MessageHandler<DidChangeWorkspaceFoldersParams, void> {
// Whether to update analysis roots based on the open workspace folders.
bool updateAnalysisRoots;
- WorkspaceFoldersHandler(LspAnalysisServer server, this.updateAnalysisRoots)
- : super(server);
+ WorkspaceFoldersHandler(super.server, this.updateAnalysisRoots);
@override
Method get handlesMessage => Method.workspace_didChangeWorkspaceFolders;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
index acff954..607bdd5 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
@@ -6,7 +6,6 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/plugin/plugin_manager.dart';
import 'package:analysis_server/src/protocol_server.dart' hide Position;
@@ -51,7 +50,7 @@
return a.title.compareTo(b.title);
};
- CodeActionHandler(LspAnalysisServer server) : super(server);
+ CodeActionHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_codeAction;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
index f922482..c044e59 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
@@ -38,9 +38,8 @@
/// Whether to include symbols from libraries that have not been imported.
final bool suggestFromUnimportedLibraries;
- CompletionHandler(LspAnalysisServer server, LspInitializationOptions options)
- : suggestFromUnimportedLibraries = options.suggestFromUnimportedLibraries,
- super(server);
+ CompletionHandler(super.server, LspInitializationOptions options)
+ : suggestFromUnimportedLibraries = options.suggestFromUnimportedLibraries;
@override
Method get handlesMessage => Method.textDocument_completion;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion_resolve.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion_resolve.dart
index ef497f6..56bec62 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion_resolve.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion_resolve.dart
@@ -9,7 +9,6 @@
import 'package:analysis_server/src/lsp/client_capabilities.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/analysis/session.dart';
@@ -27,7 +26,7 @@
/// cancel events).
CompletionItem? _latestCompletionItem;
- CompletionResolveHandler(LspAnalysisServer server) : super(server);
+ CompletionResolveHandler(super.server);
@override
Method get handlesMessage => Method.completionItem_resolve;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart
index 1383b80..2abf3c3 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/protocol/protocol_generated.dart'
hide AnalysisGetNavigationParams;
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/plugin/result_merger.dart';
import 'package:analysis_server/src/protocol_server.dart' show NavigationTarget;
@@ -26,7 +25,7 @@
class DefinitionHandler extends MessageHandler<TextDocumentPositionParams,
Either2<List<Location>, List<LocationLink>>>
with LspPluginRequestHandlerMixin {
- DefinitionHandler(LspAnalysisServer server) : super(server);
+ DefinitionHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_definition;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color.dart
index 07bf25b..e65353e 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/src/computer/computer_color.dart'
show ColorComputer, ColorReference;
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/dart/analysis/results.dart';
@@ -20,7 +19,7 @@
/// [DocumentColorPresentationHandler]).
class DocumentColorHandler
extends MessageHandler<DocumentColorParams, List<ColorInformation>> {
- DocumentColorHandler(LspAnalysisServer server) : super(server);
+ DocumentColorHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_documentColor;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color_presentation.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color_presentation.dart
index ed196a1..bb1adb4 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color_presentation.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_color_presentation.dart
@@ -5,7 +5,6 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/utilities/flutter.dart';
import 'package:analyzer/dart/analysis/results.dart';
@@ -22,7 +21,7 @@
/// into the source file.
class DocumentColorPresentationHandler
extends MessageHandler<ColorPresentationParams, List<ColorPresentation>> {
- DocumentColorPresentationHandler(LspAnalysisServer server) : super(server);
+ DocumentColorPresentationHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_colorPresentation;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
index ae96228..56fadb8 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
@@ -7,12 +7,11 @@
import 'package:analysis_server/src/domains/analysis/occurrences.dart';
import 'package:analysis_server/src/domains/analysis/occurrences_dart.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
class DocumentHighlightsHandler extends MessageHandler<
TextDocumentPositionParams, List<DocumentHighlight>?> {
- DocumentHighlightsHandler(LspAnalysisServer server) : super(server);
+ DocumentHighlightsHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_documentHighlight;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart
index 0c1141d..bccc9dc 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/src/computer/computer_outline.dart';
import 'package:analysis_server/src/lsp/client_capabilities.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/protocol_server.dart' show Outline;
import 'package:analyzer/dart/analysis/results.dart';
@@ -15,7 +14,7 @@
class DocumentSymbolHandler extends MessageHandler<DocumentSymbolParams,
Either2<List<DocumentSymbol>, List<SymbolInformation>>?> {
- DocumentSymbolHandler(LspAnalysisServer server) : super(server);
+ DocumentSymbolHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_documentSymbol;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_execute_command.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_execute_command.dart
index cdc6fa5..b5c5ff6 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_execute_command.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_execute_command.dart
@@ -12,7 +12,6 @@
import 'package:analysis_server/src/lsp/handlers/commands/sort_members.dart';
import 'package:analysis_server/src/lsp/handlers/commands/validate_refactor.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/progress.dart';
/// Handles workspace/executeCommand messages by delegating to a specific handler
@@ -20,7 +19,7 @@
class ExecuteCommandHandler
extends MessageHandler<ExecuteCommandParams, Object?> {
final Map<String, CommandHandler> commandHandlers;
- ExecuteCommandHandler(LspAnalysisServer server)
+ ExecuteCommandHandler(super.server)
: commandHandlers = {
Commands.sortMembers: SortMembersCommandHandler(server),
Commands.organizeImports: OrganizeImportsCommandHandler(server),
@@ -28,8 +27,7 @@
Commands.performRefactor: PerformRefactorCommandHandler(server),
Commands.validateRefactor: ValidateRefactorCommandHandler(server),
Commands.sendWorkspaceEdit: SendWorkspaceEditCommandHandler(server),
- },
- super(server);
+ };
@override
Method get handlesMessage => Method.workspace_executeCommand;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart
index a5850a5..4aeb552 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_exit.dart
@@ -7,15 +7,14 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class ExitMessageHandler extends MessageHandler<void, void> {
final bool clientDidCallShutdown;
ExitMessageHandler(
- LspAnalysisServer server, {
+ super.server, {
this.clientDidCallShutdown = false,
- }) : super(server);
+ });
@override
Method get handlesMessage => Method.exit;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart
index a14bb7d..6a3cb20 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_folding.dart
@@ -6,14 +6,13 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/computer/computer_folding.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analyzer/source/line_info.dart';
class FoldingHandler
extends MessageHandler<FoldingRangeParams, List<FoldingRange>> {
- FoldingHandler(LspAnalysisServer server) : super(server);
+ FoldingHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_foldingRange;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart
index 528c52b..8359bc7 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart
@@ -6,13 +6,12 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/source_edits.dart';
class FormatOnTypeHandler
extends MessageHandler<DocumentOnTypeFormattingParams, List<TextEdit>?> {
- FormatOnTypeHandler(LspAnalysisServer server) : super(server);
+ FormatOnTypeHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_onTypeFormatting;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart
index 44143fc..a7eda8c 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart
@@ -6,13 +6,12 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/source_edits.dart';
class FormatRangeHandler
extends MessageHandler<DocumentRangeFormattingParams, List<TextEdit>?> {
- FormatRangeHandler(LspAnalysisServer server) : super(server);
+ FormatRangeHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_rangeFormatting;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart
index ea279ad..9e058a9 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart
@@ -6,13 +6,12 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/source_edits.dart';
class FormattingHandler
extends MessageHandler<DocumentFormattingParams, List<TextEdit>?> {
- FormattingHandler(LspAnalysisServer server) : super(server);
+ FormattingHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_formatting;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
index b5d7f7d..ef82f5b 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
@@ -8,13 +8,12 @@
import 'package:analysis_server/src/computer/computer_hover.dart';
import 'package:analysis_server/src/lsp/dartdoc.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/source/line_info.dart';
class HoverHandler extends MessageHandler<TextDocumentPositionParams, Hover?> {
- HoverHandler(LspAnalysisServer server) : super(server);
+ HoverHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_hover;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_implementation.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_implementation.dart
index ca6c915..1bdc73e 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_implementation.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_implementation.dart
@@ -6,14 +6,13 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/search/type_hierarchy.dart';
import 'package:collection/collection.dart';
class ImplementationHandler
extends MessageHandler<TextDocumentPositionParams, List<Location>> {
- ImplementationHandler(LspAnalysisServer server) : super(server);
+ ImplementationHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_implementation;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart
index 2c1d7b5..a6a6a24 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart
@@ -8,11 +8,10 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handler_states.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class InitializeMessageHandler
extends MessageHandler<InitializeParams, InitializeResult> {
- InitializeMessageHandler(LspAnalysisServer server) : super(server);
+ InitializeMessageHandler(super.server);
@override
Method get handlesMessage => Method.initialize;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_initialized.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_initialized.dart
index 1a3d590..a3e92d9 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_initialized.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_initialized.dart
@@ -6,14 +6,13 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handler_states.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class IntializedMessageHandler extends MessageHandler<InitializedParams, void> {
final List<String> openWorkspacePaths;
IntializedMessageHandler(
- LspAnalysisServer server,
+ super.server,
this.openWorkspacePaths,
- ) : super(server);
+ );
@override
Method get handlesMessage => Method.initialized;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart
index 93c78da..7db933a 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart
@@ -5,7 +5,6 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/protocol_server.dart' show SearchResult;
import 'package:analysis_server/src/protocol_server.dart' show NavigationTarget;
@@ -19,7 +18,7 @@
class ReferencesHandler
extends MessageHandler<ReferenceParams, List<Location>?> {
- ReferencesHandler(LspAnalysisServer server) : super(server);
+ ReferencesHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_references;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_reject.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_reject.dart
index 67d2685..dbfe32a 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_reject.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_reject.dart
@@ -5,7 +5,6 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
/// A [MessageHandler] that rejects specific tpyes of messages with a given
/// error code/message.
@@ -14,9 +13,8 @@
final Method handlesMessage;
final ErrorCodes errorCode;
final String errorMessage;
- RejectMessageHandler(LspAnalysisServer server, this.handlesMessage,
- this.errorCode, this.errorMessage)
- : super(server);
+ RejectMessageHandler(
+ super.server, this.handlesMessage, this.errorCode, this.errorMessage);
@override
LspJsonHandler<void> get jsonHandler => NullJsonHandler;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
index 9a92867..a438d7d 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/src/lsp/client_configuration.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
import 'package:analysis_server/src/services/refactoring/rename_unit_member.dart';
@@ -15,7 +14,7 @@
class PrepareRenameHandler
extends MessageHandler<TextDocumentPositionParams, RangeAndPlaceholder?> {
- PrepareRenameHandler(LspAnalysisServer server) : super(server);
+ PrepareRenameHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_prepareRename;
@@ -80,7 +79,7 @@
class RenameHandler extends MessageHandler<RenameParams, WorkspaceEdit?> {
final _upperCasePattern = RegExp('[A-Z]');
- RenameHandler(LspAnalysisServer server) : super(server);
+ RenameHandler(super.server);
LspGlobalClientConfiguration get config => server.clientConfiguration.global;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_select_range.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_select_range.dart
index 0a97e4d..3c4a7a4 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_select_range.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_select_range.dart
@@ -7,7 +7,6 @@
import 'package:analysis_server/src/computer/computer_selection_ranges.dart'
hide SelectionRange;
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -15,7 +14,7 @@
class SelectionRangeHandler
extends MessageHandler<SelectionRangeParams, List<SelectionRange>?> {
- SelectionRangeHandler(LspAnalysisServer server) : super(server);
+ SelectionRangeHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_selectionRange;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart
index 6b111db..452e3d8 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart
@@ -8,7 +8,6 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/computer/computer_highlights.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/semantic_tokens/encoder.dart';
import 'package:analyzer/source/source_range.dart';
@@ -17,7 +16,7 @@
abstract class AbstractSemanticTokensHandler<T>
extends MessageHandler<T, SemanticTokens?>
with LspPluginRequestHandlerMixin {
- AbstractSemanticTokensHandler(LspAnalysisServer server) : super(server);
+ AbstractSemanticTokensHandler(super.server);
List<List<HighlightRegion>> getPluginResults(String path) {
final notificationManager = server.notificationManager;
@@ -113,7 +112,7 @@
class SemanticTokensFullHandler
extends AbstractSemanticTokensHandler<SemanticTokensParams> {
- SemanticTokensFullHandler(LspAnalysisServer server) : super(server);
+ SemanticTokensFullHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_semanticTokens_full;
@@ -130,7 +129,7 @@
class SemanticTokensRangeHandler
extends AbstractSemanticTokensHandler<SemanticTokensRangeParams> {
- SemanticTokensRangeHandler(LspAnalysisServer server) : super(server);
+ SemanticTokensRangeHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_semanticTokens_range;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_shutdown.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_shutdown.dart
index b226c29..ea09041 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_shutdown.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_shutdown.dart
@@ -6,10 +6,9 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handler_states.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class ShutdownMessageHandler extends MessageHandler<void, void> {
- ShutdownMessageHandler(LspAnalysisServer server) : super(server);
+ ShutdownMessageHandler(super.server);
@override
Method get handlesMessage => Method.shutdown;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart
index cb0344b..aebf669 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_signature_help.dart
@@ -7,14 +7,13 @@
import 'package:analysis_server/src/computer/computer_signature.dart';
import 'package:analysis_server/src/computer/computer_type_arguments_signature.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
class SignatureHelpHandler
extends MessageHandler<SignatureHelpParams, SignatureHelp?> {
- SignatureHelpHandler(LspAnalysisServer server) : super(server);
+ SignatureHelpHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_signatureHelp;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart
index ceb4204..8b130ae 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart
@@ -47,7 +47,7 @@
/// example, inconsistent document state between server/client) occurs and will
/// reject all messages.
class FailureStateMessageHandler extends ServerStateMessageHandler {
- FailureStateMessageHandler(LspAnalysisServer server) : super(server);
+ FailureStateMessageHandler(super.server);
@override
FutureOr<ErrorOr<Object?>> handleUnknownMessage(IncomingMessage message) {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart
index 079161a..b05b882 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart
@@ -8,13 +8,12 @@
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/constants.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/lsp/source_edits.dart';
class TextDocumentChangeHandler
extends MessageHandler<DidChangeTextDocumentParams, void> {
- TextDocumentChangeHandler(LspAnalysisServer server) : super(server);
+ TextDocumentChangeHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_didChange;
@@ -57,7 +56,7 @@
class TextDocumentCloseHandler
extends MessageHandler<DidCloseTextDocumentParams, void> {
- TextDocumentCloseHandler(LspAnalysisServer server) : super(server);
+ TextDocumentCloseHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_didClose;
@@ -82,7 +81,7 @@
class TextDocumentOpenHandler
extends MessageHandler<DidOpenTextDocumentParams, void> {
- TextDocumentOpenHandler(LspAnalysisServer server) : super(server);
+ TextDocumentOpenHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_didOpen;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart
index f32c4c1..37461bc 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart
@@ -5,7 +5,6 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -24,7 +23,7 @@
with LspPluginRequestHandlerMixin {
static const _emptyResult = _LocationsOrLinks.t1([]);
- TypeDefinitionHandler(LspAnalysisServer server) : super(server);
+ TypeDefinitionHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_typeDefinition;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_will_rename_files.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_will_rename_files.dart
index 6cbcd6c..fef59a2 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_will_rename_files.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_will_rename_files.dart
@@ -5,13 +5,12 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
class WillRenameFilesHandler
extends MessageHandler<RenameFilesParams, WorkspaceEdit?> {
- WillRenameFilesHandler(LspAnalysisServer server) : super(server);
+ WillRenameFilesHandler(super.server);
@override
Method get handlesMessage => Method.workspace_willRenameFiles;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_configuration.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_configuration.dart
index 36d5372..aa911f2 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_configuration.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_configuration.dart
@@ -5,12 +5,10 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
class WorkspaceDidChangeConfigurationMessageHandler
extends MessageHandler<DidChangeConfigurationParams, void> {
- WorkspaceDidChangeConfigurationMessageHandler(LspAnalysisServer server)
- : super(server);
+ WorkspaceDidChangeConfigurationMessageHandler(super.server);
@override
Method get handlesMessage => Method.workspace_didChangeConfiguration;
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_symbols.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_symbols.dart
index 2475623..be548d8 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_symbols.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_workspace_symbols.dart
@@ -5,13 +5,12 @@
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
import 'package:analysis_server/lsp_protocol/protocol_special.dart';
import 'package:analysis_server/src/lsp/handlers/handlers.dart';
-import 'package:analysis_server/src/lsp/lsp_analysis_server.dart';
import 'package:analysis_server/src/lsp/mapping.dart';
import 'package:analyzer/src/dart/analysis/search.dart' as search;
class WorkspaceSymbolHandler
extends MessageHandler<WorkspaceSymbolParams, List<SymbolInformation>> {
- WorkspaceSymbolHandler(LspAnalysisServer server) : super(server);
+ WorkspaceSymbolHandler(super.server);
@override
Method get handlesMessage => Method.workspace_symbol;
diff --git a/pkg/analysis_server/lib/src/server/error_notifier.dart b/pkg/analysis_server/lib/src/server/error_notifier.dart
index 9ed325a..e896d5c 100644
--- a/pkg/analysis_server/lib/src/server/error_notifier.dart
+++ b/pkg/analysis_server/lib/src/server/error_notifier.dart
@@ -44,6 +44,6 @@
/// Server may throw a [FatalException] to send a fatal error response to the
/// IDEs.
class FatalException extends CaughtException {
- FatalException(String message, Object exception, StackTrace stackTrace)
- : super.withMessage(message, exception, stackTrace);
+ FatalException(String super.message, super.exception, super.stackTrace)
+ : super.withMessage();
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
index 9a11b19..312937f 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
@@ -4,8 +4,6 @@
import 'package:analysis_server/src/provisional/completion/completion_core.dart';
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/utilities/flutter.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -19,10 +17,7 @@
/// it's a named expression).
ArgumentList? argumentList;
- ArgListContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ ArgListContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/closure_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/closure_contributor.dart
index 5700872..e85e433 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/closure_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/closure_contributor.dart
@@ -3,17 +3,12 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/type.dart';
/// A contributor that produces a closure matching the context type.
class ClosureContributor extends DartCompletionContributor {
- ClosureContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ ClosureContributor(super.request, super.builder);
bool get _isArgument {
var node = request.target.containingNode;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
index 7acb058..78dffce 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
@@ -5,17 +5,12 @@
import 'package:analysis_server/src/protocol_server.dart'
hide Element, ElementKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
/// A contributor that produces suggestions based on the members of a library
/// when the completion is in a show or hide combinator of an import or export.
class CombinatorContributor extends DartCompletionContributor {
- CombinatorContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ CombinatorContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart
index 2680e24..4663e20 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -12,10 +10,7 @@
/// A contributor that produces suggestions for constructors to be invoked
/// in enum constants.
class EnumConstantConstructorContributor extends DartCompletionContributor {
- EnumConstantConstructorContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ EnumConstantConstructorContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart
index acfcb38..fca2f3c 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart
@@ -5,7 +5,6 @@
import 'package:analysis_server/src/protocol_server.dart'
show CompletionSuggestionKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -17,10 +16,7 @@
class ExtensionMemberContributor extends DartCompletionContributor {
late final memberBuilder = MemberSuggestionBuilder(request, builder);
- ExtensionMemberContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ ExtensionMemberContributor(super.request, super.builder);
void addExtensions(List<ExtensionElement> extensions) {
var containingLibrary = request.libraryElement;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
index e2ed9a99..d732186 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -13,10 +11,7 @@
/// already initialized. More concretely, this class produces suggestions for
/// expressions of the form `this.^` in a constructor's parameter list.
class FieldFormalContributor extends DartCompletionContributor {
- FieldFormalContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ FieldFormalContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart
index 5ef87a7..56c5db2 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart
@@ -3,19 +3,13 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart'
- show SuggestionBuilder;
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/resolver/scope.dart';
/// A contributor for calculating suggestions for imported top level members.
class ImportedReferenceContributor extends DartCompletionContributor {
- ImportedReferenceContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ ImportedReferenceContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
index 66b007f..9740f64 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
@@ -27,10 +27,7 @@
/// A contributor that produces suggestions based on the set of keywords that
/// are valid at the completion point.
class KeywordContributor extends DartCompletionContributor {
- KeywordContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ KeywordContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
index 9933db4..1ebf1e3 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
@@ -14,10 +14,7 @@
/// scope. More concretely, this class produces completions in `break` and
/// `continue` statements.
class LabelContributor extends DartCompletionContributor {
- LabelContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ LabelContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
index b78b89e..86e8275 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
@@ -5,8 +5,6 @@
import 'package:analysis_server/src/protocol_server.dart'
show CompletionSuggestionKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -15,10 +13,7 @@
/// produces suggestions for expressions of the form `p.^`, where `p` is a
/// prefix.
class LibraryMemberContributor extends DartCompletionContributor {
- LibraryMemberContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ LibraryMemberContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart
index 09900cf..553c1ec 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart
@@ -3,16 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
/// A contributor that produces suggestions based on the prefixes defined on
/// import directives.
class LibraryPrefixContributor extends DartCompletionContributor {
- LibraryPrefixContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ LibraryPrefixContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
index 7659c35..d852030 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
@@ -77,7 +77,6 @@
if (opType.includeReturnValueSuggestions) {
builder.suggestExtension(element, kind: kind, prefix: prefix);
}
- element.visitChildren(this);
}
@override
@@ -156,10 +155,7 @@
/// the library in which the completion is requested but outside the file in
/// which the completion is requested.
class LocalLibraryContributor extends DartCompletionContributor {
- LocalLibraryContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ LocalLibraryContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index b3a1499..e518f92 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -32,10 +32,7 @@
/// been shadowed by local declarations.
_VisibilityTracker visibilityTracker = _VisibilityTracker();
- LocalReferenceContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ LocalReferenceContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
index 6aa8512..83cc7a1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
@@ -4,8 +4,6 @@
import 'package:analysis_server/src/protocol_server.dart' as protocol;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/utilities/extensions/completion_request.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -16,10 +14,7 @@
/// for expressions of the form `C.^` or `C<E>.^`, where `C` is the name of a
/// class.
class NamedConstructorContributor extends DartCompletionContributor {
- NamedConstructorContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ NamedConstructorContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/not_imported_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/not_imported_contributor.dart
index fce5689..9949e2b 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/not_imported_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/not_imported_contributor.dart
@@ -8,7 +8,6 @@
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart/extension_member_contributor.dart';
import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/analysis/file_state_filter.dart';
@@ -24,11 +23,11 @@
final Set<Element> _importedElements = Set.identity();
NotImportedContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
+ super.request,
+ super.builder,
this.budget,
this.additionalData,
- ) : super(request, builder);
+ );
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
index 128ff49..6d70d17 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
import 'package:analyzer_plugin/src/utilities/completion/completion_target.dart';
@@ -12,10 +10,7 @@
/// A completion contributor used to suggest replacing partial identifiers
/// inside a class declaration with templates for inherited members.
class OverrideContributor extends DartCompletionContributor {
- OverrideContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ OverrideContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/redirecting_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/redirecting_contributor.dart
index faea364..e9af2ab 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/redirecting_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/redirecting_contributor.dart
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
/// A contributor that produces suggestions for constructors that are being
@@ -12,10 +10,7 @@
/// expressions of the form `this.^` or `super.^` in a constructor's initializer
/// list or after an `=` in a factory constructor.
class RedirectingContributor extends DartCompletionContributor {
- RedirectingContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ RedirectingContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart
index d0f8af8..bc6f68f 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart
@@ -4,8 +4,6 @@
import 'package:analysis_server/src/protocol_server.dart' as protocol;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/utilities/extensions/completion_request.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -15,10 +13,7 @@
/// suggestions for expressions of the form `C.^`, where `C` is the name of a
/// class, enum, or extension.
class StaticMemberContributor extends DartCompletionContributor {
- StaticMemberContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ StaticMemberContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/super_formal_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/super_formal_contributor.dart
index fdd99bf..574e844 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/super_formal_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/super_formal_contributor.dart
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:collection/collection.dart';
@@ -13,10 +11,7 @@
/// are based on the parameters declared by the invoked super-constructor.
/// The enclosing declaration is expected to be a constructor.
class SuperFormalContributor extends DartCompletionContributor {
- SuperFormalContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ SuperFormalContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
index 3717b9c..b809dbe 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
@@ -6,7 +6,6 @@
import 'package:analysis_server/src/protocol_server.dart' as protocol;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -19,10 +18,7 @@
/// expressions of the form `o.^`, where `o` is an expression denoting an
/// instance of a type.
class TypeMemberContributor extends DartCompletionContributor {
- TypeMemberContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ TypeMemberContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
@@ -227,8 +223,7 @@
/// an interface type.
class _SuggestionBuilder extends MemberSuggestionBuilder {
/// Initialize a newly created suggestion builder.
- _SuggestionBuilder(DartCompletionRequest request, SuggestionBuilder builder)
- : super(request, builder);
+ _SuggestionBuilder(super.request, super.builder);
/// Return completion suggestions for 'dot' completions on the given [type].
/// If the 'dot' completion is a super expression, then [containingMethodName]
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
index 4a11a87..9733f75 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
@@ -13,10 +13,7 @@
/// A contributor that produces suggestions based on the content of the file
/// system to complete within URIs in import, export and part directives.
class UriContributor extends DartCompletionContributor {
- UriContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ UriContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
index b86c7e0..52f3e43 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
-import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/correction/name_suggestion.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -12,10 +11,7 @@
/// A contributor that produces suggestions for variable names based on the
/// static type of the variable.
class VariableNameContributor extends DartCompletionContributor {
- VariableNameContributor(
- DartCompletionRequest request,
- SuggestionBuilder builder,
- ) : super(request, builder);
+ VariableNameContributor(super.request, super.builder);
@override
Future<void> computeSuggestions() async {
diff --git a/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart b/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart
index a34d791..27a93b0 100644
--- a/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart
+++ b/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart
@@ -6,7 +6,6 @@
import 'package:analysis_server/src/services/completion/yaml/producer.dart';
import 'package:analysis_server/src/services/completion/yaml/yaml_completion_generator.dart';
import 'package:analysis_server/src/services/pub/pub_package_service.dart';
-import 'package:analyzer/file_system/file_system.dart';
/// An object that represents the location of a package name.
class PubPackageNameProducer extends KeyValueProducer {
@@ -133,8 +132,7 @@
/// Initialize a newly created suggestion generator for pubspec files.
PubspecGenerator(
- ResourceProvider resourceProvider, PubPackageService pubPackageService)
- : super(resourceProvider, pubPackageService);
+ super.resourceProvider, PubPackageService super.pubPackageService);
@override
Producer get topLevelProducer => pubspecProducer;
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 41b6c47..954bf68 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
@@ -41,8 +41,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [AddMissingParameter] producer.
class _AddMissingOptionalPositionalParameter extends _AddMissingParameter {
- _AddMissingOptionalPositionalParameter(ExecutableParameters context)
- : super(context);
+ _AddMissingOptionalPositionalParameter(super.context);
@override
FixKind get fixKind => DartFixKind.ADD_MISSING_PARAMETER_POSITIONAL;
@@ -97,8 +96,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [AddMissingParameter] producer.
class _AddMissingRequiredPositionalParameter extends _AddMissingParameter {
- _AddMissingRequiredPositionalParameter(ExecutableParameters context)
- : super(context);
+ _AddMissingRequiredPositionalParameter(super.context);
@override
FixKind get fixKind => DartFixKind.ADD_MISSING_PARAMETER_REQUIRED;
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 e5bc0de..51b500c 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
@@ -105,14 +105,13 @@
final int indexValue;
_ConstantField(
- FieldElement element,
- VariableDeclaration declaration,
- VariableDeclarationList declarationList,
- FieldDeclaration fieldDeclaration,
+ super.element,
+ super.declaration,
+ super.declarationList,
+ super.fieldDeclaration,
this.instanceCreation,
this.constructorElement,
- this.indexValue)
- : super(element, declaration, declarationList, fieldDeclaration);
+ this.indexValue);
}
/// Information about a single constructor in the class being converted.
@@ -657,10 +656,9 @@
/// Initialize a newly created visitor to visit the class declaration
/// corresponding to the given [classElement].
- _EnumVisitor(ClassElement classElement, List<_ConstantField> fieldsToConvert)
+ _EnumVisitor(super.classElement, List<_ConstantField> fieldsToConvert)
: fieldsToConvert =
- fieldsToConvert.map((field) => field.declaration).toList(),
- super(classElement);
+ fieldsToConvert.map((field) => field.declaration).toList();
@override
void visitInstanceCreationExpression(InstanceCreationExpression node) {
@@ -724,7 +722,7 @@
class _NonEnumVisitor extends _BaseVisitor {
/// Initialize a newly created visitor to visit everything except the class
/// declaration corresponding to the given [classElement].
- _NonEnumVisitor(ClassElement classElement) : super(classElement);
+ _NonEnumVisitor(super.classElement);
@override
void visitClassDeclaration(ClassDeclaration node) {
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 3c75ac0..2bb3d8e 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
@@ -92,7 +92,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapCenter extends _WrapSingleWidget {
- _FlutterWrapCenter(Expression widgetExpr) : super(widgetExpr);
+ _FlutterWrapCenter(super.widgetExpr);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_CENTER;
@@ -107,8 +107,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapColumn extends _WrapMultipleWidgets {
- _FlutterWrapColumn(Expression firstWidget, Expression lastWidget)
- : super(firstWidget, lastWidget);
+ _FlutterWrapColumn(super.firstWidget, super.lastWidget);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_COLUMN;
@@ -120,7 +119,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapContainer extends _WrapSingleWidget {
- _FlutterWrapContainer(Expression widgetExpr) : super(widgetExpr);
+ _FlutterWrapContainer(super.widgetExpr);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_CONTAINER;
@@ -135,7 +134,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapGeneric extends _WrapSingleWidget {
- _FlutterWrapGeneric(Expression widgetExpr) : super(widgetExpr);
+ _FlutterWrapGeneric(super.widgetExpr);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_GENERIC;
@@ -144,7 +143,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapPadding extends _WrapSingleWidget {
- _FlutterWrapPadding(Expression widgetExpr) : super(widgetExpr);
+ _FlutterWrapPadding(super.widgetExpr);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_PADDING;
@@ -165,8 +164,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapRow extends _WrapMultipleWidgets {
- _FlutterWrapRow(Expression firstWidget, Expression lastWidget)
- : super(firstWidget, lastWidget);
+ _FlutterWrapRow(super.firstWidget, super.lastWidget);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_ROW;
@@ -178,7 +176,7 @@
/// A correction processor that can make one of the possible change computed by
/// the [FlutterWrap] producer.
class _FlutterWrapSizedBox extends _WrapSingleWidget {
- _FlutterWrapSizedBox(Expression widgetExpr) : super(widgetExpr);
+ _FlutterWrapSizedBox(super.widgetExpr);
@override
AssistKind get assistKind => DartAssistKind.FLUTTER_WRAP_SIZED_BOX;
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_var.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_var.dart
new file mode 100644
index 0000000..e0c65fe
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_var.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer/source/source_range.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+
+class RemoveVar extends CorrectionProducer {
+ @override
+ FixKind get fixKind => DartFixKind.REMOVE_VAR;
+
+ @override
+ Future<void> compute(ChangeBuilder builder) async {
+ var diagnostic = this.diagnostic;
+ if (diagnostic == null) return;
+ var message = diagnostic.problemMessage;
+
+ await builder.addDartFileEdit(file, (builder) {
+ builder.addDeletion(SourceRange(message.offset, message.length + 1));
+ });
+ }
+}
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 4664cce..cd68581 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
@@ -88,9 +88,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithBlock extends _SurroundWith {
- _SurroundWithBlock(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithBlock(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_BLOCK;
@@ -111,9 +110,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithDoWhile extends _SurroundWith {
- _SurroundWithDoWhile(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithDoWhile(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_DO_WHILE;
@@ -140,9 +138,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithFor extends _SurroundWith {
- _SurroundWithFor(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithFor(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_FOR;
@@ -175,9 +172,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithForIn extends _SurroundWith {
- _SurroundWithForIn(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithForIn(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_FOR_IN;
@@ -206,9 +202,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithIf extends _SurroundWith {
- _SurroundWithIf(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithIf(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_IF;
@@ -235,9 +230,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithSetState extends _SurroundWith {
- _SurroundWithSetState(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithSetState(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_SET_STATE;
@@ -265,9 +259,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithTryCatch extends _SurroundWith {
- _SurroundWithTryCatch(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithTryCatch(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_TRY_CATCH;
@@ -304,9 +297,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithTryFinally extends _SurroundWith {
- _SurroundWithTryFinally(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithTryFinally(super.statementsRange, super.indentOld,
+ super.indentNew, super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_TRY_FINALLY;
@@ -341,9 +333,8 @@
/// A correction processor that can make one of the possible change computed by
/// the [SurroundWith] producer.
class _SurroundWithWhile extends _SurroundWith {
- _SurroundWithWhile(SourceRange statementsRange, String indentOld,
- String indentNew, String indentedCode)
- : super(statementsRange, indentOld, indentNew, indentedCode);
+ _SurroundWithWhile(super.statementsRange, super.indentOld, super.indentNew,
+ super.indentedCode);
@override
AssistKind get assistKind => DartAssistKind.SURROUND_WITH_WHILE;
diff --git a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
index c63b94e..c0147af 100644
--- a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
+++ b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
@@ -2338,7 +2338,7 @@
ParserErrorCode.VAR_ENUM:
status: needsEvaluation
ParserErrorCode.VAR_RETURN_TYPE:
- status: needsEvaluation
+ status: hasFix
ParserErrorCode.VAR_TYPEDEF:
status: needsEvaluation
ParserErrorCode.VOID_WITH_TYPE_ARGUMENTS:
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index 1909be2..cd161c2 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -1253,6 +1253,11 @@
DartFixKindPriority.IN_FILE,
'Remove unused parameters everywhere in file',
);
+ static const REMOVE_VAR = FixKind(
+ 'dart.fix.remove.var',
+ DartFixKindPriority.DEFAULT,
+ "Remove 'var'",
+ );
static const RENAME_TO_CAMEL_CASE = FixKind(
'dart.fix.rename.toCamelCase',
DartFixKindPriority.DEFAULT,
diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart
index 7fc4864..af5285a 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart
@@ -194,11 +194,9 @@
const TransformSetErrorCode(
String name,
String problemMessage, {
- String? correctionMessage,
- bool hasPublishedDocs = false,
+ super.correctionMessage,
+ super.hasPublishedDocs,
}) : super(
- correctionMessage: correctionMessage,
- hasPublishedDocs: hasPublishedDocs,
name: name,
problemMessage: problemMessage,
uniqueName: 'TransformSetErrorCode.$name',
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 f0c4310..494f1ae 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -150,6 +150,7 @@
import 'package:analysis_server/src/services/correction/dart/remove_unused_label.dart';
import 'package:analysis_server/src/services/correction/dart/remove_unused_local_variable.dart';
import 'package:analysis_server/src/services/correction/dart/remove_unused_parameter.dart';
+import 'package:analysis_server/src/services/correction/dart/remove_var.dart';
import 'package:analysis_server/src/services/correction/dart/rename_to_camel_case.dart';
import 'package:analysis_server/src/services/correction/dart/replace_Null_with_void.dart';
import 'package:analysis_server/src/services/correction/dart/replace_boolean_with_bool.dart';
@@ -1351,6 +1352,9 @@
ParserErrorCode.VAR_AS_TYPE_NAME: [
ReplaceVarWithDynamic.new,
],
+ ParserErrorCode.VAR_RETURN_TYPE: [
+ RemoveVar.new,
+ ],
StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION: [
RemoveDeadIfNull.new,
],
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index cbdcd00..5b43952 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -903,9 +903,7 @@
/// [SelectionAnalyzer] for [ExtractMethodRefactoringImpl].
class _ExtractMethodAnalyzer extends StatementAnalyzer {
- _ExtractMethodAnalyzer(
- ResolvedUnitResult resolveResult, SourceRange selection)
- : super(resolveResult, selection);
+ _ExtractMethodAnalyzer(super.resolveResult, super.selection);
@override
void handleNextSelectedNode(AstNode node) {
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_label.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_label.dart
index d32922a..a2ca221 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_label.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_label.dart
@@ -10,9 +10,7 @@
/// A [Refactoring] for renaming [LabelElement]s.
class RenameLabelRefactoringImpl extends RenameRefactoringImpl {
- RenameLabelRefactoringImpl(
- RefactoringWorkspace workspace, LabelElement element)
- : super(workspace, element);
+ RenameLabelRefactoringImpl(super.workspace, LabelElement super.element);
@override
LabelElement get element => super.element as LabelElement;
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart
index 68b8849..ae5d654 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart
@@ -10,9 +10,7 @@
/// A [Refactoring] for renaming [LibraryElement]s.
class RenameLibraryRefactoringImpl extends RenameRefactoringImpl {
- RenameLibraryRefactoringImpl(
- RefactoringWorkspace workspace, LibraryElement element)
- : super(workspace, element);
+ RenameLibraryRefactoringImpl(super.workspace, LibraryElement super.element);
@override
LibraryElement get element => super.element as LibraryElement;
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_local.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_local.dart
index 3bb1fae..1d8a795 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_local.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_local.dart
@@ -24,10 +24,9 @@
List<LocalElement> elements = [];
- RenameLocalRefactoringImpl(RefactoringWorkspace workspace,
- AnalysisSession session, LocalElement element)
- : sessionHelper = AnalysisSessionHelper(session),
- super(workspace, element);
+ RenameLocalRefactoringImpl(
+ super.workspace, AnalysisSession session, LocalElement super.element)
+ : sessionHelper = AnalysisSessionHelper(session);
@override
LocalElement get element => super.element as LocalElement;
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart
index 91d1722..0479329 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart
@@ -248,11 +248,11 @@
/// Helper to check if the created element will cause any conflicts.
class _CreateUnitMemberValidator extends _BaseUnitMemberValidator {
_CreateUnitMemberValidator(
- SearchEngine searchEngine,
- LibraryElement library,
- ElementKind elementKind,
- String name,
- ) : super(searchEngine, library, elementKind, name);
+ super.searchEngine,
+ super.library,
+ super.elementKind,
+ super.name,
+ );
Future<RefactoringStatus> validate() async {
_validateWillConflict();
diff --git a/pkg/analysis_server/lib/src/services/snippets/dart/dart_snippet_producers.dart b/pkg/analysis_server/lib/src/services/snippets/dart/dart_snippet_producers.dart
index 6fd4e15..008b8df 100644
--- a/pkg/analysis_server/lib/src/services/snippets/dart/dart_snippet_producers.dart
+++ b/pkg/analysis_server/lib/src/services/snippets/dart/dart_snippet_producers.dart
@@ -18,7 +18,7 @@
static const prefix = 'class';
static const label = 'class';
- DartClassSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartClassSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -55,7 +55,7 @@
static const prefix = 'do';
static const label = 'do while';
- DartDoWhileLoopSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartDoWhileLoopSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -93,7 +93,7 @@
static const prefix = 'forin';
static const label = 'for in';
- DartForInLoopSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartForInLoopSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -134,7 +134,7 @@
static const prefix = 'for';
static const label = 'for';
- DartForLoopSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartForLoopSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -171,7 +171,7 @@
static const prefix = 'ife';
static const label = 'ife';
- DartIfElseSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartIfElseSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -212,7 +212,7 @@
static const prefix = 'if';
static const label = 'if';
- DartIfSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartIfSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -252,8 +252,7 @@
static const prefix = 'main';
static const label = 'main()';
- DartMainFunctionSnippetProducer._(DartSnippetRequest request)
- : super(request);
+ DartMainFunctionSnippetProducer._(super.request);
/// Whether to insert a `List<String> args` parameter in the generated
/// function.
@@ -306,13 +305,12 @@
final LibraryElement libraryElement;
final bool useSuperParams;
- DartSnippetProducer(DartSnippetRequest request)
+ DartSnippetProducer(super.request)
: sessionHelper = AnalysisSessionHelper(request.analysisSession),
utils = CorrectionUtils(request.unit),
libraryElement = request.unit.libraryElement,
useSuperParams = request.unit.libraryElement.featureSet
- .isEnabled(Feature.super_parameters),
- super(request);
+ .isEnabled(Feature.super_parameters);
bool get isInTestDirectory {
final path = request.unit.path;
@@ -336,7 +334,7 @@
static const prefix = 'switch';
static const label = 'switch case';
- DartSwitchSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartSwitchSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -380,7 +378,7 @@
static const prefix = 'test';
static const label = 'test';
- DartTestBlockSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartTestBlockSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -426,8 +424,7 @@
static const prefix = 'group';
static const label = 'group';
- DartTestGroupBlockSnippetProducer._(DartSnippetRequest request)
- : super(request);
+ DartTestGroupBlockSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -474,7 +471,7 @@
static const prefix = 'try';
static const label = 'try';
- DartTryCatchSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartTryCatchSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -517,7 +514,7 @@
static const prefix = 'while';
static const label = 'while';
- DartWhileLoopSnippetProducer._(DartSnippetRequest request) : super(request);
+ DartWhileLoopSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
diff --git a/pkg/analysis_server/lib/src/services/snippets/dart/flutter_snippet_producers.dart b/pkg/analysis_server/lib/src/services/snippets/dart/flutter_snippet_producers.dart
index 9f0f654..f98377e 100644
--- a/pkg/analysis_server/lib/src/services/snippets/dart/flutter_snippet_producers.dart
+++ b/pkg/analysis_server/lib/src/services/snippets/dart/flutter_snippet_producers.dart
@@ -18,7 +18,7 @@
late ClassElement? classWidget;
- FlutterSnippetProducer(DartSnippetRequest request) : super(request);
+ FlutterSnippetProducer(super.request);
@override
@mustCallSuper
@@ -57,8 +57,7 @@
@override
late ClassElement? classKey;
- FlutterStatefulWidgetSnippetProducer._(DartSnippetRequest request)
- : super(request);
+ FlutterStatefulWidgetSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -146,9 +145,7 @@
late ClassElement? classAnimationController;
late ClassElement? classSingleTickerProviderStateMixin;
- FlutterStatefulWidgetWithAnimationControllerSnippetProducer._(
- DartSnippetRequest request)
- : super(request);
+ FlutterStatefulWidgetWithAnimationControllerSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
@@ -282,8 +279,7 @@
@override
late ClassElement? classKey;
- FlutterStatelessWidgetSnippetProducer._(DartSnippetRequest request)
- : super(request);
+ FlutterStatelessWidgetSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
diff --git a/pkg/analysis_server/lib/src/status/diagnostics.dart b/pkg/analysis_server/lib/src/status/diagnostics.dart
index dfaacc9..26631f3 100644
--- a/pkg/analysis_server/lib/src/status/diagnostics.dart
+++ b/pkg/analysis_server/lib/src/status/diagnostics.dart
@@ -354,7 +354,7 @@
@override
AnalysisServer server;
- CompletionPage(DiagnosticsSite site, this.server) : super(site);
+ CompletionPage(super.site, this.server);
CompletionDomainHandler get completionDomain => server.handlers
.firstWhere((handler) => handler is CompletionDomainHandler)
@@ -704,9 +704,7 @@
}
abstract class DiagnosticPageWithNav extends DiagnosticPage {
- DiagnosticPageWithNav(DiagnosticsSite site, String id, String title,
- {String? description})
- : super(site, id, title, description: description);
+ DiagnosticPageWithNav(super.site, super.id, super.title, {super.description});
@override
bool get isNavPage => true;
@@ -1039,7 +1037,7 @@
@override
LspAnalysisServer server;
- LspCompletionPage(DiagnosticsSite site, this.server) : super(site);
+ LspCompletionPage(super.site, this.server);
@override
path.Context get pathContext => server.resourceProvider.pathContext;
diff --git a/pkg/analysis_server/test/services/snippets/dart/snippet_manager_test.dart b/pkg/analysis_server/test/services/snippets/dart/snippet_manager_test.dart
index c5ffb8a..eeff24a 100644
--- a/pkg/analysis_server/test/services/snippets/dart/snippet_manager_test.dart
+++ b/pkg/analysis_server/test/services/snippets/dart/snippet_manager_test.dart
@@ -69,7 +69,7 @@
/// A snippet producer that always returns `false` from [isValid] and throws
/// if [compute] is called.
class _NotValidSnippetProducer extends SnippetProducer {
- _NotValidSnippetProducer._(DartSnippetRequest request) : super(request);
+ _NotValidSnippetProducer._(super.request);
@override
Future<Snippet> compute() {
@@ -96,7 +96,7 @@
/// A snippet producer that always returns `true` from [isValid] and a simple
/// snippet from [compute].
class _ValidSnippetProducer extends SnippetProducer {
- _ValidSnippetProducer._(DartSnippetRequest request) : super(request);
+ _ValidSnippetProducer._(super.request);
@override
Future<Snippet> compute() async {
diff --git a/pkg/analysis_server/test/src/domain_abstract_test.dart b/pkg/analysis_server/test/src/domain_abstract_test.dart
index 12e9cf5..2221c34 100644
--- a/pkg/analysis_server/test/src/domain_abstract_test.dart
+++ b/pkg/analysis_server/test/src/domain_abstract_test.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/domain_abstract.dart';
import 'package:analysis_server/src/plugin/plugin_manager.dart';
import 'package:analysis_server/src/protocol_server.dart' hide Element;
@@ -94,7 +93,7 @@
}
class TestAbstractRequestHandler extends AbstractRequestHandler {
- TestAbstractRequestHandler(AnalysisServer server) : super(server);
+ TestAbstractRequestHandler(super.server);
@override
Response handleRequest(Request request, CancellationToken cancellationToken) {
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart
new file mode 100644
index 0000000..642d2d4
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart
@@ -0,0 +1,55 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'fix_processor.dart';
+
+void main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(RemoveVarTest);
+ });
+}
+
+@reflectiveTest
+class RemoveVarTest extends FixProcessorTest {
+ @override
+ FixKind get kind => DartFixKind.REMOVE_VAR;
+
+ Future<void> test_function() async {
+ await resolveTestCode('''
+var f() {}
+''');
+ await assertHasFix('''
+f() {}
+''');
+ }
+
+ Future<void> test_setter() async {
+ await resolveTestCode('''
+class C {
+ var set s(int i) {}
+}
+''');
+ await assertHasFix('''
+class C {
+ set s(int i) {}
+}
+''');
+ }
+
+ Future<void> test_typedef() async {
+ await resolveTestCode('''
+typedef F = var Function();
+''');
+ await assertHasFix('''
+typedef F = Function();
+''', errorFilter: (error) {
+ return error.errorCode == ParserErrorCode.VAR_RETURN_TYPE;
+ });
+ }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
index 278017c..efbc6aa 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
@@ -185,6 +185,7 @@
import 'remove_unused_label_test.dart' as remove_unused_label;
import 'remove_unused_local_variable_test.dart' as remove_unused_local_variable;
import 'remove_unused_parameter_test.dart' as remove_unused_parameter;
+import 'remove_var_test.dart' as remove_var;
import 'rename_to_camel_case_test.dart' as rename_to_camel_case;
import 'replace_Null_with_void_test.dart' as replace_null_with_void;
import 'replace_boolean_with_bool_test.dart' as replace_boolean_with_bool;
@@ -390,6 +391,7 @@
remove_unused_label.main();
remove_unused_local_variable.main();
remove_unused_parameter.main();
+ remove_var.main();
rename_to_camel_case.main();
replace_boolean_with_bool.main();
replace_cascade_with_dot.main();
diff --git a/pkg/analysis_server/test/verify_tests_test.dart b/pkg/analysis_server/test/verify_tests_test.dart
index 3277acc..4f71c5a 100644
--- a/pkg/analysis_server/test/verify_tests_test.dart
+++ b/pkg/analysis_server/test/verify_tests_test.dart
@@ -18,8 +18,7 @@
}
class _VerifyTests extends VerifyTests {
- _VerifyTests(String testDirPath, {List<String>? excludedPaths})
- : super(testDirPath, excludedPaths: excludedPaths);
+ _VerifyTests(super.testDirPath, {super.excludedPaths});
@override
bool isExpensive(Resource resource) => resource.shortName == 'integration';
diff --git a/pkg/analysis_server/tool/instrumentation/log/log.dart b/pkg/analysis_server/tool/instrumentation/log/log.dart
index 11643d6..4a94e36 100644
--- a/pkg/analysis_server/tool/instrumentation/log/log.dart
+++ b/pkg/analysis_server/tool/instrumentation/log/log.dart
@@ -79,16 +79,14 @@
class ErrorEntry extends GenericEntry {
/// Initialize a newly created log entry.
ErrorEntry(
- int index, int timeStamp, String entryKind, List<String> components)
- : super(index, timeStamp, entryKind, components);
+ super.index, super.timeStamp, super.entryKind, super.components);
}
/// A log entry representing an Ex entry.
class ExceptionEntry extends GenericEntry {
/// Initialize a newly created log entry.
ExceptionEntry(
- int index, int timeStamp, String entryKind, List<String> components)
- : super(index, timeStamp, entryKind, components);
+ super.index, super.timeStamp, super.entryKind, super.components);
}
/// A representation of a generic log entry.
@@ -101,8 +99,7 @@
/// Initialize a newly created generic log entry to have the given
/// [timeStamp], [entryKind] and list of [components]
- GenericEntry(int index, int timeStamp, this.entryKind, this.components)
- : super(index, timeStamp);
+ GenericEntry(super.index, super.timeStamp, this.entryKind, this.components);
@override
String get kind => entryKind;
@@ -124,9 +121,8 @@
final List<String> pluginData;
/// Initialize a newly created log entry.
- GenericPluginEntry(int index, int timeStamp, String entryKind,
- List<String> components, this.pluginData)
- : super(index, timeStamp, entryKind, components);
+ GenericPluginEntry(super.index, super.timeStamp, super.entryKind,
+ super.components, this.pluginData);
}
/// A representation of an instrumentation log.
@@ -387,7 +383,7 @@
/// Initialize a newly created log entry to have the given [timeStamp] and
/// [data].
- JsonBasedEntry(int index, int timeStamp, this.data) : super(index, timeStamp);
+ JsonBasedEntry(super.index, super.timeStamp, this.data);
@override
void _appendDetails(StringBuffer buffer) {
@@ -473,8 +469,7 @@
/// [notificationData] and to be associated with the plugin with the given
/// [pluginData].
JsonBasedPluginEntry(
- int index, int timeStamp, Map notificationData, this.pluginData)
- : super(index, timeStamp, notificationData);
+ super.index, super.timeStamp, super.notificationData, this.pluginData);
}
/// A single entry in an instrumentation log.
@@ -671,8 +666,7 @@
class NotificationEntry extends JsonBasedEntry {
/// Initialize a newly created response to have the given [timeStamp] and
/// [notificationData].
- NotificationEntry(int index, int timeStamp, Map notificationData)
- : super(index, timeStamp, notificationData);
+ NotificationEntry(super.index, super.timeStamp, super.notificationData);
/// Return the event field of the request.
String get event => data['event'] as String;
@@ -724,17 +718,15 @@
/// A log entry representing an PluginErr entry.
class PluginErrorEntry extends GenericPluginEntry {
/// Initialize a newly created log entry.
- PluginErrorEntry(int index, int timeStamp, String entryKind,
- List<String> components, List<String> pluginData)
- : super(index, timeStamp, entryKind, components, pluginData);
+ PluginErrorEntry(super.index, super.timeStamp, super.entryKind,
+ super.components, super.pluginData);
}
/// A log entry representing an PluginEx entry.
class PluginExceptionEntry extends GenericPluginEntry {
/// Initialize a newly created log entry.
- PluginExceptionEntry(int index, int timeStamp, String entryKind,
- List<String> components, List<String> pluginData)
- : super(index, timeStamp, entryKind, components, pluginData);
+ PluginExceptionEntry(super.index, super.timeStamp, super.entryKind,
+ super.components, super.pluginData);
}
/// A log entry representing a notification that was sent from a plugin to the
@@ -743,8 +735,7 @@
/// Initialize a newly created notification to have the given [timeStamp] and
/// [notificationData].
PluginNotificationEntry(
- int index, int timeStamp, Map notificationData, List<String> pluginData)
- : super(index, timeStamp, notificationData, pluginData);
+ super.index, super.timeStamp, super.notificationData, super.pluginData);
/// Return the event field of the notification.
String get event => data['event'] as String;
@@ -769,8 +760,7 @@
/// Initialize a newly created response to have the given [timeStamp] and
/// [requestData].
PluginRequestEntry(
- int index, int timeStamp, Map requestData, List<String> pluginData)
- : super(index, timeStamp, requestData, pluginData);
+ super.index, super.timeStamp, super.requestData, super.pluginData);
/// Return the id field of the request.
String get id => data['id'] as String;
@@ -798,8 +788,7 @@
/// Initialize a newly created response to have the given [timeStamp] and
/// [responseData].
PluginResponseEntry(
- int index, int timeStamp, Map responseData, List<String> pluginData)
- : super(index, timeStamp, responseData, pluginData);
+ super.index, super.timeStamp, super.responseData, super.pluginData);
/// Return the id field of the response.
String get id => data['id'] as String;
@@ -823,8 +812,7 @@
class RequestEntry extends JsonBasedEntry {
/// Initialize a newly created response to have the given [timeStamp] and
/// [requestData].
- RequestEntry(int index, int timeStamp, Map requestData)
- : super(index, timeStamp, requestData);
+ RequestEntry(super.index, super.timeStamp, super.requestData);
/// Return the clientRequestTime field of the request.
int get clientRequestTime => data['clientRequestTime'] as int;
@@ -854,8 +842,7 @@
class ResponseEntry extends JsonBasedEntry {
/// Initialize a newly created response to have the given [timeStamp] and
/// [responseData].
- ResponseEntry(int index, int timeStamp, Map responseData)
- : super(index, timeStamp, responseData);
+ ResponseEntry(super.index, super.timeStamp, super.responseData);
/// Return the id field of the response.
String get id => data['id'] as String;
@@ -891,8 +878,7 @@
/// Initialize a newly created entry with the given [index] and [timeStamp] to
/// represent the execution of an analysis task in the given [context] that is
/// described by the given [description].
- TaskEntry(int index, int timeStamp, this.context, this.description)
- : super(index, timeStamp);
+ TaskEntry(super.index, super.timeStamp, this.context, this.description);
@override
String get kind => 'Task';
diff --git a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
index d35dc51..a268eff 100644
--- a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
+++ b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
@@ -89,8 +89,7 @@
Token nameToken;
TypeBase type;
Token valueToken;
- Const(Comment? comment, this.nameToken, this.type, this.valueToken)
- : super(comment);
+ Const(super.comment, this.nameToken, this.type, this.valueToken);
@override
String get name => nameToken.lexeme;
@@ -112,12 +111,12 @@
final bool allowsNull;
final bool allowsUndefined;
Field(
- Comment? comment,
+ super.comment,
this.nameToken,
this.type,
this.allowsNull,
this.allowsUndefined,
- ) : super(comment);
+ );
@override
String get name => nameToken.lexeme;
@@ -139,10 +138,10 @@
final TypeBase indexType;
final TypeBase valueType;
Indexer(
- Comment? comment,
+ super.comment,
this.indexType,
this.valueType,
- ) : super(comment);
+ );
@override
String get name => fieldNameForIndexer;
@@ -162,12 +161,12 @@
final List<Member> members;
Interface(
- Comment? comment,
+ super.comment,
this.nameToken,
this.typeArgs,
this.baseTypes,
this.members,
- ) : super(comment);
+ );
@override
String get name => nameToken.lexeme;
@@ -223,17 +222,17 @@
}
abstract class Member extends AstNode {
- Member(Comment? comment) : super(comment);
+ Member(super.comment);
}
class Namespace extends AstNode {
final Token nameToken;
final List<Member> members;
Namespace(
- Comment? comment,
+ super.comment,
this.nameToken,
this.members,
- ) : super(comment);
+ );
@override
String get name => nameToken.lexeme;
@@ -982,10 +981,10 @@
final Token nameToken;
final TypeBase baseType;
TypeAlias(
- Comment? comment,
+ super.comment,
this.nameToken,
this.baseType,
- ) : super(comment);
+ );
@override
String get name => nameToken.lexeme;
diff --git a/pkg/analysis_server/tool/spec/api.dart b/pkg/analysis_server/tool/spec/api.dart
index 8e6696e..45fdf69 100644
--- a/pkg/analysis_server/tool/spec/api.dart
+++ b/pkg/analysis_server/tool/spec/api.dart
@@ -303,9 +303,8 @@
/// Base class for all possible types.
abstract class TypeDecl extends ApiNode {
- TypeDecl(dom.Element? html,
- {bool experimental = false, bool deprecated = false})
- : super(html, experimental: experimental, deprecated: deprecated);
+ TypeDecl(super.html,
+ {super.experimental, super.deprecated});
T accept<T>(ApiVisitor<T> visitor);
}
diff --git a/pkg/analysis_server/tool/spec/codegen_analysis_server.dart b/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
index fbe690f..0a9fe4d 100644
--- a/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
+++ b/pkg/analysis_server/tool/spec/codegen_analysis_server.dart
@@ -13,7 +13,7 @@
(Api api) => CodegenAnalysisServer(api));
class CodegenAnalysisServer extends CodegenJavaVisitor {
- CodegenAnalysisServer(Api api) : super(api);
+ CodegenAnalysisServer(super.api);
@override
void visitApi() {
diff --git a/pkg/analysis_server/tool/spec/codegen_dart.dart b/pkg/analysis_server/tool/spec/codegen_dart.dart
index 7069dc0..fe679a9 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart.dart
@@ -12,7 +12,7 @@
'object': 'Map',
};
- DartCodegenVisitor(Api api) : super(api);
+ DartCodegenVisitor(super.api);
/// Convert the given [TypeDecl] to a Dart type.
String dartType(TypeDecl type) {
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart b/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart
index 160c52d..d8bf61f 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart
@@ -36,7 +36,7 @@
/// Visitor which produces Dart code representing the API.
class CodegenNotificationHandlerVisitor extends DartCodegenVisitor
with CodeGenerator {
- CodegenNotificationHandlerVisitor(Api api) : super(api) {
+ CodegenNotificationHandlerVisitor(super.api) {
codeGeneratorSettings.commentLineLength = 79;
codeGeneratorSettings.docCommentStartMarker = null;
codeGeneratorSettings.docCommentLineLeader = '/// ';
@@ -128,7 +128,7 @@
class _NotificationVisitor extends HierarchicalApiVisitor {
final notificationConstants = <_Notification>[];
- _NotificationVisitor(Api api) : super(api);
+ _NotificationVisitor(super.api);
@override
void visitNotification(Notification notification) {
diff --git a/pkg/analysis_server/tool/spec/codegen_java.dart b/pkg/analysis_server/tool/spec/codegen_java.dart
index 54b48e8..1143012 100644
--- a/pkg/analysis_server/tool/spec/codegen_java.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java.dart
@@ -51,9 +51,8 @@
/// Visitor used to produce doc comments.
final ToHtmlVisitor toHtmlVisitor;
- CodegenJavaVisitor(Api api)
- : toHtmlVisitor = ToHtmlVisitor(api),
- super(api);
+ CodegenJavaVisitor(super.api)
+ : toHtmlVisitor = ToHtmlVisitor(api);
/// Create a constructor, using [callback] to create its contents.
void constructor(String name, void Function() callback) {
diff --git a/pkg/analysis_server/tool/spec/codegen_java_types.dart b/pkg/analysis_server/tool/spec/codegen_java_types.dart
index d48acf3..6431566 100644
--- a/pkg/analysis_server/tool/spec/codegen_java_types.dart
+++ b/pkg/analysis_server/tool/spec/codegen_java_types.dart
@@ -105,9 +105,8 @@
final bool generateGetters;
final bool generateSetters;
- CodegenJavaType(Api api, this.className, this.superclassName,
- this.generateGetters, this.generateSetters)
- : super(api);
+ CodegenJavaType(super.api, this.className, this.superclassName,
+ this.generateGetters, this.generateSetters);
/// Get the name of the consumer class for responses to this request.
@override
diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart
index 9e0a9d1..dd19bc6 100644
--- a/pkg/analysis_server/tool/spec/codegen_matchers.dart
+++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart
@@ -24,9 +24,8 @@
/// created.
late String context;
- CodegenMatchersVisitor(Api api)
- : toHtmlVisitor = ToHtmlVisitor(api),
- super(api) {
+ CodegenMatchersVisitor(super.api)
+ : toHtmlVisitor = ToHtmlVisitor(api) {
codeGeneratorSettings.commentLineLength = 79;
codeGeneratorSettings.docCommentStartMarker = null;
codeGeneratorSettings.docCommentLineLeader = '/// ';
diff --git a/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart b/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart
index 45116ed..1ea7024 100644
--- a/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart
+++ b/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart
@@ -54,7 +54,7 @@
/// A visitor that produces Dart code defining constants associated with the
/// API.
class CodegenVisitor extends DartCodegenVisitor with CodeGenerator {
- CodegenVisitor(Api api) : super(api) {
+ CodegenVisitor(super.api) {
codeGeneratorSettings.commentLineLength = 79;
codeGeneratorSettings.docCommentStartMarker = null;
codeGeneratorSettings.docCommentLineLeader = '/// ';
@@ -110,7 +110,7 @@
List<_Constant> constants = <_Constant>[];
/// Initialize a newly created visitor to visit the given [api].
- _ConstantVisitor(Api api) : super(api);
+ _ConstantVisitor(super.api);
@override
void visitNotification(Notification notification) {
diff --git a/pkg/analysis_server/tool/spec/implied_types.dart b/pkg/analysis_server/tool/spec/implied_types.dart
index 6a49fcc..448076e 100644
--- a/pkg/analysis_server/tool/spec/implied_types.dart
+++ b/pkg/analysis_server/tool/spec/implied_types.dart
@@ -37,7 +37,7 @@
class _ImpliedTypesVisitor extends HierarchicalApiVisitor {
Map<String, ImpliedType> impliedTypes = <String, ImpliedType>{};
- _ImpliedTypesVisitor(Api api) : super(api);
+ _ImpliedTypesVisitor(super.api);
void storeType(String name, String? nameSuffix, TypeDecl? type, String kind,
ApiNode apiNode) {
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart
index 6138199..7d4a72eb 100644
--- a/pkg/analysis_server/tool/spec/to_html.dart
+++ b/pkg/analysis_server/tool/spec/to_html.dart
@@ -144,7 +144,7 @@
class ApiMappings extends HierarchicalApiVisitor {
Map<dom.Element, Domain> domains = <dom.Element, Domain>{};
- ApiMappings(Api api) : super(api);
+ ApiMappings(super.api);
@override
void visitDomain(Domain domain) {
@@ -212,9 +212,8 @@
/// Mappings from HTML elements to API nodes.
ApiMappings apiMappings;
- ToHtmlVisitor(Api api)
- : apiMappings = ApiMappings(api),
- super(api) {
+ ToHtmlVisitor(super.api)
+ : apiMappings = ApiMappings(api) {
apiMappings.visitApi();
}
@@ -711,8 +710,7 @@
/// objects are shown as simply "object", and enums are shown as "String".
final bool short;
- TypeVisitor(Api api, {this.fieldsToBold = const {}, this.short = false})
- : super(api);
+ TypeVisitor(super.api, {this.fieldsToBold = const {}, this.short = false});
@override
void visitTypeEnum(TypeEnum typeEnum) {
diff --git a/pkg/analyzer/analysis_options.yaml b/pkg/analyzer/analysis_options.yaml
index 876098b..6a2cacc 100644
--- a/pkg/analyzer/analysis_options.yaml
+++ b/pkg/analyzer/analysis_options.yaml
@@ -37,4 +37,5 @@
- avoid_unused_constructor_parameters
- await_only_futures
- depend_on_referenced_packages
+ - unawaited_futures
- unnecessary_parenthesis
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_context.dart b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
index 57da9e4..f19c23c 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
@@ -247,7 +247,7 @@
var macroKernelKey = '${cycle.transitiveSignature}.macro_kernel';
var macroKernelBytes = byteStore.get(macroKernelKey);
if (macroKernelBytes == null) {
- macroKernelBytes = macroKernelBuilder.build(
+ macroKernelBytes = await macroKernelBuilder.build(
fileSystem: _MacroFileSystem(fileSystemState),
libraries: macroLibraries,
);
diff --git a/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart b/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart
new file mode 100644
index 0000000..e7ed68c
--- /dev/null
+++ b/pkg/analyzer/lib/src/summary2/kernel_compilation_service.dart
@@ -0,0 +1,201 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io' as io;
+import 'dart:typed_data';
+
+import 'package:_fe_analyzer_shared/src/macros/compiler/request_channel.dart';
+import 'package:analyzer/src/summary2/macro.dart';
+import 'package:meta/meta.dart';
+import 'package:path/path.dart' as package_path;
+
+/// Service for compiling Dart into kernel bytes.
+///
+/// It is implemented using `frontend_server` from the Dart SDK, and the
+/// running executable is expected to be `<sdk>/bin/dart` process.
+class KernelCompilationService {
+ /// The lock that must be acquired to access [_currentInstance].
+ static final _Lock _lock = _Lock();
+
+ /// The current running `frontend_server` instance.
+ static _FrontEndServerInstance? _currentInstance;
+
+ /// The timer scheduled to invoke [dispose] if no more compilations.
+ static Timer? _disposeDelayTimer;
+
+ /// Return an instance of the front-end server, starting it if necessary.
+ ///
+ /// Must be invoked with the [_lock] acquired.
+ static Future<_FrontEndServerInstance> get _instance async {
+ final instance = _currentInstance;
+ if (instance != null) {
+ return instance;
+ }
+
+ final executablePath = io.Platform.resolvedExecutable;
+ final binPath = package_path.dirname(executablePath);
+ final sdkPath = package_path.dirname(binPath);
+
+ final frontEndSnapshotPath = package_path.join(
+ binPath, 'snapshots', 'frontend_server.dart.snapshot');
+
+ final socketCompleter = Completer<io.Socket>();
+ final serverSocket = await _loopbackServerSocket();
+ serverSocket.listen((socket) async {
+ socketCompleter.complete(socket);
+ });
+
+ final host = serverSocket.address.address;
+ final addressStr = '$host:${serverSocket.port}';
+
+ final process = await io.Process.start(executablePath, [
+ frontEndSnapshotPath,
+ '--binary-protocol-address=$addressStr',
+ ]);
+
+ // When the process exits, we should not try to continue using it.
+ // ignore: unawaited_futures
+ process.exitCode.then((_) {
+ _currentInstance = null;
+ });
+
+ final socket = await socketCompleter.future;
+ final requestChannel = RequestChannel(socket);
+
+ // Put the platform dill.
+ final platformDillPath = package_path.join(
+ sdkPath, 'lib', '_internal', 'vm_platform_strong.dill');
+ final platformDillBytes = io.File(platformDillPath).readAsBytesSync();
+ await requestChannel.sendRequest<void>('dill.put', {
+ 'uri': 'dill:vm',
+ 'bytes': platformDillBytes,
+ });
+
+ return _currentInstance =
+ _FrontEndServerInstance(process, serverSocket, socket, requestChannel);
+ }
+
+ KernelCompilationService._();
+
+ /// Compiles the file with the [path] into kernel bytes. This file is
+ /// compiled as a program (script), so it must have the `main` function.
+ ///
+ /// Compilation will cancel any scheduled [disposeDelayed], so it should
+ /// be requested again using [dispose] or [disposeDelayed].
+ static Future<Uint8List> compile({
+ required MacroFileSystem fileSystem,
+ required String path,
+ }) {
+ _disposeDelayTimer?.cancel();
+ _disposeDelayTimer = null;
+
+ return _lock.synchronized(() async {
+ final instance = await _instance;
+ final requestChannel = instance.requestChannel;
+
+ MacroFileEntry uriStrToFile(Object? uriStr) {
+ final uri = Uri.parse(uriStr as String);
+ final path = fileSystem.pathContext.fromUri(uri);
+ return fileSystem.getFile(path);
+ }
+
+ // Configure file system requests.
+ requestChannel.add('file.exists', (uriStr) async {
+ return uriStrToFile(uriStr).exists;
+ });
+ requestChannel.add('file.readAsBytes', (uriStr) async {
+ final content = uriStrToFile(uriStr).content;
+ return utf8.encode(content);
+ });
+ requestChannel.add('file.readAsStringSync', (uriStr) async {
+ return uriStrToFile(uriStr).content;
+ });
+
+ // Now we can compile.
+ return await requestChannel.sendRequest<Uint8List>('kernelForProgram', {
+ 'sdkSummary': 'dill:vm',
+ 'uri': fileSystem.pathContext.toUri(path).toString(),
+ });
+ });
+ }
+
+ /// Stops the running `frontend_server` process.
+ static Future<void> dispose() {
+ return _lock.synchronized(() async {
+ final instance = _currentInstance;
+ if (instance != null) {
+ _currentInstance = null;
+ // We don't expect any answer, the process will stop.
+ // ignore: unawaited_futures
+ instance.requestChannel.sendRequest<void>('exit', {});
+ instance.socket.destroy();
+ // This socket is bound to a fresh port, we don't need it.
+ // ignore: unawaited_futures
+ instance.serverSocket.close();
+ instance.process.kill();
+ }
+ });
+ }
+
+ /// Schedules [dispose] invocation, if not interrupted by [compile].
+ @visibleForTesting
+ static void disposeDelayed(Duration timeout) {
+ _disposeDelayTimer?.cancel();
+ _disposeDelayTimer = Timer(timeout, () {
+ dispose();
+ });
+ }
+
+ static Future<io.ServerSocket> _loopbackServerSocket() async {
+ try {
+ return await io.ServerSocket.bind(io.InternetAddress.loopbackIPv6, 0);
+ } on io.SocketException catch (_) {
+ return await io.ServerSocket.bind(io.InternetAddress.loopbackIPv4, 0);
+ }
+ }
+}
+
+class _FrontEndServerInstance {
+ final io.Process process;
+ final io.ServerSocket serverSocket;
+ final io.Socket socket;
+ final RequestChannel requestChannel;
+
+ _FrontEndServerInstance(
+ this.process,
+ this.serverSocket,
+ this.socket,
+ this.requestChannel,
+ );
+}
+
+/// Simple non-reentrant lock.
+class _Lock {
+ Future<void>? _last;
+
+ Future<T> synchronized<T>(FutureOr<T> Function() f) async {
+ final previous = _last;
+ final completer = Completer<void>.sync();
+ _last = completer.future;
+ try {
+ if (previous != null) {
+ await previous;
+ }
+
+ final result = f();
+ if (result is Future) {
+ return await result;
+ } else {
+ return result;
+ }
+ } finally {
+ if (identical(_last, completer.future)) {
+ _last = null;
+ }
+ completer.complete();
+ }
+ }
+}
diff --git a/pkg/analyzer/lib/src/summary2/macro.dart b/pkg/analyzer/lib/src/summary2/macro.dart
index 74f3692..2ebb62e 100644
--- a/pkg/analyzer/lib/src/summary2/macro.dart
+++ b/pkg/analyzer/lib/src/summary2/macro.dart
@@ -6,6 +6,7 @@
import 'dart:typed_data';
import 'package:_fe_analyzer_shared/src/macros/api.dart' as macro;
+import 'package:_fe_analyzer_shared/src/macros/bootstrap.dart' as macro;
import 'package:_fe_analyzer_shared/src/macros/executor.dart' as macro;
import 'package:_fe_analyzer_shared/src/macros/executor/isolated_executor.dart'
as isolated_executor;
@@ -13,6 +14,7 @@
as macro;
import 'package:_fe_analyzer_shared/src/macros/executor/serialization.dart'
as macro;
+import 'package:analyzer/src/summary2/kernel_compilation_service.dart';
import 'package:path/path.dart' as package_path;
export 'package:_fe_analyzer_shared/src/macros/executor.dart' show Arguments;
@@ -68,6 +70,34 @@
}
}
+/// Implementation of [MacroKernelBuilder] using `frontend_server`.
+class FrontEndServerMacroKernelBuilder implements MacroKernelBuilder {
+ @override
+ Future<Uint8List> build({
+ required MacroFileSystem fileSystem,
+ required List<MacroLibrary> libraries,
+ }) async {
+ final macroMainContent = macro.bootstrapMacroIsolate(
+ {
+ for (final library in libraries)
+ library.uri.toString(): {
+ for (final c in library.classes) c.name: c.constructors
+ },
+ },
+ macro.SerializationMode.byteDataClient,
+ );
+
+ final macroMainPath = '${libraries.first.path}.macro';
+ final overlayFileSystem = _OverlayMacroFileSystem(fileSystem);
+ overlayFileSystem.overlays[macroMainPath] = macroMainContent;
+
+ return KernelCompilationService.compile(
+ fileSystem: overlayFileSystem,
+ path: macroMainPath,
+ );
+ }
+}
+
class MacroClass {
final String name;
final List<String> constructors;
@@ -113,7 +143,7 @@
}
abstract class MacroKernelBuilder {
- Uint8List build({
+ Future<Uint8List> build({
required MacroFileSystem fileSystem,
required List<MacroLibrary> libraries,
});
@@ -132,3 +162,37 @@
String get uriStr => uri.toString();
}
+
+/// [MacroFileEntry] for a file with overridden content.
+class _OverlayMacroFileEntry implements MacroFileEntry {
+ @override
+ final String content;
+
+ _OverlayMacroFileEntry(this.content);
+
+ @override
+ bool get exists => true;
+}
+
+/// Wrapper around another [MacroFileSystem] that can be configured to
+/// provide (or override) content of files.
+class _OverlayMacroFileSystem implements MacroFileSystem {
+ final MacroFileSystem _fileSystem;
+
+ /// The mapping from the path to the file content.
+ final Map<String, String> overlays = {};
+
+ _OverlayMacroFileSystem(this._fileSystem);
+
+ @override
+ package_path.Context get pathContext => _fileSystem.pathContext;
+
+ @override
+ MacroFileEntry getFile(String path) {
+ final overlayContent = overlays[path];
+ if (overlayContent != null) {
+ return _OverlayMacroFileEntry(overlayContent);
+ }
+ return _fileSystem.getFile(path);
+ }
+}
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index fdeb71c..9cf0d35 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -24,14 +24,8 @@
path: ../analyzer_utilities
args: ^2.0.0
async: ^2.5.0
- front_end:
- path: ../front_end
- kernel:
- path: ../kernel
linter: ^1.12.0
lints: ^2.0.0
matcher: ^0.12.10
test: ^1.16.0
test_reflective_loader: ^0.2.0
- vm:
- path: ../vm
diff --git a/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart b/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart
index 85b0d8c..27ff195 100644
--- a/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart
+++ b/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart
@@ -27,7 +27,7 @@
import 'package:test/test.dart';
import '../../../generated/test_support.dart';
-import '../../summary/repository_macro_kernel_builder.dart';
+import '../../summary/macros_environment.dart';
import 'context_collection_resolution_caching.dart';
import 'resolution.dart';
@@ -218,6 +218,7 @@
);
}
+ @mustCallSuper
Future<void> tearDown() async {
disposeAnalysisContextCollection();
}
diff --git a/pkg/analyzer/test/src/dart/resolution/macro_test.dart b/pkg/analyzer/test/src/dart/resolution/macro_test.dart
index a3d12b2..5b42f0d 100644
--- a/pkg/analyzer/test/src/dart/resolution/macro_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/macro_test.dart
@@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:analyzer/src/summary2/kernel_compilation_service.dart';
import 'package:analyzer/src/summary2/macro.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
-import '../../summary/repository_macro_kernel_builder.dart';
+import '../../summary/macros_environment.dart';
import 'context_collection_resolution.dart';
main() {
@@ -25,9 +26,7 @@
class MacroResolutionTest extends PubPackageResolutionTest {
@override
MacroKernelBuilder? get macroKernelBuilder {
- return DartRepositoryMacroKernelBuilder(
- MacrosEnvironment.instance.platformDillBytes,
- );
+ return FrontEndServerMacroKernelBuilder();
}
@override
@@ -43,6 +42,14 @@
);
}
+ @override
+ Future<void> tearDown() async {
+ await super.tearDown();
+ KernelCompilationService.disposeDelayed(
+ const Duration(milliseconds: 100),
+ );
+ }
+
test_0() async {
newFile2('$testPackageLibPath/a.dart', r'''
import 'dart:async';
diff --git a/pkg/analyzer/test/src/summary/elements_base.dart b/pkg/analyzer/test/src/summary/elements_base.dart
index d0e24164..83d47b0 100644
--- a/pkg/analyzer/test/src/summary/elements_base.dart
+++ b/pkg/analyzer/test/src/summary/elements_base.dart
@@ -171,7 +171,7 @@
),
);
- _linkConfiguredLibraries(
+ await _linkConfiguredLibraries(
elementFactory,
inputLibraries,
preBuildSequence,
@@ -307,10 +307,10 @@
/// If there are any [macroLibraries], build the kernel and prepare for
/// execution.
- void _buildMacroLibraries(
+ Future<void> _buildMacroLibraries(
LinkedElementFactory elementFactory,
List<MacroLibrary> macroLibraries,
- ) {
+ ) async {
if (macroLibraries.isEmpty) {
return;
}
@@ -325,7 +325,7 @@
return;
}
- var macroKernelBytes = macroKernelBuilder.build(
+ var macroKernelBytes = await macroKernelBuilder.build(
fileSystem: _MacroFileSystem(resourceProvider),
libraries: macroLibraries,
);
@@ -346,11 +346,11 @@
/// If there are any libraries in the [uriStrSetList], link these subsets
/// of [inputLibraries] (and remove from it), build macro kernels, prepare
/// for executing macros.
- void _linkConfiguredLibraries(
+ Future<void> _linkConfiguredLibraries(
LinkedElementFactory elementFactory,
List<LinkInputLibrary> inputLibraries,
List<Set<String>>? uriStrSetList,
- ) {
+ ) async {
if (uriStrSetList == null) {
return;
}
@@ -365,13 +365,13 @@
}
}
- link(
+ await link(
elementFactory,
cycleInputLibraries,
macroExecutor: macroExecutor,
);
- _buildMacroLibraries(elementFactory, macroLibraries);
+ await _buildMacroLibraries(elementFactory, macroLibraries);
// Remove libraries that we just linked.
cycleInputLibraries.forEach(inputLibraries.remove);
diff --git a/pkg/analyzer/test/src/summary/macro_test.dart b/pkg/analyzer/test/src/summary/macro_test.dart
index c32eac5..42e0a59 100644
--- a/pkg/analyzer/test/src/summary/macro_test.dart
+++ b/pkg/analyzer/test/src/summary/macro_test.dart
@@ -6,13 +6,15 @@
as macro;
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
+import 'package:analyzer/src/summary2/kernel_compilation_service.dart';
+import 'package:analyzer/src/summary2/macro.dart';
import 'package:analyzer/src/test_utilities/package_config_file_builder.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'element_text.dart';
import 'elements_base.dart';
-import 'repository_macro_kernel_builder.dart';
+import 'macros_environment.dart';
main() {
try {
@@ -62,15 +64,15 @@
macrosEnvironment: MacrosEnvironment.instance,
);
- macroKernelBuilder = DartRepositoryMacroKernelBuilder(
- MacrosEnvironment.instance.platformDillBytes,
- );
-
+ macroKernelBuilder = FrontEndServerMacroKernelBuilder();
macroExecutor = macro.MultiMacroExecutor();
}
Future<void> tearDown() async {
await macroExecutor?.close();
+ KernelCompilationService.disposeDelayed(
+ const Duration(milliseconds: 100),
+ );
}
test_build_types() async {
diff --git a/pkg/analyzer/test/src/summary/macros_environment.dart b/pkg/analyzer/test/src/summary/macros_environment.dart
new file mode 100644
index 0000000..0f23be5
--- /dev/null
+++ b/pkg/analyzer/test/src/summary/macros_environment.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer_utilities/package_root.dart' as package_root;
+import 'package:path/path.dart' as package_path;
+
+/// Environment for compiling macros to kernels, expecting that we run
+/// a test in the Dart SDK repository.
+///
+/// This is a temporary implementation.
+class MacrosEnvironment {
+ static final instance = MacrosEnvironment._();
+
+ final _resourceProvider = MemoryResourceProvider(context: package_path.posix);
+ late final Folder packageAnalyzerFolder;
+
+ MacrosEnvironment._() {
+ var physical = PhysicalResourceProvider.INSTANCE;
+
+ var packageRoot = physical.pathContext.normalize(package_root.packageRoot);
+ physical
+ .getFolder(packageRoot)
+ .getChildAssumingFolder('_fe_analyzer_shared/lib/src/macros')
+ .copyTo(
+ packageSharedFolder.getChildAssumingFolder('lib/src'),
+ );
+ packageAnalyzerFolder =
+ physical.getFolder(packageRoot).getChildAssumingFolder('analyzer');
+ }
+
+ Folder get packageSharedFolder {
+ return _resourceProvider.getFolder('/packages/_fe_analyzer_shared');
+ }
+}
diff --git a/pkg/analyzer/test/src/summary/repository_macro_kernel_builder.dart b/pkg/analyzer/test/src/summary/repository_macro_kernel_builder.dart
deleted file mode 100644
index e178097..0000000
--- a/pkg/analyzer/test/src/summary/repository_macro_kernel_builder.dart
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// ignore: deprecated_member_use
-import 'dart:cli' as cli;
-import 'dart:convert';
-import 'dart:io' as io;
-import 'dart:typed_data';
-
-import 'package:_fe_analyzer_shared/src/macros/bootstrap.dart';
-import 'package:_fe_analyzer_shared/src/macros/executor/serialization.dart';
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/file_system/memory_file_system.dart';
-import 'package:analyzer/file_system/physical_file_system.dart';
-import 'package:analyzer/src/summary2/macro.dart';
-import 'package:analyzer/src/util/uri.dart';
-import 'package:analyzer_utilities/package_root.dart' as package_root;
-import 'package:front_end/src/api_prototype/compiler_options.dart' as fe;
-import 'package:front_end/src/api_prototype/file_system.dart' as fe;
-import 'package:front_end/src/fasta/kernel/utils.dart' as fe;
-import 'package:kernel/target/targets.dart' as fe;
-import 'package:path/path.dart' as package_path;
-import 'package:vm/kernel_front_end.dart' as fe;
-import 'package:vm/target/vm.dart' as fe;
-
-final Uri _platformDillUri = Uri.parse('org-dartlang-sdk://vm.dill');
-
-/// Implementation of [MacroKernelBuilder] that can run in Dart SDK repository.
-///
-/// This is a temporary implementation, to be replaced with a more stable
-/// approach, e.g. a `dart:` API for compilation, shipping `front_end`
-/// with SDK, etc.
-class DartRepositoryMacroKernelBuilder implements MacroKernelBuilder {
- final Uint8List platformDillBytes;
-
- DartRepositoryMacroKernelBuilder(this.platformDillBytes);
-
- @override
- Uint8List build({
- required MacroFileSystem fileSystem,
- required List<MacroLibrary> libraries,
- }) {
- var options = fe.CompilerOptions()
- ..sdkSummary = _platformDillUri
- ..target = fe.VmTarget(fe.TargetFlags(enableNullSafety: true));
-
- var macroMainContent = bootstrapMacroIsolate(
- {
- for (var library in libraries)
- library.uri.toString(): {
- for (var c in library.classes) c.name: c.constructors
- },
- },
- SerializationMode.byteDataClient,
- );
-
- var macroMainBytes = utf8.encode(macroMainContent) as Uint8List;
- var macroMainPath = '${libraries.first.path}.macro';
- var macroMainUri = fileSystem.pathContext.toUri(macroMainPath);
-
- options.fileSystem = _FileSystem(
- fileSystem,
- platformDillBytes,
- macroMainUri,
- macroMainBytes,
- );
-
- // TODO(scheglov) For now we convert async into sync.
- // ignore: deprecated_member_use
- var compilationResults = cli.waitFor(
- fe.compileToKernel(
- macroMainUri,
- options,
- environmentDefines: {},
- ),
- );
-
- return fe.serializeComponent(
- compilationResults.component!,
- filter: (library) {
- return !library.importUri.isScheme('dart');
- },
- includeSources: false,
- );
- }
-}
-
-/// Environment for compiling macros to kernels, expecting that we run
-/// a test in the Dart SDK repository.
-///
-/// Just like [DartRepositoryMacroKernelBuilder], this is a temporary
-/// implementation.
-class MacrosEnvironment {
- static final instance = MacrosEnvironment._();
-
- final _resourceProvider = MemoryResourceProvider(context: package_path.posix);
- late final Uint8List platformDillBytes;
- late final Folder packageAnalyzerFolder;
-
- MacrosEnvironment._() {
- var physical = PhysicalResourceProvider.INSTANCE;
-
- var packageRoot = physical.pathContext.normalize(package_root.packageRoot);
- physical
- .getFolder(packageRoot)
- .getChildAssumingFolder('_fe_analyzer_shared/lib/src/macros')
- .copyTo(
- packageSharedFolder.getChildAssumingFolder('lib/src'),
- );
- packageAnalyzerFolder =
- physical.getFolder(packageRoot).getChildAssumingFolder('analyzer');
-
- platformDillBytes = physical
- .getFile(io.Platform.resolvedExecutable)
- .parent
- .parent
- .getChildAssumingFolder('lib')
- .getChildAssumingFolder('_internal')
- .getChildAssumingFile('vm_platform_strong.dill')
- .readAsBytesSync();
- }
-
- Folder get packageSharedFolder {
- return _resourceProvider.getFolder('/packages/_fe_analyzer_shared');
- }
-}
-
-class _BytesFileSystemEntity implements fe.FileSystemEntity {
- @override
- final Uri uri;
-
- final Uint8List bytes;
-
- _BytesFileSystemEntity(this.uri, this.bytes);
-
- @override
- Future<bool> exists() async => true;
-
- @override
- Future<bool> existsAsyncIfPossible() => exists();
-
- @override
- Future<List<int>> readAsBytes() async => bytes;
-
- @override
- Future<List<int>> readAsBytesAsyncIfPossible() => readAsBytes();
-
- @override
- Future<String> readAsString() async {
- var bytes = await readAsBytes();
- return utf8.decode(bytes);
- }
-}
-
-class _FileSystem implements fe.FileSystem {
- final MacroFileSystem fileSystem;
- final Uint8List platformDillBytes;
- final Uri macroMainUri;
- final Uint8List macroMainBytes;
-
- _FileSystem(
- this.fileSystem,
- this.platformDillBytes,
- this.macroMainUri,
- this.macroMainBytes,
- );
-
- @override
- fe.FileSystemEntity entityForUri(Uri uri) {
- if (uri == _platformDillUri) {
- return _BytesFileSystemEntity(uri, platformDillBytes);
- } else if (uri == macroMainUri) {
- return _BytesFileSystemEntity(uri, macroMainBytes);
- } else if (uri.isScheme('file')) {
- var path = fileUriToNormalizedPath(fileSystem.pathContext, uri);
- return _FileSystemEntity(
- uri,
- fileSystem.getFile(path),
- );
- } else {
- throw fe.FileSystemException(uri, 'Only supports file: URIs');
- }
- }
-}
-
-class _FileSystemEntity implements fe.FileSystemEntity {
- @override
- final Uri uri;
-
- final MacroFileEntry file;
-
- _FileSystemEntity(this.uri, this.file);
-
- @override
- Future<bool> exists() async => file.exists;
-
- @override
- Future<bool> existsAsyncIfPossible() => exists();
-
- @override
- Future<List<int>> readAsBytes() async {
- var string = await readAsString();
- return utf8.encode(string);
- }
-
- @override
- Future<List<int>> readAsBytesAsyncIfPossible() => readAsBytes();
-
- @override
- Future<String> readAsString() async => file.content;
-}
diff --git a/pkg/compiler/lib/src/common/elements.dart b/pkg/compiler/lib/src/common/elements.dart
index f7d3f71..2919892 100644
--- a/pkg/compiler/lib/src/common/elements.dart
+++ b/pkg/compiler/lib/src/common/elements.dart
@@ -1513,7 +1513,7 @@
/// Create the instantiation of [cls] with the given [typeArguments] and
/// [nullability].
InterfaceType createInterfaceType(
- ClassEntity cls, List<DartType> typeArguments);
+ ClassEntity /*!*/ cls, List<DartType /*!*/ > typeArguments);
/// Returns the `dynamic` type.
DartType get dynamicType;
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
index afc17fe..8852f21 100644
--- a/pkg/compiler/lib/src/constants/values.dart
+++ b/pkg/compiler/lib/src/constants/values.dart
@@ -468,7 +468,7 @@
}
class StringConstantValue extends PrimitiveConstantValue {
- final String stringValue;
+ final String /*!*/ stringValue;
@override
final int hashCode;
@@ -568,7 +568,7 @@
}
class ListConstantValue extends ObjectConstantValue {
- final List<ConstantValue> entries;
+ final List<ConstantValue /*!*/ > /*!*/ entries;
@override
final int hashCode;
diff --git a/pkg/compiler/lib/src/elements/entities.dart b/pkg/compiler/lib/src/elements/entities.dart
index 0451c39..e0f8380 100644
--- a/pkg/compiler/lib/src/elements/entities.dart
+++ b/pkg/compiler/lib/src/elements/entities.dart
@@ -44,7 +44,7 @@
///
/// The [name] property corresponds to the prefix name, if any.
class ImportEntity {
- final String name;
+ final String /*?*/ name;
/// The canonical URI of the library where this import occurs
/// (where the import is declared).
@@ -316,8 +316,8 @@
factory ParameterStructure(
int requiredPositionalParameters,
int positionalParameters,
- List<String> namedParameters,
- Set<String> requiredNamedParameters,
+ List<String /*!*/ > namedParameters,
+ Set<String /*!*/ > requiredNamedParameters,
int typeParameters) {
// This simple canonicalization reduces the number of ParameterStructure
// objects by over 90%.
@@ -356,7 +356,7 @@
source.begin(tag);
int requiredPositionalParameters = source.readInt();
int positionalParameters = source.readInt();
- List<String> namedParameters = source.readStrings();
+ List<String> namedParameters = source.readStrings() /*!*/;
Set<String> requiredNamedParameters =
source.readStrings(emptyAsNull: true)?.toSet() ?? const <String>{};
int typeParameters = source.readInt();
diff --git a/pkg/compiler/lib/src/elements/types.dart b/pkg/compiler/lib/src/elements/types.dart
index dbcb79d..27ab75c 100644
--- a/pkg/compiler/lib/src/elements/types.dart
+++ b/pkg/compiler/lib/src/elements/types.dart
@@ -39,8 +39,8 @@
}
extension on DataSinkWriter {
- void _writeDartTypes(
- List<DartType> types, List<FunctionTypeVariable> functionTypeVariables) {
+ void _writeDartTypes(List<DartType /*!*/ > types,
+ List<FunctionTypeVariable /*!*/ > functionTypeVariables) {
writeInt(types.length);
for (DartType type in types) {
type.writeToDataSink(this, functionTypeVariables);
@@ -94,8 +94,8 @@
throw UnsupportedError('Unexpected DartTypeKind $kind');
}
- void writeToDataSink(
- DataSinkWriter sink, List<FunctionTypeVariable> functionTypeVariables);
+ void writeToDataSink(DataSinkWriter sink,
+ List<FunctionTypeVariable /*!*/ > functionTypeVariables);
/// Returns the base type if this is a [LegacyType] or [NullableType] and
/// returns this type otherwise.
@@ -209,7 +209,7 @@
}
class LegacyType extends DartType {
- final DartType baseType;
+ final DartType /*!*/ baseType;
const LegacyType._(this.baseType);
@@ -264,7 +264,7 @@
}
class NullableType extends DartType {
- final DartType baseType;
+ final DartType /*!*/ baseType;
const NullableType._(this.baseType);
@@ -319,8 +319,8 @@
}
class InterfaceType extends DartType {
- final ClassEntity element;
- final List<DartType> typeArguments;
+ final ClassEntity /*!*/ element;
+ final List<DartType /*!*/ > typeArguments;
InterfaceType._allocate(this.element, this.typeArguments);
@@ -478,7 +478,7 @@
}
}
- DartType get bound {
+ DartType /*!*/ get bound {
assert(_bound != null, "Bound has not been set.");
return _bound;
}
@@ -653,8 +653,8 @@
class FunctionType extends DartType {
final DartType returnType;
- final List<DartType> parameterTypes;
- final List<DartType> optionalParameterTypes;
+ final List<DartType /*!*/ > parameterTypes;
+ final List<DartType /*!*/ > optionalParameterTypes;
/// The names of all named parameters ordered lexicographically.
final List<String> namedParameters;
@@ -664,9 +664,9 @@
/// The types of the named parameters in the order corresponding to the
/// [namedParameters].
- final List<DartType> namedParameterTypes;
+ final List<DartType /*!*/ > namedParameterTypes;
- final List<FunctionTypeVariable> typeVariables;
+ final List<FunctionTypeVariable /*!*/ > typeVariables;
FunctionType._allocate(
this.returnType,
@@ -691,12 +691,12 @@
factory FunctionType._(
DartType returnType,
- List<DartType> parameterTypes,
- List<DartType> optionalParameterTypes,
- List<String> namedParameters,
- Set<String> requiredNamedParameters,
- List<DartType> namedParameterTypes,
- List<FunctionTypeVariable> typeVariables) {
+ List<DartType /*!*/ > parameterTypes,
+ List<DartType /*!*/ > optionalParameterTypes,
+ List<String /*!*/ > namedParameters,
+ Set<String /*!*/ > requiredNamedParameters,
+ List<DartType /*!*/ > namedParameterTypes,
+ List<FunctionTypeVariable /*!*/ > typeVariables) {
// Canonicalize empty collections to constants to save storage.
if (parameterTypes.isEmpty) parameterTypes = const [];
if (optionalParameterTypes.isEmpty) optionalParameterTypes = const [];
@@ -736,7 +736,7 @@
List<DartType> namedParameterTypes =
source._readDartTypes(functionTypeVariables);
List<String> namedParameters =
- List<String>.filled(namedParameterTypes.length, null);
+ List<String>.filled(namedParameterTypes.length, '');
var requiredNamedParameters = <String>{};
for (int i = 0; i < namedParameters.length; i++) {
namedParameters[i] = source.readString();
@@ -856,7 +856,7 @@
}
class FutureOrType extends DartType {
- final DartType typeArgument;
+ final DartType /*!*/ typeArgument;
const FutureOrType._(this.typeArgument);
@@ -921,34 +921,36 @@
abstract class DartTypeVisitor<R, A> {
const DartTypeVisitor();
- R visit(covariant DartType type, A argument) => type.accept(this, argument);
+ R /*!*/ visit(covariant DartType type, A argument) =>
+ type.accept(this, argument);
- R visitLegacyType(covariant LegacyType type, A argument);
+ R /*!*/ visitLegacyType(covariant LegacyType type, A argument);
- R visitNullableType(covariant NullableType type, A argument);
+ R /*!*/ visitNullableType(covariant NullableType type, A argument);
- R visitNeverType(covariant NeverType type, A argument);
+ R /*!*/ visitNeverType(covariant NeverType type, A argument);
- R visitVoidType(covariant VoidType type, A argument);
+ R /*!*/ visitVoidType(covariant VoidType type, A argument);
- R visitTypeVariableType(covariant TypeVariableType type, A argument);
+ R /*!*/ visitTypeVariableType(covariant TypeVariableType type, A argument);
- R visitFunctionTypeVariable(covariant FunctionTypeVariable type, A argument);
+ R /*!*/ visitFunctionTypeVariable(
+ covariant FunctionTypeVariable type, A argument);
- R visitFunctionType(covariant FunctionType type, A argument);
+ R /*!*/ visitFunctionType(covariant FunctionType type, A argument);
- R visitInterfaceType(covariant InterfaceType type, A argument);
+ R /*!*/ visitInterfaceType(covariant InterfaceType type, A argument);
- R visitDynamicType(covariant DynamicType type, A argument);
+ R /*!*/ visitDynamicType(covariant DynamicType type, A argument);
- R visitErasedType(covariant ErasedType type, A argument);
+ R /*!*/ visitErasedType(covariant ErasedType type, A argument);
- R visitAnyType(covariant AnyType type, A argument);
+ R /*!*/ visitAnyType(covariant AnyType type, A argument);
- R visitFutureOrType(covariant FutureOrType type, A argument);
+ R /*!*/ visitFutureOrType(covariant FutureOrType type, A argument);
}
-class _LegacyErasureVisitor extends DartTypeVisitor<DartType, Null> {
+class _LegacyErasureVisitor extends DartTypeVisitor<DartType /*!*/, Null> {
final DartTypes _dartTypes;
_LegacyErasureVisitor(this._dartTypes);
@@ -997,8 +999,9 @@
var oldTypeVariables = type.typeVariables;
var length = oldTypeVariables.length;
+ // Use the old type variables as placeholders that are overwritten.
List<FunctionTypeVariable> typeVariables =
- List<FunctionTypeVariable>.filled(length, null);
+ List<FunctionTypeVariable>.of(oldTypeVariables, growable: false);
List<FunctionTypeVariable> erasableTypeVariables = [];
List<FunctionTypeVariable> erasedTypeVariables = [];
for (int i = 0; i < length; i++) {
@@ -1059,13 +1062,13 @@
}
abstract class DartTypeSubstitutionVisitor<A>
- extends DartTypeVisitor<DartType, A> {
+ extends DartTypeVisitor<DartType /*!*/, A> {
DartTypes get dartTypes;
// The input type is a DAG and we must preserve the sharing.
final Map<DartType, DartType> _map = Map.identity();
- DartType _mapped(DartType oldType, DartType newType) {
+ DartType _mapped(DartType oldType, DartType /*!*/ newType) {
assert(_map[oldType] == null);
return _map[oldType] = newType;
}
@@ -1187,7 +1190,8 @@
// indirectly changed by the substitution of F. When D is replaced by `D2
// extends Map<B,G>`, C must be replaced by `C2 extends D2`.
- List<FunctionTypeVariable> undecided = variables.toList();
+ List<FunctionTypeVariable /*?*/ > undecided =
+ List.of(variables, growable: false);
List<FunctionTypeVariable> newVariables;
_DependencyCheck<A> dependencyCheck = _DependencyCheck<A>(this, argument);
@@ -1306,7 +1310,7 @@
/// visit returns `true`. The default handlers return `false` which will search
/// the whole structure unless overridden.
abstract class DartTypeStructuralPredicateVisitor
- extends DartTypeVisitor<bool, List<FunctionTypeVariable>> {
+ extends DartTypeVisitor<bool, List<FunctionTypeVariable> /*?*/ > {
const DartTypeStructuralPredicateVisitor();
bool run(DartType type) => visit(type, null);
@@ -1701,7 +1705,7 @@
DartType bottomType() =>
useLegacySubtyping ? commonElements.nullType : neverType();
- DartType legacyType(DartType baseType) {
+ DartType legacyType(DartType /*!*/ baseType) {
DartType result;
if (isStrongTopType(baseType) ||
baseType.isNull ||
@@ -1714,7 +1718,7 @@
return result;
}
- DartType nullableType(DartType baseType) {
+ DartType nullableType(DartType /*!*/ baseType) {
bool _isNullable(DartType t) =>
// Note that we can assume null safety is enabled here.
t.isNull ||
@@ -1748,7 +1752,7 @@
}
InterfaceType interfaceType(
- ClassEntity element, List<DartType> typeArguments) =>
+ ClassEntity element, List<DartType /*!*/ > typeArguments) =>
InterfaceType._(element, typeArguments);
// TODO(fishythefish): Normalize `T extends Never` to `Never`.
@@ -1771,12 +1775,12 @@
FunctionType functionType(
DartType returnType,
- List<DartType> parameterTypes,
- List<DartType> optionalParameterTypes,
+ List<DartType /*!*/ > parameterTypes,
+ List<DartType /*!*/ > optionalParameterTypes,
List<String> namedParameters,
Set<String> requiredNamedParameters,
- List<DartType> namedParameterTypes,
- List<FunctionTypeVariable> typeVariables) {
+ List<DartType /*!*/ > namedParameterTypes,
+ List<FunctionTypeVariable /*!*/ > typeVariables) {
FunctionType type = FunctionType._(
returnType,
parameterTypes,
@@ -2264,7 +2268,7 @@
/// Returns `true` if [type] occuring in a program with no sound null safety
/// cannot accept `null` under sound rules.
- bool isNonNullableIfSound(DartType type) {
+ bool isNonNullableIfSound(DartType /*!*/ type) {
if (type is DynamicType ||
type is VoidType ||
type is AnyType ||
diff --git a/pkg/compiler/lib/src/js_backend/native_data.dart b/pkg/compiler/lib/src/js_backend/native_data.dart
index a2541d2..f4f71f9 100644
--- a/pkg/compiler/lib/src/js_backend/native_data.dart
+++ b/pkg/compiler/lib/src/js_backend/native_data.dart
@@ -207,7 +207,7 @@
bool isAllowInteropUsed = source.readBool();
Map<ClassEntity, NativeClassTag> nativeClassTagInfo =
source.readClassMap(() {
- List<String> names = source.readStrings();
+ List<String> names = source.readStrings() /*!*/;
bool isNonLeaf = source.readBool();
return NativeClassTag.internal(names, isNonLeaf);
});
diff --git a/pkg/compiler/lib/src/js_model/element_map_impl.dart b/pkg/compiler/lib/src/js_model/element_map_impl.dart
index 6bff96f..c9df01d 100644
--- a/pkg/compiler/lib/src/js_model/element_map_impl.dart
+++ b/pkg/compiler/lib/src/js_model/element_map_impl.dart
@@ -78,15 +78,15 @@
@override
final DiagnosticReporter reporter;
final Environment _environment;
- JCommonElements _commonElements;
- JsElementEnvironment _elementEnvironment;
- DartTypeConverter _typeConverter;
- KernelDartTypes _types;
+ /*late final*/ JCommonElements _commonElements;
+ /*late final*/ JsElementEnvironment _elementEnvironment;
+ /*late final*/ DartTypeConverter _typeConverter;
+ /*late final*/ KernelDartTypes _types;
ir.CoreTypes _coreTypes;
ir.TypeEnvironment _typeEnvironment;
ir.ClassHierarchy _classHierarchy;
- Dart2jsConstantEvaluator _constantEvaluator;
- ConstantValuefier _constantValuefier;
+ Dart2jsConstantEvaluator /*?*/ _constantEvaluator;
+ /*late final*/ ConstantValuefier _constantValuefier;
/// Library environment. Used for fast lookup.
JProgramEnv programEnv;
@@ -1643,10 +1643,12 @@
}
}
}
- assert(
- typeVariable != null,
- "No type variable entity for $node on "
- "${node.parent is ir.FunctionNode ? node.parent.parent : node.parent}");
+ if (typeVariable == null) {
+ throw failedAt(
+ CURRENT_ELEMENT_SPANNABLE,
+ "No type variable entity for $node on "
+ "${node.parent is ir.FunctionNode ? node.parent.parent : node.parent}");
+ }
return typeVariable;
}
@@ -1658,15 +1660,15 @@
JConstructorBody _getConstructorBody(IndexedConstructor constructor) {
JConstructorDataImpl data = members.getData(constructor);
- if (data.constructorBody == null) {
+ JConstructorBody /*?*/ constructorBody = data.constructorBody;
+ if (constructorBody == null) {
/// The constructor calls the constructor body with all parameters.
// TODO(johnniwinther): Remove parameters that are not used in the
// constructor body.
ParameterStructure parameterStructure =
_getParameterStructureFromFunctionNode(data.node.function);
- JConstructorBody constructorBody =
- createConstructorBody(constructor, parameterStructure);
+ constructorBody = createConstructorBody(constructor, parameterStructure);
members.register<IndexedFunction, FunctionData>(
constructorBody,
ConstructorBodyDataImpl(
@@ -1683,7 +1685,7 @@
constructor, constructorBody);
data.constructorBody = constructorBody;
}
- return data.constructorBody;
+ return constructorBody;
}
@override
diff --git a/pkg/compiler/lib/src/js_model/elements.dart b/pkg/compiler/lib/src/js_model/elements.dart
index aab30db..6a6d47c 100644
--- a/pkg/compiler/lib/src/js_model/elements.dart
+++ b/pkg/compiler/lib/src/js_model/elements.dart
@@ -126,7 +126,7 @@
abstract class JMember extends IndexedMember {
@override
- final JLibrary library;
+ final JLibrary /*!*/ library;
@override
final JClass enclosingClass;
final Name _name;
diff --git a/pkg/compiler/lib/src/js_model/js_world_builder.dart b/pkg/compiler/lib/src/js_model/js_world_builder.dart
index 2609fe2..3449c01 100644
--- a/pkg/compiler/lib/src/js_model/js_world_builder.dart
+++ b/pkg/compiler/lib/src/js_model/js_world_builder.dart
@@ -682,7 +682,8 @@
typedef _EntityConverter = Entity Function(Entity cls);
-class _TypeConverter implements DartTypeVisitor<DartType, _EntityConverter> {
+class _TypeConverter
+ implements DartTypeVisitor<DartType /*!*/, _EntityConverter> {
final DartTypes _dartTypes;
final bool allowFreeVariables;
@@ -779,8 +780,10 @@
if (result == null && allowFreeVariables) {
return type;
}
- assert(result != null,
- "Function type variable $type not found in $_functionTypeVariables");
+ if (result == null) {
+ throw failedAt(CURRENT_ELEMENT_SPANNABLE,
+ "Function type variable $type not found in $_functionTypeVariables");
+ }
return result;
}
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index 42536ed..f9af7ae 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -65,16 +65,16 @@
final Environment _environment;
final NativeBasicDataBuilder nativeBasicDataBuilder =
NativeBasicDataBuilder();
- NativeBasicData _nativeBasicData;
- KCommonElements /*!*/ _commonElements;
- KernelElementEnvironment _elementEnvironment;
- DartTypeConverter _typeConverter;
- KernelDartTypes _types;
- ir.CoreTypes _coreTypes;
- ir.TypeEnvironment _typeEnvironment;
- ir.ClassHierarchy _classHierarchy;
- Dart2jsConstantEvaluator _constantEvaluator;
- ConstantValuefier _constantValuefier;
+ NativeBasicData /*?*/ _nativeBasicData;
+ /*late final*/ KCommonElements /*!*/ _commonElements;
+ /*late final*/ KernelElementEnvironment /*!*/ _elementEnvironment;
+ /*late final*/ DartTypeConverter _typeConverter;
+ /*late final*/ KernelDartTypes /*!*/ _types;
+ ir.CoreTypes /*?*/ _coreTypes;
+ ir.TypeEnvironment /*?*/ _typeEnvironment;
+ ir.ClassHierarchy /*?*/ _classHierarchy;
+ Dart2jsConstantEvaluator /*?*/ _constantEvaluator;
+ /*late final*/ ConstantValuefier _constantValuefier;
/// Library environment. Used for fast lookup.
KProgramEnv env = KProgramEnv();
@@ -1657,7 +1657,7 @@
}
IndexedClass createClass(LibraryEntity library, String name,
- {bool isAbstract}) {
+ {/*required*/ bool isAbstract}) {
return KClass(library, name, isAbstract: isAbstract);
}
@@ -1668,7 +1668,7 @@
IndexedConstructor createGenerativeConstructor(ClassEntity enclosingClass,
Name name, ParameterStructure parameterStructure,
- {bool isExternal, bool isConst}) {
+ {/*required*/ bool isExternal, /*required*/ bool isConst}) {
return KGenerativeConstructor(enclosingClass, name, parameterStructure,
isExternal: isExternal, isConst: isConst);
}
@@ -1677,7 +1677,9 @@
// isEnvironmentConstructor: Here, and everywhere in the compiler.
IndexedConstructor createFactoryConstructor(ClassEntity enclosingClass,
Name name, ParameterStructure parameterStructure,
- {bool isExternal, bool isConst, bool isFromEnvironmentConstructor}) {
+ {/*required*/ bool isExternal,
+ /*required*/ bool isConst,
+ /*required*/ bool isFromEnvironmentConstructor}) {
return KFactoryConstructor(enclosingClass, name, parameterStructure,
isExternal: isExternal,
isConst: isConst,
diff --git a/pkg/compiler/lib/src/kernel/kelements.dart b/pkg/compiler/lib/src/kernel/kelements.dart
index bb67948..8f185cc 100644
--- a/pkg/compiler/lib/src/kernel/kelements.dart
+++ b/pkg/compiler/lib/src/kernel/kelements.dart
@@ -35,9 +35,9 @@
@override
final String name;
@override
- final bool isAbstract;
+ final bool /*!*/ isAbstract;
- KClass(this.library, this.name, {this.isAbstract});
+ KClass(this.library, this.name, {/*required*/ this.isAbstract});
@override
bool get isClosure => false;
@@ -166,7 +166,7 @@
class KFactoryConstructor extends KConstructor {
@override
- final bool isFromEnvironmentConstructor;
+ final bool /*!*/ isFromEnvironmentConstructor;
KFactoryConstructor(
KClass enclosingClass, Name name, ParameterStructure parameterStructure,
diff --git a/pkg/compiler/lib/src/serialization/source.dart b/pkg/compiler/lib/src/serialization/source.dart
index ed758d94..b796cc4 100644
--- a/pkg/compiler/lib/src/serialization/source.dart
+++ b/pkg/compiler/lib/src/serialization/source.dart
@@ -40,7 +40,7 @@
final DataSource _sourceReader;
static final List<ir.DartType> emptyListOfDartTypes =
- List<ir.DartType>.filled(0, null, growable: false);
+ List<ir.DartType>.empty();
final bool useDataKinds;
DataSourceIndices importedIndices;
@@ -123,7 +123,7 @@
ComponentLookup get componentLookup {
assert(_componentLookup != null);
- return _componentLookup;
+ return _componentLookup /*!*/;
}
/// Registers an [EntityLookup] object with this data source to support
@@ -135,7 +135,7 @@
EntityLookup get entityLookup {
assert(_entityLookup != null);
- return _entityLookup;
+ return _entityLookup /*!*/;
}
/// Registers an [EntityReader] with this data source for non-default encoding
@@ -153,7 +153,7 @@
LocalLookup get localLookup {
assert(_localLookup != null);
- return _localLookup;
+ return _localLookup /*!*/;
}
/// Registers a [CodegenReader] with this data source to support
@@ -263,7 +263,7 @@
return _readString();
}
- String _readString() {
+ String /*!*/ _readString() {
return _stringIndex.read(_sourceReader.readString);
}
@@ -287,7 +287,7 @@
List<String> readStrings({bool emptyAsNull = false}) {
int count = readInt();
if (count == 0 && emptyAsNull) return null;
- List<String> list = List<String>.filled(count, null);
+ List<String> list = List<String>.filled(count, '');
for (int i = 0; i < count; i++) {
list[i] = readString();
}
@@ -662,11 +662,7 @@
List<DartType> /*?*/ readDartTypesOrNull() {
int count = readInt();
if (count == 0) return null;
- List<DartType> list = List<DartType>.filled(count, null);
- for (int i = 0; i < count; i++) {
- list[i] = readDartType();
- }
- return list;
+ return List.generate(count, (_) => readDartType(), growable: false);
}
/// Reads a kernel type node from this data source. If [allowNull], the
@@ -800,7 +796,8 @@
List<ir.TypeParameter> functionTypeVariables) {
int count = readInt();
if (count == 0) return emptyListOfDartTypes;
- List<ir.DartType> types = List<ir.DartType>.filled(count, null);
+ List<ir.DartType> types =
+ List<ir.DartType>.filled(count, const ir.InvalidType());
for (int index = 0; index < count; index++) {
types[index] = _readDartTypeNode(functionTypeVariables);
}
diff --git a/pkg/compiler/lib/src/universe/call_structure.dart b/pkg/compiler/lib/src/universe/call_structure.dart
index e421377..84a10cb 100644
--- a/pkg/compiler/lib/src/universe/call_structure.dart
+++ b/pkg/compiler/lib/src/universe/call_structure.dart
@@ -87,7 +87,7 @@
factory CallStructure.readFromDataSource(DataSourceReader source) {
source.begin(tag);
int argumentCount = source.readInt();
- List<String> namedArguments = source.readStrings();
+ List<String> namedArguments = source.readStrings() /*!*/;
int typeArgumentCount = source.readInt();
source.end(tag);
return CallStructure(argumentCount, namedArguments, typeArgumentCount);
diff --git a/pkg/js/analysis_options.yaml b/pkg/js/analysis_options.yaml
index 21a6ace..ea5b6fd 100644
--- a/pkg/js/analysis_options.yaml
+++ b/pkg/js/analysis_options.yaml
@@ -1,4 +1,4 @@
-include: package:pedantic/analysis_options.yaml
+include: package:lints/recommended.yaml
analyzer:
language:
@@ -6,40 +6,5 @@
linter:
rules:
- - avoid_empty_else
- - avoid_init_to_null
- - avoid_null_checks_in_equality_operators
- - avoid_unused_constructor_parameters
- - await_only_futures
- - camel_case_types
- - cancel_subscriptions
- - constant_identifier_names
- - control_flow_in_finally
- - directives_ordering
- - empty_catches
- - empty_constructor_bodies
- - empty_statements
- - hash_and_equals
- - implementation_imports
- - iterable_contains_unrelated_type
- - library_names
- - library_prefixes
- - list_remove_unrelated_type
- - non_constant_identifier_names
- - overridden_fields
- - package_api_docs
- - package_names
- - package_prefixed_library_names
- - prefer_equal_for_default_values
- - prefer_final_fields
- - prefer_generic_function_type_aliases
- - prefer_is_not_empty
- - slash_for_doc_comments
- - test_types_in_equals
- - throw_in_finally
- - type_init_formals
- - unnecessary_brace_in_string_interps
- - unnecessary_const
- - unnecessary_new
- - unrelated_type_equality_checks
- - valid_regexps
+ # Ignore this lint (triggered by the annotation definitions in lib/js.dart).
+ library_private_types_in_public_api: false
diff --git a/pkg/js/pubspec.yaml b/pkg/js/pubspec.yaml
index 40fde9c..7452bb8 100644
--- a/pkg/js/pubspec.yaml
+++ b/pkg/js/pubspec.yaml
@@ -7,4 +7,4 @@
sdk: ">=2.16.0-100.0.dev <3.0.0"
dev_dependencies:
- pedantic: ^1.9.0
+ lints: any
diff --git a/pkg/vm_service/analysis_options.yaml b/pkg/vm_service/analysis_options.yaml
index 413f412..382a641 100644
--- a/pkg/vm_service/analysis_options.yaml
+++ b/pkg/vm_service/analysis_options.yaml
@@ -1,4 +1,4 @@
-include: package:pedantic/analysis_options.1.8.0.yaml
+include: package:lints/core.yaml
linter:
rules:
diff --git a/pkg/vm_service/example/vm_service_tester.dart b/pkg/vm_service/example/vm_service_tester.dart
index eb5158b..b5c1eae 100644
--- a/pkg/vm_service/example/vm_service_tester.dart
+++ b/pkg/vm_service/example/vm_service_tester.dart
@@ -10,7 +10,6 @@
import 'dart:io';
import 'package:path/path.dart' as path;
-import 'package:pedantic/pedantic.dart';
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart';
import 'package:vm_service/vm_service_io.dart';
@@ -109,7 +108,7 @@
VM vm = await serviceClient.getVM();
print('hostCPU=${vm.hostCPU}');
print(await serviceClient.getVersion());
- List<IsolateRef> isolates = await vm.isolates!;
+ List<IsolateRef> isolates = vm.isolates!;
print(isolates);
// Disable the json reserialization checks since custom services are not
diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml
index 7de79cf..9d8c47a 100644
--- a/pkg/vm_service/pubspec.yaml
+++ b/pkg/vm_service/pubspec.yaml
@@ -8,17 +8,17 @@
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service
environment:
- sdk: '>=2.12.0-0 <3.0.0'
+ sdk: '>=2.15.0 <3.0.0'
dependencies:
dev_dependencies:
async: ^2.5.0
expect: any
+ lints: any
markdown: ^4.0.0-nullsafety.0
mockito: ^5.0.0-nullsafety.1
path: ^1.8.0
- pedantic: ^1.10.0-nullsafety.3
process: ^4.0.0
pub_semver: ^2.0.0-nullsafety.0
test: ^1.16.0-nullsafety.13
diff --git a/pkg/vm_service/test/analysis_options.yaml b/pkg/vm_service/test/analysis_options.yaml
new file mode 100644
index 0000000..8984192
--- /dev/null
+++ b/pkg/vm_service/test/analysis_options.yaml
@@ -0,0 +1 @@
+# This options file exists to reset the settings from the parent directory.
diff --git a/pkg/vm_service/test/regress_43940_test.dart b/pkg/vm_service/test/regress_43940_test.dart
index 3a490f3..b7ba5ce 100644
--- a/pkg/vm_service/test/regress_43940_test.dart
+++ b/pkg/vm_service/test/regress_43940_test.dart
@@ -4,7 +4,6 @@
import 'dart:async';
-import 'package:pedantic/pedantic.dart';
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart';
diff --git a/pkg/vm_service/test/server_test.dart b/pkg/vm_service/test/server_test.dart
index 97b0aed..db0f7e8 100644
--- a/pkg/vm_service/test/server_test.dart
+++ b/pkg/vm_service/test/server_test.dart
@@ -10,7 +10,6 @@
import 'package:async/async.dart';
import 'package:mockito/mockito.dart';
-import 'package:pedantic/pedantic.dart';
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart';
diff --git a/tools/VERSION b/tools/VERSION
index 7097e6f..5cdf643 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 18
PATCH 0
-PRERELEASE 24
+PRERELEASE 25
PRERELEASE_PATCH 0
\ No newline at end of file