Migrate developer experience packages to new constructor decl syntax.

(Part of https://github.com/dart-lang/sdk/issues/63288)

This change migrates the packages owned by the developer experience
team to use the new constructor declaration syntax, described in
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

This change was performed in an automated fashion, by (a) bumping the
packages' SDK constraints to `3.13.0-0`, (b) enabling the lints
`unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor`, (c) fixing the resulting lint
failures using `dart fix`, and then (d) reformatting the affected
files.

To ease code review, I've reverted unrelated formatting changes.

Since this change requires bumping SDK constaints to `3.13.0-0`, it
was only performed on packages that are *not* published on
pub. (Packages that *are* published on pub should remain on lower
language versions until at least after the stable version of 3.13 is
released, so that we don't block users on the stable channel from
receiving updates to those packages.)

Change-Id: Ibb4daebafd239da58251e838ea6a3f336a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505046
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
This commit is contained in:
Paul Berry
2026-05-27 14:52:58 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 1e5aebc601
commit afcfbbeba8
1131 changed files with 2453 additions and 3287 deletions
@@ -21,6 +21,8 @@ analyzer:
linter:
rules:
- unnecessary_type_name_in_constructor
- unnecessary_const_in_enum_constructor
- avoid_bool_literals_in_conditional_expressions
- avoid_redundant_argument_values
- deprecated_member_use_from_same_package
+5 -10
View File
@@ -70,12 +70,7 @@ abstract class Benchmark {
/// One of 'memory', 'cpu', or 'group'.
final String kind;
Benchmark(
this.id,
this.description, {
this.enabled = true,
required this.kind,
});
new(this.id, this.description, {this.enabled = true, required this.kind});
int get maxIterations => 0;
@@ -108,7 +103,7 @@ class BenchMarkResult {
final int value;
BenchMarkResult(this.kindName, this.value);
new(this.kindName, this.value);
BenchMarkResult combine(BenchMarkResult other) {
return BenchMarkResult(kindName, math.min(value, other.value));
@@ -125,7 +120,7 @@ class CompoundBenchMarkResult extends BenchMarkResult {
Map<String, BenchMarkResult> results = {};
CompoundBenchMarkResult(this.name) : super('compound', 0);
new(this.name) : super('compound', 0);
void add(String name, BenchMarkResult result) {
results[name] = result;
@@ -171,7 +166,7 @@ abstract class FlutterBenchmark {
class ListCommand extends Command<void> {
final List<Benchmark> benchmarks;
ListCommand(this.benchmarks) {
new(this.benchmarks) {
argParser.addFlag(
'machine',
negatable: false,
@@ -206,7 +201,7 @@ class ListCommand extends Command<void> {
class RunCommand extends Command<void> {
final List<Benchmark> benchmarks;
RunCommand(this.benchmarks) {
new(this.benchmarks) {
argParser.addOption(
'dart-sdk',
help: 'The absolute normalized path of the Dart SDK.',
@@ -38,7 +38,7 @@ class Driver extends IntegrationTest {
/// The [Completer] for [runComplete].
final Completer<Results> _runCompleter = Completer<Results>();
Driver({this.diagnosticPort});
new({this.diagnosticPort});
/// Return a [Future] that completes with the [Results] of running
/// the analysis server once all operations have been performed.
@@ -126,7 +126,7 @@ class Measurement {
int errorCount = 0;
int unexpectedResultCount = 0;
Measurement(this.tag, this.notification);
new(this.tag, this.notification);
int get count => elapsedTimes.length;
@@ -54,7 +54,7 @@ abstract class CommonInputConverter extends Converter<String, Operation?> {
/// during performance measurement.
final String tmpSrcDirPath;
CommonInputConverter(this.tmpSrcDirPath, this.srcPathMap);
new(this.tmpSrcDirPath, this.srcPathMap);
Map<String, Object?> asMap(dynamic value) => value as Map<String, Object?>;
@@ -268,7 +268,7 @@ class InputConverter extends Converter<String, Operation?> {
/// or `false` if an exception has occurred.
bool _active = true;
InputConverter(this.tmpSrcDirPath, this.srcPathMap);
new(this.tmpSrcDirPath, this.srcPathMap);
@override
Operation? convert(String line) {
@@ -340,7 +340,7 @@ class PathMapEntry {
final String oldSrcPrefix;
final String newSrcPrefix;
PathMapEntry(this.oldSrcPrefix, this.newSrcPrefix);
new(this.oldSrcPrefix, this.newSrcPrefix);
String translate(String original) {
return original.startsWith(oldSrcPrefix)
@@ -353,7 +353,7 @@ class _InputSink implements ChunkedConversionSink<String> {
final Converter<String, Operation?> converter;
final Sink<Operation?> outSink;
_InputSink(this.converter, this.outSink);
new(this.converter, this.outSink);
@override
void add(String line) {
@@ -23,7 +23,7 @@ class InstrumentationInputConverter extends CommonInputConverter {
/// or `null` if not converting a "Read" entry.
StringBuffer? readBuffer;
InstrumentationInputConverter(super.tmpSrcDirPath, super.srcPathMap);
new(super.tmpSrcDirPath, super.srcPathMap);
@override
Operation? convert(String line) {
@@ -20,7 +20,7 @@ class LogFileInputConverter extends CommonInputConverter {
static final _nine = '9'.codeUnitAt(0);
static final _zero = '0'.codeUnitAt(0);
LogFileInputConverter(super.tmpSrcDirPath, super.srcPathMap);
new(super.tmpSrcDirPath, super.srcPathMap);
@override
Operation? convert(String line) {
@@ -20,7 +20,7 @@ class RequestOperation extends Operation {
final CommonInputConverter converter;
final Map<String, dynamic> json;
RequestOperation(this.converter, this.json);
new(this.converter, this.json);
@override
Future<void>? perform(Driver driver) {
@@ -71,7 +71,7 @@ class ResponseOperation extends Operation {
final Completer<void> completer = Completer();
late Driver driver;
ResponseOperation(this.converter, this.requestJson, this.responseJson) {
new(this.converter, this.requestJson, this.responseJson) {
completer.future.then(_processResult).timeout(responseTimeout);
}
@@ -18,7 +18,7 @@ import 'memory_tests.dart';
class AnalysisBenchmark extends Benchmark {
final AbstractBenchmarkTest Function() testConstructor;
AnalysisBenchmark(ServerBenchmark benchmarkTest)
new(ServerBenchmark benchmarkTest)
: testConstructor = benchmarkTest.testConstructor,
super(
benchmarkTest.id,
@@ -162,7 +162,7 @@ class AnalysisBenchmark extends Benchmark {
class ColdAnalysisBenchmark extends Benchmark {
final AbstractBenchmarkTest Function() testConstructor;
ColdAnalysisBenchmark(ServerBenchmark benchmarkTest)
new(ServerBenchmark benchmarkTest)
: testConstructor = benchmarkTest.testConstructor,
super(
'${benchmarkTest.id}-cold',
@@ -222,5 +222,5 @@ class ServerBenchmark {
final String name;
final AbstractBenchmarkTest Function() testConstructor;
ServerBenchmark(this.id, this.name, this.testConstructor);
new(this.id, this.name, this.testConstructor);
}
@@ -11,7 +11,7 @@ import '../benchmarks.dart';
import 'utils.dart';
abstract class AbstractCmdLineBenchmark extends Benchmark {
AbstractCmdLineBenchmark(super.id, super.description, {required super.kind});
new(super.id, super.description, {required super.kind});
@override
int get maxIterations => 3;
@@ -112,7 +112,7 @@ abstract class AbstractCmdLineBenchmark extends Benchmark {
}
class CmdLineOneProjectBenchmark extends AbstractCmdLineBenchmark {
CmdLineOneProjectBenchmark()
new()
: super(
'dart-analyze-one-project',
'Run dart analyze on one project with and without a cache',
@@ -128,7 +128,7 @@ class CmdLineOneProjectBenchmark extends AbstractCmdLineBenchmark {
}
class CmdLineSeveralProjectsBenchmark extends AbstractCmdLineBenchmark {
CmdLineSeveralProjectsBenchmark()
new()
: super(
'dart-analyze-several-projects',
'Run dart analyze on several projects with and without a cache',
@@ -155,7 +155,7 @@ class CmdLineSeveralProjectsBenchmark extends AbstractCmdLineBenchmark {
class CmdLineSmallFileBenchmark extends AbstractCmdLineBenchmark {
Directory? _tempDir;
CmdLineSmallFileBenchmark()
new()
: super(
'dart-analyze-small-file',
'Run dart analyze on a small file with and without a cache',
@@ -10,7 +10,7 @@ import 'utils.dart';
class FlutterAnalyzeBenchmark extends Benchmark implements FlutterBenchmark {
late final String flutterRepositoryPath;
FlutterAnalyzeBenchmark()
new()
: super(
'analysis-flutter-analyze',
'Clone the flutter/flutter repo and run '
@@ -25,7 +25,7 @@ class FlutterCompletionBenchmark extends Benchmark implements FlutterBenchmark {
late final String flutterRepositoryPath;
FlutterCompletionBenchmark(String protocolName, this.testConstructor)
new(String protocolName, this.testConstructor)
: super(
'$protocolName-flutter',
'Completion benchmarks with Flutter.',
@@ -276,7 +276,7 @@ class ServiceProtocol {
int _id = 0;
final Map<String, Completer<Map<Object?, Object?>>> _completers = {};
ServiceProtocol._(this.socket) {
new _(this.socket) {
socket.listen(_handleMessage);
}
@@ -185,7 +185,7 @@ class LspServerClient {
/// these whole line is used for this completer.
final Completer<String> _devToolsLineCompleter = Completer<String>();
LspServerClient(this.instrumentationService);
new(this.instrumentationService);
/// Completes with the DevTools URI line, maybe never.
Future<String> get devToolsLine => _devToolsLineCompleter.future;
@@ -262,7 +262,7 @@ class HierarchyResults {
/// Create a [HierarchyResults] object based on the result from a
/// getTypeHierarchy request.
HierarchyResults(this.items) : pivot = items[0] {
new(this.items) : pivot = items[0] {
for (var i = 0; i < items.length; i++) {
nameToIndex[items[i].classElement.name] = i;
}
@@ -15,7 +15,7 @@ class DtdProcess {
/// A completer for the DTD URI that is printed to stdout by the process.
final Completer<Uri> _dtdUriCompleter = Completer<Uri>();
DtdProcess._(this._proc) {
new _(this._proc) {
// Read output for the URI.
_proc.stdout.transform(utf8.decoder).transform(LineSplitter()).listen((
data,
@@ -390,7 +390,7 @@ class LazyMatcher implements Matcher {
/// Otherwise null.
Matcher? _wrappedMatcher;
LazyMatcher(this._creator);
new(this._creator);
/// Create the wrapped matcher object, if it hasn't been created already.
Matcher get _matcher {
@@ -431,7 +431,7 @@ class MatchesEnum extends Matcher {
/// The set of enum values that are allowed.
final List<String> allowedValues;
const MatchesEnum(this.description, this.allowedValues);
const new(this.description, this.allowedValues);
@override
Description describe(Description description) =>
@@ -457,11 +457,7 @@ class MatchesJsonObject extends _RecursiveMatcher {
/// their expected types.
final Map<String, Matcher>? optionalFields;
const MatchesJsonObject(
this.description,
this.requiredFields, {
this.optionalFields,
});
const new(this.description, this.requiredFields, {this.optionalFields});
@override
Description describe(Description description) =>
@@ -834,7 +830,7 @@ class Server {
class ServerErrorMessage {
final Map<Object?, Object?> message;
ServerErrorMessage(this.message);
new(this.message);
dynamic get error => message['error'];
@@ -851,7 +847,7 @@ class _ListOf extends Matcher {
/// Iterable matcher which we use to test the contents of the list.
final Matcher iterableMatcher;
_ListOf(this.elementMatcher) : iterableMatcher = everyElement(elementMatcher);
new(this.elementMatcher) : iterableMatcher = everyElement(elementMatcher);
@override
Description describe(Description description) =>
@@ -899,7 +895,7 @@ class _MapOf extends _RecursiveMatcher {
/// Matcher which every value in the map must satisfy.
final Matcher valueMatcher;
_MapOf(this.keyMatcher, this.valueMatcher);
new(this.keyMatcher, this.valueMatcher);
@override
Description describe(Description description) => description
@@ -939,7 +935,7 @@ class _OneOf extends Matcher {
/// Matchers for the individual choices.
final List<Matcher> choiceMatchers;
_OneOf(this.choiceMatchers);
new(this.choiceMatchers);
@override
Description describe(Description description) {
@@ -974,7 +970,7 @@ class _OneOf extends Matcher {
/// Base class for matchers that operate by recursing through the contents of
/// an object.
abstract class _RecursiveMatcher extends Matcher {
const _RecursiveMatcher();
const new();
/// Check the type of a substructure whose value is [item], using [matcher].
/// If it doesn't match, record a closure in [mismatches] which can describe
+31 -35
View File
@@ -34,10 +34,10 @@ class Notification {
/// Initialize a newly created [Notification] to have the given [event] name.
/// If [params] is provided, it will be used as the params; otherwise no
/// params will be used.
Notification(this.event, [this.params]);
new(this.event, [this.params]);
/// Initialize a newly created instance based on the given JSON data.
factory Notification.fromJson(Map<Object?, Object?> json) {
factory fromJson(Map<Object?, Object?> json) {
return Notification(
json[Notification.eventAttributeName] as String,
json[Notification.paramsAttributeName] as Map<String, Object?>?,
@@ -86,7 +86,7 @@ class Request extends RequestOrResponse {
/// Initialize a newly created [Request] to have the given [id] and [method]
/// name. If [params] is supplied, it is used as the "params" map for the
/// request. Otherwise an empty "params" map is allocated.
Request(
new(
this.id,
this.method, [
Map<String, Object?>? params,
@@ -221,7 +221,7 @@ class RequestFailure implements Exception {
final Response response;
/// Initialize a newly created exception to return the given response.
RequestFailure(this.response);
new(this.response);
}
/// An object that can handle requests and produce responses for them.
@@ -274,11 +274,11 @@ class Response extends RequestOrResponse {
/// with the given [id]. If [result] is provided, it will be used as the
/// result; otherwise an empty result will be used. If an [error] is provided
/// then the response will represent an error condition.
Response(this.id, {this.result, this.error});
new(this.id, {this.result, this.error});
/// Initialize a newly created instance to represent the CONTENT_MODIFIED
/// error condition.
Response.contentModified(Request request)
new contentModified(Request request)
: this(
request.id,
error: RequestError(
@@ -288,7 +288,7 @@ class Response extends RequestOrResponse {
);
/// Create and return the `DEBUG_PORT_COULD_NOT_BE_OPENED` error response.
Response.debugPortCouldNotBeOpened(Request request, Object? error)
new debugPortCouldNotBeOpened(Request request, Object? error)
: this(
request.id,
error: RequestError(
@@ -299,7 +299,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the FILE_NOT_ANALYZED
/// error condition.
Response.fileNotAnalyzed(Request request, String file)
new fileNotAnalyzed(Request request, String file)
: this(
request.id,
error: RequestError(
@@ -310,7 +310,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the FORMAT_INVALID_FILE
/// error condition.
Response.formatInvalidFile(Request request)
new formatInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -321,7 +321,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the FORMAT_WITH_ERROR
/// error condition.
Response.formatWithErrors(Request request)
new formatWithErrors(Request request)
: this(
request.id,
error: RequestError(
@@ -332,7 +332,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_ERRORS_INVALID_FILE error condition.
Response.getErrorsInvalidFile(Request request)
new getErrorsInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -343,7 +343,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_FIXES_INVALID_FILE error condition.
Response.getFixesInvalidFile(Request request)
new getFixesInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -354,7 +354,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_IMPORTED_ELEMENTS_INVALID_FILE error condition.
Response.getImportedElementsInvalidFile(Request request)
new getImportedElementsInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -365,7 +365,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_NAVIGATION_INVALID_FILE error condition.
Response.getNavigationInvalidFile(Request request)
new getNavigationInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -376,7 +376,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_REACHABLE_SOURCES_INVALID_FILE error condition.
Response.getReachableSourcesInvalidFile(Request request)
new getReachableSourcesInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -387,7 +387,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_SIGNATURE_INVALID_FILE error condition.
Response.getSignatureInvalidFile(Request request)
new getSignatureInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -398,7 +398,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_SIGNATURE_INVALID_OFFSET error condition.
Response.getSignatureInvalidOffset(Request request)
new getSignatureInvalidOffset(Request request)
: this(
request.id,
error: RequestError(
@@ -409,7 +409,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// GET_SIGNATURE_UNKNOWN_FUNCTION error condition.
Response.getSignatureUnknownFunction(Request request)
new getSignatureUnknownFunction(Request request)
: this(
request.id,
error: RequestError(
@@ -420,7 +420,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// IMPORT_ELEMENTS_INVALID_FILE error condition.
Response.importElementsInvalidFile(Request request)
new importElementsInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -432,7 +432,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent an error condition caused
/// by an analysis.reanalyze [request] that specifies an analysis root that is
/// not in the current list of analysis roots.
Response.invalidAnalysisRoot(Request request, String rootPath)
new invalidAnalysisRoot(Request request, String rootPath)
: this(
request.id,
error: RequestError(
@@ -444,7 +444,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent an error condition caused
/// by a [request] that specifies an execution context whose context root does
/// not exist.
Response.invalidExecutionContext(Request request, String contextId)
new invalidExecutionContext(Request request, String contextId)
: this(
request.id,
error: RequestError(
@@ -455,7 +455,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// INVALID_FILE_PATH_FORMAT error condition.
Response.invalidFilePathFormat(Request request, Object? path)
new invalidFilePathFormat(Request request, Object? path)
: this(
request.id,
error: RequestError(
@@ -469,7 +469,7 @@ class Response extends RequestOrResponse {
/// invalid parameter, in JavaScript notation (e.g. "foo.bar" means that the
/// parameter "foo" contained a key "bar" whose value was the wrong type).
/// [expectation] is a description of the type of data that was expected.
Response.invalidParameter(Request request, String path, String expectation)
new invalidParameter(Request request, String path, String expectation)
: this(
request.id,
error: RequestError(
@@ -480,7 +480,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent an error condition caused
/// by a malformed request.
Response.invalidRequestFormat()
new invalidRequestFormat()
: this(
'',
error: RequestError(
@@ -491,7 +491,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// ORGANIZE_DIRECTIVES_ERROR error condition.
Response.organizeDirectivesError(Request request, String message)
new organizeDirectivesError(Request request, String message)
: this(
request.id,
error: RequestError(
@@ -502,7 +502,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// REFACTORING_REQUEST_CANCELLED error condition.
Response.refactoringRequestCancelled(Request request)
new refactoringRequestCancelled(Request request)
: this(
request.id,
error: RequestError(
@@ -513,11 +513,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the SERVER_ERROR error
/// condition.
factory Response.serverError(
Request request,
Object? exception,
Object? stackTrace,
) {
factory serverError(Request request, Object? exception, Object? stackTrace) {
var error = RequestError(
RequestErrorCode.SERVER_ERROR,
exception.toString(),
@@ -530,7 +526,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// SORT_MEMBERS_INVALID_FILE error condition.
Response.sortMembersInvalidFile(Request request)
new sortMembersInvalidFile(Request request)
: this(
request.id,
error: RequestError(
@@ -541,7 +537,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent the
/// SORT_MEMBERS_PARSE_ERRORS error condition.
Response.sortMembersParseErrors(Request request, int numErrors)
new sortMembersParseErrors(Request request, int numErrors)
: this(
request.id,
error: RequestError(
@@ -552,7 +548,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent an error condition caused
/// by a [request] that cannot be handled by any known handlers.
Response.unknownRequest(Request request)
new unknownRequest(Request request)
: this(
request.id,
error: RequestError(
@@ -563,7 +559,7 @@ class Response extends RequestOrResponse {
/// Initialize a newly created instance to represent an error condition caused
/// by a [request] for a service that is not supported.
Response.unsupportedFeature(String requestId, String message)
new unsupportedFeature(String requestId, String message)
: this(
requestId,
error: RequestError(RequestErrorCode.UNSUPPORTED_FEATURE, message),
@@ -293,7 +293,7 @@ abstract class AnalysisServer {
/// temporary content.
bool suppressAnalysisResults = false;
AnalysisServer(
new(
this.options,
this.sdkManager,
this.diagnosticServer,
@@ -1211,7 +1211,7 @@ abstract class CommonServerContextManagerCallbacks
/// The set of files for which notifications were sent.
final Set<String> filesToFlush = {};
CommonServerContextManagerCallbacks(this.resourceProvider);
new(this.resourceProvider);
@override
@mustCallSuper
@@ -1323,7 +1323,7 @@ enum MessageType {
final lsp.MessageType forLsp;
final legacy.MessageType forLegacy;
const MessageType(this.forLsp, this.forLegacy);
new(this.forLsp, this.forLegacy);
}
class ServerRecentPerformance {
@@ -14,5 +14,5 @@ class ActiveRequestData {
final DateTime startTime;
/// Initialize a newly created data holder.
ActiveRequestData(this.method, this.clientRequestTime, this.startTime);
new(this.method, this.clientRequestTime, this.startTime);
}
@@ -102,7 +102,7 @@ class AnalyticsManager {
/// Initialize a newly created analytics manager to report to the [analytics]
/// service.
AnalyticsManager(this.analytics) {
new(this.analytics) {
if (analytics is! NoOpAnalytics) {
periodicTimer = Timer.periodic(Duration(minutes: 30), (_) {
_sendPeriodicData();
@@ -63,7 +63,7 @@ class ContextStructure {
final PercentileCalculator libraryCycleLineCounts;
/// Initialize a newly created data holder.
ContextStructure({
new({
required this.numberOfContexts,
required this.immediateFileCount,
required this.immediateFileLineCount,
@@ -22,5 +22,5 @@ class NotificationData {
/// Initialize a newly create data holder for notifications with the given
/// [method].
NotificationData(this.method);
new(this.method);
}
@@ -15,9 +15,9 @@ class PercentileCalculator {
int _valueCount = 0;
/// Initialize a newly created percentile calculator.
PercentileCalculator();
new();
factory PercentileCalculator.from(List<int> values) {
factory from(List<int> values) {
var calculator = PercentileCalculator();
for (var value in values) {
calculator.addValue(value);
@@ -110,7 +110,7 @@ class PluginDataPerIsolate {
/// are registered in each plugin.
PercentileCalculator assistCounts = PercentileCalculator();
PluginDataPerIsolate({required this.pluginCount});
new({required this.pluginCount});
}
extension on String {
@@ -32,7 +32,7 @@ class RequestData {
/// Initialize a newly create data holder for requests with the given
/// [method].
RequestData(this.method);
new(this.method);
/// Record the occurrence of the enum constant with the given [enumName] for
/// the field with the given [name].
@@ -71,7 +71,7 @@ class AnalyticsAnalysisWorkingStatistics {
final Map<RequirementFailureKindId, int>
libraryDiagnosticsBundleRequirementsFailures = {};
AnalyticsAnalysisWorkingStatistics({required this.withFineDependencies});
new({required this.withFineDependencies});
void append(AnalysisStatusWorkingStatistics statistics) {
uniqueChangedFiles.addAll(statistics.changedFiles);
@@ -134,7 +134,7 @@ class SessionData {
final String clientVersion;
/// Initialize a newly created data holder.
SessionData({
new({
required this.startTime,
required this.commandLineArguments,
required this.clientId,
@@ -26,7 +26,7 @@ class ByteStreamClientChannel implements ClientCommunicationChannel {
@override
Stream<Notification> notificationStream;
factory ByteStreamClientChannel(Stream<List<int>> input, IOSink output) {
factory(Stream<List<int>> input, IOSink output) {
var jsonStream = input
.transform(const Utf8Decoder())
.transform(LineSplitter())
@@ -51,11 +51,7 @@ class ByteStreamClientChannel implements ClientCommunicationChannel {
);
}
ByteStreamClientChannel._(
this.output,
this.responseStream,
this.notificationStream,
);
new _(this.output, this.responseStream, this.notificationStream);
@override
Future<void> close() {
@@ -102,7 +98,7 @@ abstract class ByteStreamServerChannel implements ServerCommunicationChannel {
),
);
ByteStreamServerChannel(
new(
this._instrumentationService,
this._sessionLogger, {
this._requestStatistics,
@@ -258,7 +254,7 @@ class InputOutputByteStreamServerChannel extends ByteStreamServerChannel {
.transform(const Utf8Decoder())
.transform(const LineSplitter());
InputOutputByteStreamServerChannel(
new(
this._input,
this._output,
super._instrumentationService,
@@ -281,7 +277,7 @@ class StdinStdoutLineStreamServerChannel extends ByteStreamServerChannel {
@override
late final Stream<String> _lines = _linesFromIsolate.cast();
StdinStdoutLineStreamServerChannel(
new(
super._instrumentationService,
super._sessionLogger, {
super.requestStatistics,
@@ -23,7 +23,7 @@ class ChannelChunkSink<S, T> implements ChunkedConversionSink<S> {
/// Initialize a newly create sink to use the given [converter] to convert
/// chunks before adding them to the given [sink].
ChannelChunkSink(this.converter, this.sink);
new(this.converter, this.sink);
@override
void add(S chunk) {
@@ -15,7 +15,7 @@ class CiderAssistsComputer {
final PerformanceLog _logger;
final FileResolver _fileResolver;
CiderAssistsComputer(this._logger, this._fileResolver);
new(this._logger, this._fileResolver);
/// Compute quick assists on the line and character position.
Future<List<Assist>> compute(
@@ -40,7 +40,7 @@ class CiderCompletionComputer {
@visibleForTesting
final List<String> computedImportedLibraries = [];
CiderCompletionComputer(this._logger, this._cache, this._fileResolver);
new(this._logger, this._cache, this._fileResolver);
/// Return completion suggestions for the file and position.
///
@@ -232,7 +232,7 @@ class CiderCompletionPerformance {
/// The tree of operation performances.
final OperationPerformance operations;
CiderCompletionPerformance._({required this.operations});
new _({required this.operations});
}
class CiderCompletionResult {
@@ -245,7 +245,7 @@ class CiderCompletionResult {
/// completion request.
final CiderPosition prefixStart;
CiderCompletionResult._({
new _({
required this.suggestions,
required this.performance,
required this.prefixStart,
@@ -256,12 +256,12 @@ class CiderPosition {
final int line;
final int column;
CiderPosition(this.line, this.column);
new(this.line, this.column);
}
class _CiderImportedLibrarySuggestions {
final String signature;
final List<CompletionSuggestionBuilder> suggestionBuilders;
_CiderImportedLibrarySuggestions(this.signature, this.suggestionBuilders);
new(this.signature, this.suggestionBuilders);
}
@@ -13,7 +13,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class CiderDocumentSymbolsComputer {
final FileResolver _fileResolver;
CiderDocumentSymbolsComputer(this._fileResolver);
new(this._fileResolver);
Future<List<DocumentSymbol>> compute2(String filePath) async {
var result = <DocumentSymbol>[];
+3 -7
View File
@@ -23,18 +23,14 @@ class CiderErrorFixes {
final LineInfo lineInfo;
CiderErrorFixes({
required this.diagnostic,
required this.fixes,
required this.lineInfo,
});
new({required this.diagnostic, required this.fixes, required this.lineInfo});
}
class CiderFixesComputer {
final PerformanceLog _logger;
final FileResolver _fileResolver;
CiderFixesComputer(this._logger, this._fileResolver);
new(this._logger, this._fileResolver);
/// Compute quick fixes for errors on the line at [lineNumber].
Future<List<CiderErrorFixes>> compute(String path, int lineNumber) async {
@@ -78,7 +74,7 @@ class CiderFixesComputer {
class _CiderDartFixContextImpl extends DartFixContext {
final FileResolver _fileResolver;
_CiderDartFixContextImpl(
new(
this._fileResolver, {
required super.workspace,
required super.libraryResult,
@@ -31,7 +31,7 @@ class LibraryElementSuggestionBuilder
/// The set of libraries that have been, or are currently being, visited.
final Set<LibraryElement> visitedLibraries = <LibraryElement>{};
factory LibraryElementSuggestionBuilder(
factory(
DartCompletionRequest request,
SuggestionBuilder builder, [
String? prefix,
@@ -49,13 +49,7 @@ class LibraryElementSuggestionBuilder
);
}
LibraryElementSuggestionBuilder._(
this.request,
this.builder,
this.opType,
this.kind,
this.prefix,
);
new _(this.request, this.builder, this.opType, this.kind, this.prefix);
@override
void visitClassElement(ClassElement element) {
@@ -27,7 +27,7 @@ class CanRenameResponse {
FlutterWidgetState? _flutterWidgetState;
CanRenameResponse(
new(
this.lineInfo,
this.refactoringElement,
this._fileResolver,
@@ -117,7 +117,7 @@ class CheckNameResponse {
final CanRenameResponse canRename;
final String newName;
CheckNameResponse(this.status, this.canRename, this.newName);
new(this.status, this.canRename, this.newName);
LineInfo get lineInfo => canRename.lineInfo;
@@ -428,7 +428,7 @@ class CheckNameResponse {
class CiderRenameComputer {
final FileResolver _fileResolver;
CiderRenameComputer(this._fileResolver);
new(this._fileResolver);
/// Check if the identifier at the [line], [column] for the file at the
/// [filePath] can be renamed.
@@ -490,7 +490,7 @@ class CiderReplaceMatch {
final String path;
List<ReplaceInfo> matches;
CiderReplaceMatch(this.path, this.matches);
new(this.path, this.matches);
}
class FlutterWidgetRename {
@@ -501,7 +501,7 @@ class FlutterWidgetRename {
final List<CiderSearchMatch> matches;
final List<CiderReplaceMatch> replacements;
FlutterWidgetRename(this.name, this.matches, this.replacements);
new(this.name, this.matches, this.replacements);
}
/// The corresponding `State` declaration of a Flutter `StatefulWidget`.
@@ -509,7 +509,7 @@ class FlutterWidgetState {
ClassElement state;
String newName;
FlutterWidgetState(this.state, this.newName);
new(this.state, this.newName);
}
class RenameResponse {
@@ -521,7 +521,7 @@ class RenameResponse {
final List<CiderReplaceMatch> replaceMatches;
FlutterWidgetRename? flutterWidgetRename;
RenameResponse(
new(
this.matches,
this.checkName,
this.replaceMatches, {
@@ -534,7 +534,7 @@ class ReplaceInfo {
final CharacterLocation startPosition;
final int length;
ReplaceInfo(this.replacementText, this.startPosition, this.length);
new(this.replacementText, this.startPosition, this.length);
@override
int get hashCode => Object.hash(replacementText, startPosition, length);
@@ -13,7 +13,7 @@ import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
class CiderSignatureHelpComputer {
final FileResolver _fileResolver;
CiderSignatureHelpComputer(this._fileResolver);
new(this._fileResolver);
Future<SignatureHelpResponse?> compute2(
String filePath,
@@ -67,5 +67,5 @@ class SignatureHelpResponse {
/// The location of the left parenthesis.
final CharacterLocation callStart;
SignatureHelpResponse(this.signatureHelp, this.callStart);
new(this.signatureHelp, this.callStart);
}
+1 -1
View File
@@ -21,7 +21,7 @@ class RecentBuffer<T> {
final Queue<T> _buffer;
RecentBuffer(this.capacity) : _buffer = Queue();
new(this.capacity) : _buffer = Queue();
Iterable<T> get items => _buffer;
@@ -55,7 +55,7 @@ class CallHierarchyCalls {
final CallHierarchyItem item;
final List<SourceRange> ranges = [];
CallHierarchyCalls(this.item);
new(this.item);
}
/// An item that can appear in a Call Hierarchy.
@@ -92,7 +92,7 @@ class CallHierarchyItem {
/// The range of the code for the declaration of this item.
final SourceRange codeRange;
CallHierarchyItem({
new({
required this.displayName,
required this.containerName,
required this.kind,
@@ -101,7 +101,7 @@ class CallHierarchyItem {
required this.codeRange,
});
CallHierarchyItem.forElement(Element element)
new forElement(Element element)
: displayName = _getDisplayName(element),
nameRange = _nameRangeForElement(element),
codeRange = _codeRangeForElement(element),
@@ -210,7 +210,7 @@ enum CallHierarchyKind {
class DartCallHierarchyComputer {
final ResolvedUnitResult _result;
DartCallHierarchyComputer(this._result);
new(this._result);
/// Finds incoming calls to [target], returning the elements that call them
/// and ranges of those calls within.
@@ -483,7 +483,7 @@ class _OutboundCallVisitor extends RecursiveAstVisitor<void> {
final AstNode root;
final void Function(AstNode) collect;
_OutboundCallVisitor(this.root, this.collect);
new(this.root, this.collect);
@override
void visitConstructorName(ConstructorName node) {
@@ -16,7 +16,7 @@ class DartUnitClosingLabelsComputer {
final Set<ClosingLabel> hasNestingSet = {};
final Set<ClosingLabel> isSingleLineSet = {};
DartUnitClosingLabelsComputer(this._lineInfo, this._unit);
new(this._lineInfo, this._unit);
/// Returns a list of closing labels, not `null`.
List<ClosingLabel> compute() {
@@ -45,7 +45,7 @@ class _DartUnitClosingLabelsComputerVisitor extends RecursiveAstVisitor<void> {
int interpolatedStringsEntered = 0;
List<ClosingLabel> labelStack = [];
_DartUnitClosingLabelsComputerVisitor(this.computer);
new(this.computer);
ClosingLabel? get _currentLabel =>
labelStack.isEmpty ? null : labelStack.last;
@@ -18,7 +18,7 @@ class ColorComputer {
final ResolvedUnitResult resolvedUnit;
final List<ColorReference> _colors = [];
ColorComputer(this.resolvedUnit, path.Context pathContext);
new(this.resolvedUnit, path.Context pathContext);
/// Returns information about the color references in [resolvedUnit].
///
@@ -326,7 +326,7 @@ class ColorInformation {
/// Blue as a value from 0 to 255.
final int blue;
ColorInformation(this.alpha, this.red, this.green, this.blue);
new(this.alpha, this.red, this.green, this.blue);
}
/// Information about a specific known location of a [ColorInformation]
@@ -336,13 +336,13 @@ class ColorReference {
final int length;
final ColorInformation color;
ColorReference(this.offset, this.length, this.color);
new(this.offset, this.length, this.color);
}
class _ColorBuilder extends RecursiveAstVisitor<void> {
final ColorComputer computer;
_ColorBuilder(this.computer);
new(this.computer);
@override
void visitDotShorthandConstructorInvocation(
@@ -17,7 +17,7 @@ import 'package:analyzer/src/utilities/extensions/collection.dart';
class DartDocumentHighlightsComputer {
final CompilationUnit _unit;
DartDocumentHighlightsComputer(this._unit);
new(this._unit);
/// Computes matching highlight tokens for the requested offset.
List<({Token token, DocumentHighlightKind kind})> compute(
@@ -163,7 +163,7 @@ class _DartDocumentHighlightsVisitor extends GeneralizingAstVisitor<void> {
/// Stack to track the current function for return/yield keywords.
final List<AstNode> _functionStack = [];
_DartDocumentHighlightsVisitor(this._target);
new(this._target);
@override
void visitAssignedVariablePattern(AssignedVariablePattern node) {
@@ -519,13 +519,13 @@ class _HighlightTargets {
final Set<String> _targetElementNames;
final AstNode? _targetNode;
_HighlightTargets.elements(this._targetElements)
new elements(this._targetElements)
: _targetNode = null,
_targetElementNames = {
for (var element in _targetElements) ?element.name,
};
_HighlightTargets.node(this._targetNode)
new node(this._targetNode)
: _targetElements = const {},
_targetElementNames = const {};
@@ -10,7 +10,7 @@ import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
class DartDocumentationComputer {
final DartdocDirectiveInfo dartdocInfo;
DartDocumentationComputer(this.dartdocInfo);
new(this.dartdocInfo);
Documentation? compute(
Element elementBeingDocumented, {
@@ -22,7 +22,7 @@ class DartUnitFoldingComputer {
/// editors typically only show one folding action button per line.
final _linesWithRegions = <int>{};
DartUnitFoldingComputer(this._lineInfo, this._unit);
new(this._lineInfo, this._unit);
void addRegionForConditionalBlock(Block block) {
// For class/function/method blocks, we usually include the whitespace up
@@ -230,7 +230,7 @@ class DartUnitFoldingComputer {
class _DartUnitFoldingComputerVisitor extends RecursiveAstVisitor<void> {
final DartUnitFoldingComputer _computer;
_DartUnitFoldingComputerVisitor(this._computer);
new(this._computer);
@override
void visitArgumentList(ArgumentList node) {
@@ -571,7 +571,7 @@ class _Directive {
final Directive directive;
final Token keyword;
_Directive(this.directive, this.keyword);
new(this.directive, this.keyword);
}
extension _CommentTokenExtensions on Token {
@@ -46,7 +46,7 @@ class DartUnitHighlightsComputer {
///
/// If [range] is supplied, tokens outside of this range will not be included
/// in results.
DartUnitHighlightsComputer(this._unit, {this.range});
new(this._unit, {this.range});
/// Returns the computed highlight regions, not `null`.
List<HighlightRegion> compute() {
@@ -736,7 +736,7 @@ class DartUnitHighlightsComputer {
class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor<void> {
final DartUnitHighlightsComputer computer;
_DartUnitHighlightsComputerVisitor(this.computer);
new(this.computer);
@override
void visitAnnotation(Annotation node) {
@@ -25,7 +25,7 @@ class DartUnitHoverComputer {
final DocumentationPreference documentationPreference;
final DartDocumentationComputer _documentationComputer;
DartUnitHoverComputer(
new(
DartdocDirectiveInfo dartdocInfo,
this._unit,
this._offset, {
@@ -28,7 +28,7 @@ class DartInlayHintComputer {
final List<InlayHint> _hints = [];
final LspClientInlayHintsConfiguration _config;
DartInlayHintComputer(
new(
this.pathContext,
ResolvedUnitResult result, [
// This parameter is optional because this class is used internally
@@ -332,7 +332,7 @@ class DartInlayHintComputer {
class _DartInlayHintComputerVisitor extends GeneralizingAstVisitor<void> {
final DartInlayHintComputer _computer;
_DartInlayHintComputerVisitor(this._computer);
new(this._computer);
@override
void visitArgumentList(ArgumentList node) {
@@ -33,7 +33,7 @@ import 'package:analyzer/src/dart/element/element.dart';
class DartLazyTypeHierarchyComputer {
final ResolvedUnitResult _result;
DartLazyTypeHierarchyComputer(this._result);
new(this._result);
/// Finds subtypes for the [Element] at [location].
Future<List<TypeHierarchyRelatedItem>?> findSubtypes(
@@ -163,7 +163,7 @@ class TypeHierarchyAnchor {
/// The supertype path from [location] to the target element.
final List<int> path;
TypeHierarchyAnchor({required this.location, required this.path});
new({required this.location, required this.path});
}
/// An item that can appear in a Type Hierarchy.
@@ -191,7 +191,7 @@ class TypeHierarchyItem {
/// The range of the code for the declaration of this item.
final SourceRange codeRange;
TypeHierarchyItem({
new({
required this.displayName,
required this.location,
required this.file,
@@ -200,14 +200,12 @@ class TypeHierarchyItem {
required this.codeRange,
});
TypeHierarchyItem._forElement({
required InterfaceElement element,
required this.location,
}) : displayName = _displayNameForElement(element),
nameRange = _nameRangeForElement(element),
codeRange = _codeRangeForElement(element),
file = element.firstFragment.libraryFragment.source.fullName,
lineInfo = element.firstFragment.libraryFragment.lineInfo;
new _forElement({required InterfaceElement element, required this.location})
: displayName = _displayNameForElement(element),
nameRange = _nameRangeForElement(element),
codeRange = _codeRangeForElement(element),
file = element.firstFragment.libraryFragment.source.fullName,
lineInfo = element.firstFragment.libraryFragment.lineInfo;
static TypeHierarchyItem? forElement(InterfaceElement element) {
var location = ElementLocation.forElement(element);
@@ -254,7 +252,7 @@ class TypeHierarchyRelatedItem extends TypeHierarchyItem {
/// The relationship this item has with the target item.
final TypeHierarchyItemRelationship relationship;
TypeHierarchyRelatedItem.forElement({
new forElement({
required super.element,
required this.relationship,
required super.location,
@@ -16,7 +16,7 @@ class DartUnitOutlineComputer {
final ResolvedUnitResult resolvedUnit;
final bool withBasicFlutter;
DartUnitOutlineComputer(this.resolvedUnit, {this.withBasicFlutter = false});
new(this.resolvedUnit, {this.withBasicFlutter = false});
/// Returns the computed outline, not `null`.
Outline compute() {
@@ -672,7 +672,7 @@ class _FunctionBodyOutlinesVisitor extends RecursiveAstVisitor<void> {
final DartUnitOutlineComputer outlineComputer;
final List<Outline> contents;
_FunctionBodyOutlinesVisitor(this.outlineComputer, this.contents);
new(this.outlineComputer, this.contents);
/// Return `true` if the given [element] is the method 'group' defined in the
/// test package.
@@ -22,7 +22,7 @@ class DartUnitOverridesComputer {
final CompilationUnit _unit;
final List<proto.Override> _overrides = <proto.Override>[];
DartUnitOverridesComputer(this._unit);
new(this._unit);
/// Returns the computed occurrences, not `null`.
List<proto.Override> compute() {
@@ -105,7 +105,7 @@ class OverriddenElements {
/// which is implemented by the class that defines [element].
final List<Element> interfaceElements;
OverriddenElements(this.element, this.superElements, this.interfaceElements);
new(this.element, this.superElements, this.interfaceElements);
}
class _OverriddenElementsFinder {
@@ -119,7 +119,7 @@ class _OverriddenElementsFinder {
final List<Element> _interfaceElements = <Element>[];
final Set<InterfaceElement> _visited = {};
factory _OverriddenElementsFinder(Element seed) {
factory(Element seed) {
var class_ = seed.enclosingElement as InterfaceElement;
var library = class_.library;
var name = seed.displayName;
@@ -138,13 +138,7 @@ class _OverriddenElementsFinder {
return _OverriddenElementsFinder._(seed, library, class_, name, kinds);
}
_OverriddenElementsFinder._(
this._seed,
this._library,
this._class,
this._name,
this._kinds,
);
new _(this._seed, this._library, this._class, this._name, this._kinds);
/// Add the [OverriddenElements] for this element.
OverriddenElements find() {
@@ -13,7 +13,7 @@ class DartSelectionRangeComputer {
final int _offset;
final _selectionRanges = <SelectionRange>[];
DartSelectionRangeComputer(this._unit, this._offset);
new(this._unit, this._offset);
/// Returns selection ranges for nodes containing [_offset], starting with the
/// closest working up to the outer-most node.
@@ -98,5 +98,5 @@ class SelectionRange {
final int offset;
final int length;
SelectionRange(this.offset, this.length);
new(this.offset, this.length);
}
@@ -19,7 +19,7 @@ class DartUnitSignatureComputer {
final DocumentationPreference documentationPreference;
final DartDocumentationComputer _documentationComputer;
DartUnitSignatureComputer(
new(
DartdocDirectiveInfo dartdocInfo,
CompilationUnit unit,
this._offset, {
@@ -162,7 +162,7 @@ class SignatureInformation {
/// name will not be returned.
final int? activeParameterIndex;
SignatureInformation({
new({
required this.name,
required this.parameters,
required this.argumentList,
@@ -21,7 +21,7 @@ class DartTypeArgumentsSignatureComputer {
final DocumentationPreference documentationPreference;
final DartDocumentationComputer _documentationComputer;
DartTypeArgumentsSignatureComputer(
new(
DartdocDirectiveInfo dartdocInfo,
CompilationUnit unit,
int offset,
@@ -26,7 +26,7 @@ class ImportElementsComputer {
final ResolvedUnitResult libraryResult;
/// Initialize a newly created builder.
ImportElementsComputer(this.resourceProvider, this.libraryResult);
new(this.resourceProvider, this.libraryResult);
/// Creates the edits that will cause the list of [importedElementsList] to be
/// imported into the library.
@@ -402,7 +402,7 @@ class _ImportUpdate {
/// Initialize a newly created information holder to hold information about
/// updates to the given [import].
_ImportUpdate(this.import);
new(this.import);
/// Record that the given [name] needs to be added to show combinators.
void show(String name) {
@@ -420,7 +420,7 @@ class _InsertionDescription {
final int offset;
final int newLinesAfter;
_InsertionDescription(this.offset, {int before = 0, int after = 0})
new(this.offset, {int before = 0, int after = 0})
: newLinesBefore = before,
newLinesAfter = after;
}
@@ -24,7 +24,7 @@ class ImportedElementsComputer {
/// Initialize a newly created computer to compute the list of imported
/// elements referenced in the given [unit] within the region with the given
/// [offset] and [length].
ImportedElementsComputer(this.unit, this.offset, this.length);
new(this.unit, this.offset, this.length);
/// Compute and return the list of imported elements.
List<ImportedElements> compute() {
@@ -65,7 +65,7 @@ class _Visitor extends UnifyingAstVisitor<void> {
/// Initialize a newly created visitor to visit nodes within a specified
/// portion.
_Visitor(this.startOffset, this.endOffset);
new(this.startOffset, this.endOffset);
@override
void visitNamedType(NamedType node) {
@@ -271,7 +271,7 @@ class ContextManagerImpl implements ContextManager {
/// rebuild and wait for it to terminate before starting the next.
final _CancellingTaskQueue _currentContextRebuild = _CancellingTaskQueue();
ContextManagerImpl(
new(
this.resourceProvider,
this.sdkManager,
this.packageConfigFile,
@@ -1027,7 +1027,7 @@ class NoopContextManagerCallbacks implements ContextManagerCallbacks {
class _BlazeWatchedFiles {
final String workspace;
final paths = <String>{};
_BlazeWatchedFiles(this.workspace);
new(this.workspace);
}
/// Handles a task queue of tasks that cannot run concurrently.
@@ -15,7 +15,7 @@ class ImplementedComputer {
Set<String>? subtypeMembers;
ImplementedComputer(this.searchEngine, this.unitElement);
new(this.searchEngine, this.unitElement);
Future<void> compute() async {
for (var fragment in unitElement.classes) {
@@ -18,7 +18,7 @@ class FlutterOutlineComputer {
final List<protocol.FlutterOutline> _depthFirstOrder = [];
FlutterOutlineComputer(this.resolvedUnit);
new(this.resolvedUnit);
protocol.FlutterOutline compute() {
var dartOutline = DartUnitOutlineComputer(resolvedUnit).compute();
@@ -282,7 +282,7 @@ class _FlutterOutlineBuilder extends GeneralizingAstVisitor<void> {
final FlutterOutlineComputer computer;
final List<protocol.FlutterOutline> outlines = [];
_FlutterOutlineBuilder(this.computer);
new(this.computer);
@override
void visitExpression(Expression node) {
+3 -3
View File
@@ -37,7 +37,7 @@ class LintFixTester {
/// not be allowed.
bool _canUpdateResourceProvider = true;
LintFixTester({
new({
required ResourceProvider resourceProvider,
required this.sdkPath,
required this.packageConfigPath,
@@ -140,7 +140,7 @@ class LintFixTesterWithFixes {
final LintFixTester _parent;
final List<Fix> fixes;
LintFixTesterWithFixes({required this._parent, required this.fixes});
new({required this._parent, required this.fixes});
void assertNoFixes() {
if (fixes.isNotEmpty) {
@@ -161,7 +161,7 @@ class LintFixTesterWithSingleFix {
final LintFixTesterWithFixes _parent;
final Fix fix;
LintFixTesterWithSingleFix({required this._parent, required this.fix});
new({required this._parent, required this.fix});
void assertFixedContentOfFile({
required String path,
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/protocol_server.dart';
class AnalysisGetErrorsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisGetErrorsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -14,12 +14,7 @@ import 'package:analyzer/dart/analysis/results.dart';
class AnalysisGetHoverHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisGetHoverHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -14,12 +14,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalysisGetImportedElementsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisGetImportedElementsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -20,12 +20,7 @@ class AnalysisGetNavigationHandler extends LegacyHandler
with RequestHandlerMixin<LegacyAnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisGetNavigationHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -13,12 +13,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalysisGetSignatureHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisGetSignatureHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalysisReanalyzeHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisReanalyzeHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -14,12 +14,7 @@ import 'package:analysis_server/src/utilities/extensions/resource_provider.dart'
class AnalysisSetAnalysisRootsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisSetAnalysisRootsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalysisSetGeneralSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisSetGeneralSubscriptionsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -14,12 +14,7 @@ import 'package:analysis_server/src/utilities/extensions/resource_provider.dart'
class AnalysisSetPriorityFilesHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisSetPriorityFilesHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -15,12 +15,7 @@ import 'package:analysis_server/src/utilities/extensions/resource_provider.dart'
class AnalysisSetSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisSetSubscriptionsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -14,12 +14,7 @@ import 'package:analysis_server/src/utilities/extensions/resource_provider.dart'
class AnalysisUpdateContentHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisUpdateContentHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -13,12 +13,7 @@ import 'package:analyzer/src/dart/analysis/analysis_options.dart';
class AnalysisUpdateOptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalysisUpdateOptionsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalyticsEnableHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalyticsEnableHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalyticsIsEnabledHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalyticsIsEnabledHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalyticsSendEventHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalyticsSendEventHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class AnalyticsSendTimingHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
AnalyticsSendTimingHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -18,12 +18,7 @@ class CompletionGetSuggestionDetails2Handler extends CompletionHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
CompletionGetSuggestionDetails2Handler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -25,12 +25,7 @@ class CompletionGetSuggestions2Handler extends CompletionHandler
with RequestHandlerMixin<LegacyAnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
CompletionGetSuggestions2Handler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
/// Computes completion results for [request] and append them to the stream.
///
@@ -800,7 +800,7 @@ class _ParameterData {
bool? hasNamedParameters;
CompletionDefaultArgumentList? defaultArgumentList;
_ParameterData(
new(
this.parameterNames,
this.parameterTypes,
this.requiredParameterCount,
@@ -12,12 +12,7 @@ import 'package:analyzer/src/dart/analysis/driver.dart';
class DiagnosticGetDiagnosticsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
DiagnosticGetDiagnosticsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -12,12 +12,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class DiagnosticGetServerPortHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
DiagnosticGetServerPortHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -17,12 +17,7 @@ import 'package:analyzer/src/lint/registry.dart';
class EditBulkFixes extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditBulkFixes(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -16,12 +16,7 @@ import 'package:dart_style/dart_style.dart' hide TrailingCommas;
class EditFormatHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditFormatHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -20,12 +20,7 @@ import 'package:pub_semver/pub_semver.dart';
class EditFormatIfEnabledHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditFormatIfEnabledHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
/// Format the given [file] with the given [languageVersion].
///
@@ -25,12 +25,7 @@ class EditGetAssistsHandler extends LegacyHandler
with RequestHandlerMixin<LegacyAnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditGetAssistsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -15,12 +15,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class EditGetAvailableRefactoringsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditGetAvailableRefactoringsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -38,12 +38,7 @@ class EditGetFixesHandler extends LegacyHandler
with RequestHandlerMixin<LegacyAnalysisServer> {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditGetFixesHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -13,12 +13,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class EditGetPostfixCompletionHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditGetPostfixCompletionHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -12,12 +12,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class EditGetRefactoringHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditGetRefactoringHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -13,12 +13,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class EditGetStatementCompletionHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditGetStatementCompletionHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -13,12 +13,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class EditImportElementsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditImportElementsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -12,12 +12,7 @@ import 'package:analysis_server/src/services/completion/postfix/postfix_completi
class EditIsPostfixCompletionApplicableHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditIsPostfixCompletionApplicableHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -17,12 +17,7 @@ class EditListPostfixCompletionTemplatesHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditListPostfixCompletionTemplatesHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -15,12 +15,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class EditOrganizeDirectivesHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditOrganizeDirectivesHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -15,12 +15,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class EditSortMembersHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
EditSortMembersHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class ExecutionCreateContextHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
ExecutionCreateContextHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class ExecutionDeleteContextHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
ExecutionDeleteContextHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -12,12 +12,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart';
class ExecutionGetSuggestionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
ExecutionGetSuggestionsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -14,12 +14,7 @@ import 'package:analyzer/file_system/file_system.dart';
class ExecutionMapUriHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
ExecutionMapUriHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -11,12 +11,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class ExecutionSetSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
ExecutionSetSubscriptionsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -13,12 +13,7 @@ import 'package:analyzer/dart/analysis/session.dart';
class FlutterGetWidgetDescriptionHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
FlutterGetWidgetDescriptionHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -12,12 +12,7 @@ import 'package:analysis_server/src/protocol/protocol_internal.dart';
class FlutterSetSubscriptionsHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
FlutterSetSubscriptionsHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {
@@ -12,12 +12,7 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
class FlutterSetWidgetPropertyValueHandler extends LegacyHandler {
/// Initialize a newly created handler to be able to service requests for the
/// [server].
FlutterSetWidgetPropertyValueHandler(
super.server,
super.request,
super.cancellationToken,
super.performance,
);
new(super.server, super.request, super.cancellationToken, super.performance);
@override
Future<void> handle() async {

Some files were not shown because too many files have changed in this diff Show More