From c2d660d16158df90b106c1c6dddc7a6cb270311e Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Fri, 2 Apr 2021 06:46:41 +0000 Subject: [PATCH] Migrate analysis_server and analysis_server_client protocol. Change-Id: Ie0912627733f0481de0d3239647a4978e5327f12 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193641 Commit-Queue: Konstantin Shcheglov Reviewed-by: Brian Wilkerson --- .../lib/protocol/protocol.dart | 211 +- .../lib/protocol/protocol_constants.dart | 2 - .../lib/protocol/protocol_generated.dart | 7278 ++++------------- .../lib/src/protocol/protocol_internal.dart | 40 +- pkg/analysis_server/test/constants.dart | 2 - .../support/integration_test_methods.dart | 122 +- .../support/integration_tests.dart | 86 +- .../support/protocol_matchers.dart | 2 - pkg/analysis_server/test/protocol_test.dart | 32 +- .../flutter/widget_descriptions_test.dart | 3 +- .../tool/spec/codegen_dart.dart | 6 + .../codegen_dart_notification_handler.dart | 2 - .../tool/spec/codegen_dart_protocol.dart | 108 +- .../tool/spec/codegen_inttest_methods.dart | 9 +- .../tool/spec/codegen_matchers.dart | 2 - .../tool/spec/codegen_protocol_constants.dart | 2 - .../lib/handler/notification_handler.dart | 2 - pkg/analysis_server_client/lib/protocol.dart | 2 - .../lib/src/protocol/protocol_base.dart | 213 +- .../lib/src/protocol/protocol_common.dart | 853 +- .../lib/src/protocol/protocol_constants.dart | 2 - .../lib/src/protocol/protocol_generated.dart | 7278 ++++------------- .../lib/src/protocol/protocol_internal.dart | 71 +- .../lib/src/protocol/protocol_util.dart | 2 - .../lib/protocol/protocol.dart | 37 +- .../lib/src/channel/isolate_channel.dart | 2 +- .../lib/src/protocol/protocol_internal.dart | 14 +- .../tool/spec/generate_all.dart | 4 +- 28 files changed, 3914 insertions(+), 12473 deletions(-) diff --git a/pkg/analysis_server/lib/protocol/protocol.dart b/pkg/analysis_server/lib/protocol/protocol.dart index 4f0437bf26d..8eef99507b6 100644 --- a/pkg/analysis_server/lib/protocol/protocol.dart +++ b/pkg/analysis_server/lib/protocol/protocol.dart @@ -2,8 +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. -// @dart = 2.9 - /// Support for client code that needs to interact with the requests, responses /// and notifications that are part of the analysis server's wire protocol. import 'dart:convert' hide JsonDecoder; @@ -30,7 +28,7 @@ class Notification { /// A table mapping the names of notification parameters to their values, or /// `null` if there are no notification parameters. - final Map params; + final Map? params; /// Initialize a newly created [Notification] to have the given [event] name. /// If [params] is provided, it will be used as the params; otherwise no @@ -40,7 +38,7 @@ class Notification { /// Initialize a newly created instance based on the given JSON data. factory Notification.fromJson(Map json) { return Notification(json[Notification.EVENT], - json[Notification.PARAMS] as Map); + json[Notification.PARAMS] as Map?); } /// Return a table representing the structure of the Json object that will be @@ -48,6 +46,7 @@ class Notification { Map toJson() { var jsonObject = {}; jsonObject[EVENT] = event; + var params = this.params; if (params != null) { jsonObject[PARAMS] = params; } @@ -79,84 +78,18 @@ class Request { final String method; /// A table mapping the names of request parameters to their values. - final Map params; + final Map params; /// The time (milliseconds since epoch) at which the client made the request /// or `null` if this information is not provided by the client. - final int clientRequestTime; + final int? clientRequestTime; /// 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(this.id, this.method, - [Map params, this.clientRequestTime]) - : params = params ?? {}; - - /// Return a request parsed from the given json, or `null` if the [data] is - /// not a valid json representation of a request. The [data] is expected to - /// have the following format: - /// - /// { - /// 'clientRequestTime': millisecondsSinceEpoch - /// 'id': String, - /// 'method': methodName, - /// 'params': { - /// paramter_name: value - /// } - /// } - /// - /// where both the parameters and clientRequestTime are optional. - /// - /// The parameters can contain any number of name/value pairs. The - /// clientRequestTime must be an int representing the time at which the client - /// issued the request (milliseconds since epoch). - factory Request.fromJson(Map result) { - var id = result[Request.ID]; - var method = result[Request.METHOD]; - if (id is! String || method is! String) { - return null; - } - var time = result[Request.CLIENT_REQUEST_TIME]; - if (time != null && time is! int) { - return null; - } - var params = result[Request.PARAMS]; - if (params is Map || params == null) { - return Request(id, method, params as Map, time); - } else { - return null; - } - } - - /// Return a request parsed from the given [data], or `null` if the [data] is - /// not a valid json representation of a request. The [data] is expected to - /// have the following format: - /// - /// { - /// 'clientRequestTime': millisecondsSinceEpoch - /// 'id': String, - /// 'method': methodName, - /// 'params': { - /// paramter_name: value - /// } - /// } - /// - /// where both the parameters and clientRequestTime are optional. - /// - /// The parameters can contain any number of name/value pairs. The - /// clientRequestTime must be an int representing the time at which the client - /// issued the request (milliseconds since epoch). - factory Request.fromString(String data) { - try { - var result = json.decode(data); - if (result is Map) { - return Request.fromJson(result as Map); - } - return null; - } catch (exception) { - return null; - } - } + [Map? params, this.clientRequestTime]) + : params = params ?? {}; @override int get hashCode { @@ -181,13 +114,14 @@ class Request { if (params.isNotEmpty) { jsonObject[PARAMS] = params; } + var clientRequestTime = this.clientRequestTime; if (clientRequestTime != null) { jsonObject[CLIENT_REQUEST_TIME] = clientRequestTime; } return jsonObject; } - bool _equalLists(List first, List second) { + bool _equalLists(List? first, List? second) { if (first == null) { return second == null; } @@ -206,7 +140,7 @@ class Request { return true; } - bool _equalMaps(Map first, Map second) { + bool _equalMaps(Map? first, Map? second) { if (first == null) { return second == null; } @@ -227,7 +161,7 @@ class Request { return true; } - bool _equalObjects(Object first, Object second) { + bool _equalObjects(Object? first, Object? second) { if (first == null) { return second == null; } @@ -248,6 +182,72 @@ class Request { } return first == second; } + + /// Return a request parsed from the given json, or `null` if the [data] is + /// not a valid json representation of a request. The [data] is expected to + /// have the following format: + /// + /// { + /// 'clientRequestTime': millisecondsSinceEpoch + /// 'id': String, + /// 'method': methodName, + /// 'params': { + /// paramter_name: value + /// } + /// } + /// + /// where both the parameters and clientRequestTime are optional. + /// + /// The parameters can contain any number of name/value pairs. The + /// clientRequestTime must be an int representing the time at which the client + /// issued the request (milliseconds since epoch). + static Request? fromJson(Map result) { + var id = result[Request.ID]; + var method = result[Request.METHOD]; + if (id is! String || method is! String) { + return null; + } + var time = result[Request.CLIENT_REQUEST_TIME]; + if (time is! int?) { + return null; + } + var params = result[Request.PARAMS]; + if (params is Map?) { + return Request(id, method, params, time); + } else { + return null; + } + } + + /// Return a request parsed from the given [data], or `null` if the [data] is + /// not a valid json representation of a request. The [data] is expected to + /// have the following format: + /// + /// { + /// 'clientRequestTime': millisecondsSinceEpoch + /// 'id': String, + /// 'method': methodName, + /// 'params': { + /// paramter_name: value + /// } + /// } + /// + /// where both the parameters and clientRequestTime are optional. + /// + /// The parameters can contain any number of name/value pairs. The + /// clientRequestTime must be an int representing the time at which the client + /// issued the request (milliseconds since epoch). + static Request? fromString(String data) { + try { + var result = json.decode(data); + if (result is Map) { + return Request.fromJson(result); + } + return null; + } catch (exception) { + return null; + } + } } /// An exception that occurred during the handling of a request that requires @@ -297,11 +297,11 @@ class Response { /// The error that was caused by attempting to handle the request, or `null` /// if there was no error. - final RequestError error; + final RequestError? error; /// A table mapping the names of result fields to their values. Should be /// `null` if there is no result to send. - Map result; + Map? result; /// Initialize a newly created instance to represent a response to a request /// with the given [id]. If [_result] is provided, it will be used as the @@ -336,30 +336,6 @@ class Response { error: RequestError(RequestErrorCode.FORMAT_WITH_ERRORS, 'Error during `edit.format`: source contains syntax errors.')); - /// Initialize a newly created instance based on the given JSON data. - factory Response.fromJson(Map json) { - try { - Object id = json[Response.ID]; - if (id is! String) { - return null; - } - Object error = json[Response.ERROR]; - RequestError decodedError; - if (error is Map) { - decodedError = - RequestError.fromJson(ResponseDecoder(null), '.error', error); - } - Object result = json[Response.RESULT]; - Map decodedResult; - if (result is Map) { - decodedResult = result as Map; - } - return Response(id, error: decodedError, result: decodedResult); - } catch (exception) { - return null; - } - } - /// Initialize a newly created instance to represent the /// GET_ERRORS_INVALID_FILE error condition. Response.getErrorsInvalidFile(Request request) @@ -529,12 +505,41 @@ class Response { Map toJson() { var jsonObject = {}; jsonObject[ID] = id; + var error = this.error; if (error != null) { jsonObject[ERROR] = error.toJson(); } + var result = this.result; if (result != null) { jsonObject[RESULT] = result; } return jsonObject; } + + /// Initialize a newly created instance based on the given JSON data. + static Response? fromJson(Map json) { + try { + var id = json[Response.ID]; + if (id is! String) { + return null; + } + + RequestError? decodedError; + var error = json[Response.ERROR]; + if (error is Map) { + decodedError = + RequestError.fromJson(ResponseDecoder(null), '.error', error); + } + + Map? decodedResult; + var result = json[Response.RESULT]; + if (result is Map) { + decodedResult = result; + } + + return Response(id, error: decodedError, result: decodedResult); + } catch (exception) { + return null; + } + } } diff --git a/pkg/analysis_server/lib/protocol/protocol_constants.dart b/pkg/analysis_server/lib/protocol/protocol_constants.dart index 654d974086d..6772e9dc901 100644 --- a/pkg/analysis_server/lib/protocol/protocol_constants.dart +++ b/pkg/analysis_server/lib/protocol/protocol_constants.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - const String PROTOCOL_VERSION = '1.32.5'; const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles'; diff --git a/pkg/analysis_server/lib/protocol/protocol_generated.dart b/pkg/analysis_server/lib/protocol/protocol_generated.dart index 6893238d65f..898ea6170a5 100644 --- a/pkg/analysis_server/lib/protocol/protocol_generated.dart +++ b/pkg/analysis_server/lib/protocol/protocol_generated.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - import 'dart:convert' hide JsonDecoder; import 'package:analyzer/src/generated/utilities_general.dart'; @@ -23,23 +21,13 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart'; /// /// Clients may not extend, implement or mix-in this class. class AnalysisAnalyzedFilesParams implements HasToJson { - List _directories; - /// A list of the paths of the files that are being analyzed. - List get directories => _directories; + List directories; - /// A list of the paths of the files that are being analyzed. - set directories(List value) { - assert(value != null); - _directories = value; - } - - AnalysisAnalyzedFilesParams(List directories) { - this.directories = directories; - } + AnalysisAnalyzedFilesParams(this.directories); factory AnalysisAnalyzedFilesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List directories; @@ -63,8 +51,8 @@ class AnalysisAnalyzedFilesParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['directories'] = directories; return result; } @@ -102,18 +90,8 @@ class AnalysisAnalyzedFilesParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisClosingLabelsParams implements HasToJson { - String _file; - - List _labels; - /// The file the closing labels relate to. - String get file => _file; - - /// The file the closing labels relate to. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// Closing labels relevant to the file. Each item represents a useful label /// associated with some range with may be useful to display to the user @@ -122,27 +100,12 @@ class AnalysisClosingLabelsParams implements HasToJson { /// and List arguments that span multiple lines. Note that the ranges that /// are returned can overlap each other because they may be associated with /// constructs that can be nested. - List get labels => _labels; + List labels; - /// Closing labels relevant to the file. Each item represents a useful label - /// associated with some range with may be useful to display to the user - /// within the editor at the end of the range to indicate what construct is - /// closed at that location. Closing labels include constructor/method calls - /// and List arguments that span multiple lines. Note that the ranges that - /// are returned can overlap each other because they may be associated with - /// constructs that can be nested. - set labels(List value) { - assert(value != null); - _labels = value; - } - - AnalysisClosingLabelsParams(String file, List labels) { - this.file = file; - this.labels = labels; - } + AnalysisClosingLabelsParams(this.file, this.labels); factory AnalysisClosingLabelsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -156,7 +119,7 @@ class AnalysisClosingLabelsParams implements HasToJson { labels = jsonDecoder.decodeList( jsonPath + '.labels', json['labels'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ClosingLabel.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'labels'); @@ -175,8 +138,8 @@ class AnalysisClosingLabelsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['labels'] = labels.map((ClosingLabel value) => value.toJson()).toList(); @@ -218,39 +181,17 @@ class AnalysisClosingLabelsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisErrorFixes implements HasToJson { - AnalysisError _error; - - List _fixes; - /// The error with which the fixes are associated. - AnalysisError get error => _error; - - /// The error with which the fixes are associated. - set error(AnalysisError value) { - assert(value != null); - _error = value; - } + AnalysisError error; /// The fixes associated with the error. - List get fixes => _fixes; + List fixes; - /// The fixes associated with the error. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - AnalysisErrorFixes(AnalysisError error, {List fixes}) { - this.error = error; - if (fixes == null) { - this.fixes = []; - } else { - this.fixes = fixes; - } - } + AnalysisErrorFixes(this.error, {List? fixes}) + : fixes = fixes ?? []; factory AnalysisErrorFixes.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { AnalysisError error; @@ -265,7 +206,7 @@ class AnalysisErrorFixes implements HasToJson { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceChange.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -277,8 +218,8 @@ class AnalysisErrorFixes implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['error'] = error.toJson(); result['fixes'] = fixes.map((SourceChange value) => value.toJson()).toList(); @@ -316,35 +257,16 @@ class AnalysisErrorFixes implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisErrorsParams implements HasToJson { - String _file; - - List _errors; - /// The file containing the errors. - String get file => _file; - - /// The file containing the errors. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The errors contained in the file. - List get errors => _errors; + List errors; - /// The errors contained in the file. - set errors(List value) { - assert(value != null); - _errors = value; - } - - AnalysisErrorsParams(String file, List errors) { - this.file = file; - this.errors = errors; - } + AnalysisErrorsParams(this.file, this.errors); factory AnalysisErrorsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -358,7 +280,7 @@ class AnalysisErrorsParams implements HasToJson { errors = jsonDecoder.decodeList( jsonPath + '.errors', json['errors'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AnalysisError.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'errors'); @@ -375,8 +297,8 @@ class AnalysisErrorsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['errors'] = errors.map((AnalysisError value) => value.toJson()).toList(); @@ -417,23 +339,13 @@ class AnalysisErrorsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisFlushResultsParams implements HasToJson { - List _files; - /// The files that are no longer being analyzed. - List get files => _files; + List files; - /// The files that are no longer being analyzed. - set files(List value) { - assert(value != null); - _files = value; - } - - AnalysisFlushResultsParams(List files) { - this.files = files; - } + AnalysisFlushResultsParams(this.files); factory AnalysisFlushResultsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List files; @@ -457,8 +369,8 @@ class AnalysisFlushResultsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = files; return result; } @@ -495,35 +407,16 @@ class AnalysisFlushResultsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisFoldingParams implements HasToJson { - String _file; - - List _regions; - /// The file containing the folding regions. - String get file => _file; - - /// The file containing the folding regions. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The folding regions contained in the file. - List get regions => _regions; + List regions; - /// The folding regions contained in the file. - set regions(List value) { - assert(value != null); - _regions = value; - } - - AnalysisFoldingParams(String file, List regions) { - this.file = file; - this.regions = regions; - } + AnalysisFoldingParams(this.file, this.regions); factory AnalysisFoldingParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -537,7 +430,7 @@ class AnalysisFoldingParams implements HasToJson { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FoldingRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -554,8 +447,8 @@ class AnalysisFoldingParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['regions'] = regions.map((FoldingRegion value) => value.toJson()).toList(); @@ -596,23 +489,13 @@ class AnalysisFoldingParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetErrorsParams implements RequestParams { - String _file; - /// The file for which errors are being requested. - String get file => _file; + String file; - /// The file for which errors are being requested. - set file(String value) { - assert(value != null); - _file = value; - } - - AnalysisGetErrorsParams(String file) { - this.file = file; - } + AnalysisGetErrorsParams(this.file); factory AnalysisGetErrorsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -633,8 +516,8 @@ class AnalysisGetErrorsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -671,23 +554,13 @@ class AnalysisGetErrorsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetErrorsResult implements ResponseResult { - List _errors; - /// The errors associated with the file. - List get errors => _errors; + List errors; - /// The errors associated with the file. - set errors(List value) { - assert(value != null); - _errors = value; - } - - AnalysisGetErrorsResult(List errors) { - this.errors = errors; - } + AnalysisGetErrorsResult(this.errors); factory AnalysisGetErrorsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List errors; @@ -695,7 +568,7 @@ class AnalysisGetErrorsResult implements ResponseResult { errors = jsonDecoder.decodeList( jsonPath + '.errors', json['errors'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AnalysisError.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'errors'); @@ -714,8 +587,8 @@ class AnalysisGetErrorsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['errors'] = errors.map((AnalysisError value) => value.toJson()).toList(); return result; @@ -755,35 +628,16 @@ class AnalysisGetErrorsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetHoverParams implements RequestParams { - String _file; - - int _offset; - /// The file in which hover information is being requested. - String get file => _file; - - /// The file in which hover information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset for which hover information is being requested. - int get offset => _offset; + int offset; - /// The offset for which hover information is being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } - - AnalysisGetHoverParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + AnalysisGetHoverParams(this.file, this.offset); factory AnalysisGetHoverParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -810,8 +664,8 @@ class AnalysisGetHoverParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -850,31 +704,17 @@ class AnalysisGetHoverParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetHoverResult implements ResponseResult { - List _hovers; - /// The hover information associated with the location. The list will be /// empty if no information could be determined for the location. The list /// can contain multiple items if the file is being analyzed in multiple /// contexts in conflicting ways (such as a part that is included in multiple /// libraries). - List get hovers => _hovers; + List hovers; - /// The hover information associated with the location. The list will be - /// empty if no information could be determined for the location. The list - /// can contain multiple items if the file is being analyzed in multiple - /// contexts in conflicting ways (such as a part that is included in multiple - /// libraries). - set hovers(List value) { - assert(value != null); - _hovers = value; - } - - AnalysisGetHoverResult(List hovers) { - this.hovers = hovers; - } + AnalysisGetHoverResult(this.hovers); factory AnalysisGetHoverResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List hovers; @@ -882,7 +722,7 @@ class AnalysisGetHoverResult implements ResponseResult { hovers = jsonDecoder.decodeList( jsonPath + '.hovers', json['hovers'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => HoverInformation.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'hovers'); @@ -901,8 +741,8 @@ class AnalysisGetHoverResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['hovers'] = hovers.map((HoverInformation value) => value.toJson()).toList(); return result; @@ -943,47 +783,19 @@ class AnalysisGetHoverResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetImportedElementsParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file in which import information is being requested. - String get file => _file; - - /// The file in which import information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the region for which import information is being requested. - int get offset => _offset; - - /// The offset of the region for which import information is being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the region for which import information is being requested. - int get length => _length; + int length; - /// The length of the region for which import information is being requested. - set length(int value) { - assert(value != null); - _length = value; - } - - AnalysisGetImportedElementsParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + AnalysisGetImportedElementsParams(this.file, this.offset, this.length); factory AnalysisGetImportedElementsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1017,8 +829,8 @@ class AnalysisGetImportedElementsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -1061,25 +873,14 @@ class AnalysisGetImportedElementsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetImportedElementsResult implements ResponseResult { - List _elements; - /// The information about the elements that are referenced in the specified /// region of the specified file that come from imported libraries. - List get elements => _elements; + List elements; - /// The information about the elements that are referenced in the specified - /// region of the specified file that come from imported libraries. - set elements(List value) { - assert(value != null); - _elements = value; - } - - AnalysisGetImportedElementsResult(List elements) { - this.elements = elements; - } + AnalysisGetImportedElementsResult(this.elements); factory AnalysisGetImportedElementsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List elements; @@ -1087,7 +888,7 @@ class AnalysisGetImportedElementsResult implements ResponseResult { elements = jsonDecoder.decodeList( jsonPath + '.elements', json['elements'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImportedElements.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'elements'); @@ -1107,8 +908,8 @@ class AnalysisGetImportedElementsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['elements'] = elements.map((ImportedElements value) => value.toJson()).toList(); return result; @@ -1144,7 +945,7 @@ class AnalysisGetImportedElementsResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class AnalysisGetLibraryDependenciesParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -1174,42 +975,19 @@ class AnalysisGetLibraryDependenciesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetLibraryDependenciesResult implements ResponseResult { - List _libraries; - - Map>> _packageMap; - /// A list of the paths of library elements referenced by files in existing /// analysis roots. - List get libraries => _libraries; - - /// A list of the paths of library elements referenced by files in existing - /// analysis roots. - set libraries(List value) { - assert(value != null); - _libraries = value; - } + List libraries; /// A mapping from context source roots to package maps which map package /// names to source directories for use in client-side package URI /// resolution. - Map>> get packageMap => _packageMap; + Map>> packageMap; - /// A mapping from context source roots to package maps which map package - /// names to source directories for use in client-side package URI - /// resolution. - set packageMap(Map>> value) { - assert(value != null); - _packageMap = value; - } - - AnalysisGetLibraryDependenciesResult(List libraries, - Map>> packageMap) { - this.libraries = libraries; - this.packageMap = packageMap; - } + AnalysisGetLibraryDependenciesResult(this.libraries, this.packageMap); factory AnalysisGetLibraryDependenciesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List libraries; @@ -1223,9 +1001,9 @@ class AnalysisGetLibraryDependenciesResult implements ResponseResult { if (json.containsKey('packageMap')) { packageMap = jsonDecoder.decodeMap( jsonPath + '.packageMap', json['packageMap'], - valueDecoder: (String jsonPath, Object json) => + valueDecoder: (String jsonPath, Object? json) => jsonDecoder.decodeMap(jsonPath, json, - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString))); } else { throw jsonDecoder.mismatch(jsonPath, 'packageMap'); @@ -1245,8 +1023,8 @@ class AnalysisGetLibraryDependenciesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['libraries'] = libraries; result['packageMap'] = packageMap; return result; @@ -1297,51 +1075,21 @@ class AnalysisGetLibraryDependenciesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetNavigationParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file in which navigation information is being requested. - String get file => _file; - - /// The file in which navigation information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the region for which navigation information is being /// requested. - int get offset => _offset; - - /// The offset of the region for which navigation information is being - /// requested. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the region for which navigation information is being /// requested. - int get length => _length; + int length; - /// The length of the region for which navigation information is being - /// requested. - set length(int value) { - assert(value != null); - _length = value; - } - - AnalysisGetNavigationParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + AnalysisGetNavigationParams(this.file, this.offset, this.length); factory AnalysisGetNavigationParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1375,8 +1123,8 @@ class AnalysisGetNavigationParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -1421,52 +1169,21 @@ class AnalysisGetNavigationParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetNavigationResult implements ResponseResult { - List _files; - - List _targets; - - List _regions; - /// A list of the paths of files that are referenced by the navigation /// targets. - List get files => _files; - - /// A list of the paths of files that are referenced by the navigation - /// targets. - set files(List value) { - assert(value != null); - _files = value; - } + List files; /// A list of the navigation targets that are referenced by the navigation /// regions. - List get targets => _targets; - - /// A list of the navigation targets that are referenced by the navigation - /// regions. - set targets(List value) { - assert(value != null); - _targets = value; - } + List targets; /// A list of the navigation regions within the requested region of the file. - List get regions => _regions; + List regions; - /// A list of the navigation regions within the requested region of the file. - set regions(List value) { - assert(value != null); - _regions = value; - } - - AnalysisGetNavigationResult(List files, - List targets, List regions) { - this.files = files; - this.targets = targets; - this.regions = regions; - } + AnalysisGetNavigationResult(this.files, this.targets, this.regions); factory AnalysisGetNavigationResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List files; @@ -1481,7 +1198,7 @@ class AnalysisGetNavigationResult implements ResponseResult { targets = jsonDecoder.decodeList( jsonPath + '.targets', json['targets'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationTarget.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'targets'); @@ -1491,7 +1208,7 @@ class AnalysisGetNavigationResult implements ResponseResult { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -1511,8 +1228,8 @@ class AnalysisGetNavigationResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = files; result['targets'] = targets.map((NavigationTarget value) => value.toJson()).toList(); @@ -1559,23 +1276,13 @@ class AnalysisGetNavigationResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetReachableSourcesParams implements RequestParams { - String _file; - /// The file for which reachable source information is being requested. - String get file => _file; + String file; - /// The file for which reachable source information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } - - AnalysisGetReachableSourcesParams(String file) { - this.file = file; - } + AnalysisGetReachableSourcesParams(this.file); factory AnalysisGetReachableSourcesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1597,8 +1304,8 @@ class AnalysisGetReachableSourcesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -1635,8 +1342,6 @@ class AnalysisGetReachableSourcesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetReachableSourcesResult implements ResponseResult { - Map> _sources; - /// A mapping from source URIs to directly reachable source URIs. For /// example, a file "foo.dart" that imports "bar.dart" would have the /// corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If @@ -1644,32 +1349,18 @@ class AnalysisGetReachableSourcesResult implements ResponseResult { /// the URI "file:///bar.dart" to them. To check if a specific URI is /// reachable from a given file, clients can check for its presence in the /// resulting key set. - Map> get sources => _sources; + Map> sources; - /// A mapping from source URIs to directly reachable source URIs. For - /// example, a file "foo.dart" that imports "bar.dart" would have the - /// corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If - /// "bar.dart" has further imports (or exports) there will be a mapping from - /// the URI "file:///bar.dart" to them. To check if a specific URI is - /// reachable from a given file, clients can check for its presence in the - /// resulting key set. - set sources(Map> value) { - assert(value != null); - _sources = value; - } - - AnalysisGetReachableSourcesResult(Map> sources) { - this.sources = sources; - } + AnalysisGetReachableSourcesResult(this.sources); factory AnalysisGetReachableSourcesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map> sources; if (json.containsKey('sources')) { sources = jsonDecoder.decodeMap(jsonPath + '.sources', json['sources'], - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString)); } else { throw jsonDecoder.mismatch(jsonPath, 'sources'); @@ -1689,8 +1380,8 @@ class AnalysisGetReachableSourcesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['sources'] = sources; return result; } @@ -1732,35 +1423,16 @@ class AnalysisGetReachableSourcesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetSignatureParams implements RequestParams { - String _file; - - int _offset; - /// The file in which signature information is being requested. - String get file => _file; - - /// The file in which signature information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The location for which signature information is being requested. - int get offset => _offset; + int offset; - /// The location for which signature information is being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } - - AnalysisGetSignatureParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + AnalysisGetSignatureParams(this.file, this.offset); factory AnalysisGetSignatureParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1788,8 +1460,8 @@ class AnalysisGetSignatureParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -1830,57 +1502,24 @@ class AnalysisGetSignatureParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetSignatureResult implements ResponseResult { - String _name; - - List _parameters; - - String _dartdoc; - /// The name of the function being invoked at the given offset. - String get name => _name; - - /// The name of the function being invoked at the given offset. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// A list of information about each of the parameters of the function being /// invoked. - List get parameters => _parameters; - - /// A list of information about each of the parameters of the function being - /// invoked. - set parameters(List value) { - assert(value != null); - _parameters = value; - } + List parameters; /// The dartdoc associated with the function being invoked. Other than the /// removal of the comment delimiters, including leading asterisks in the /// case of a block comment, the dartdoc is unprocessed markdown. This data /// is omitted if there is no referenced element, or if the element has no /// dartdoc. - String get dartdoc => _dartdoc; + String? dartdoc; - /// The dartdoc associated with the function being invoked. Other than the - /// removal of the comment delimiters, including leading asterisks in the - /// case of a block comment, the dartdoc is unprocessed markdown. This data - /// is omitted if there is no referenced element, or if the element has no - /// dartdoc. - set dartdoc(String value) { - _dartdoc = value; - } - - AnalysisGetSignatureResult(String name, List parameters, - {String dartdoc}) { - this.name = name; - this.parameters = parameters; - this.dartdoc = dartdoc; - } + AnalysisGetSignatureResult(this.name, this.parameters, {this.dartdoc}); factory AnalysisGetSignatureResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -1894,12 +1533,12 @@ class AnalysisGetSignatureResult implements ResponseResult { parameters = jsonDecoder.decodeList( jsonPath + '.parameters', json['parameters'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ParameterInfo.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'parameters'); } - String dartdoc; + String? dartdoc; if (json.containsKey('dartdoc')) { dartdoc = jsonDecoder.decodeString(jsonPath + '.dartdoc', json['dartdoc']); @@ -1919,11 +1558,12 @@ class AnalysisGetSignatureResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['parameters'] = parameters.map((ParameterInfo value) => value.toJson()).toList(); + var dartdoc = this.dartdoc; if (dartdoc != null) { result['dartdoc'] = dartdoc; } @@ -1968,43 +1608,20 @@ class AnalysisGetSignatureResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisHighlightsParams implements HasToJson { - String _file; - - List _regions; - /// The file containing the highlight regions. - String get file => _file; - - /// The file containing the highlight regions. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The highlight regions contained in the file. Each highlight region /// represents a particular syntactic or semantic meaning associated with /// some range. Note that the highlight regions that are returned can overlap /// other highlight regions if there is more than one meaning associated with /// a particular region. - List get regions => _regions; + List regions; - /// The highlight regions contained in the file. Each highlight region - /// represents a particular syntactic or semantic meaning associated with - /// some range. Note that the highlight regions that are returned can overlap - /// other highlight regions if there is more than one meaning associated with - /// a particular region. - set regions(List value) { - assert(value != null); - _regions = value; - } - - AnalysisHighlightsParams(String file, List regions) { - this.file = file; - this.regions = regions; - } + AnalysisHighlightsParams(this.file, this.regions); factory AnalysisHighlightsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2018,7 +1635,7 @@ class AnalysisHighlightsParams implements HasToJson { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => HighlightRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -2035,8 +1652,8 @@ class AnalysisHighlightsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['regions'] = regions.map((HighlightRegion value) => value.toJson()).toList(); @@ -2079,48 +1696,19 @@ class AnalysisHighlightsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisImplementedParams implements HasToJson { - String _file; - - List _classes; - - List _members; - /// The file with which the implementations are associated. - String get file => _file; - - /// The file with which the implementations are associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The classes defined in the file that are implemented or extended. - List get classes => _classes; - - /// The classes defined in the file that are implemented or extended. - set classes(List value) { - assert(value != null); - _classes = value; - } + List classes; /// The member defined in the file that are implemented or overridden. - List get members => _members; + List members; - /// The member defined in the file that are implemented or overridden. - set members(List value) { - assert(value != null); - _members = value; - } - - AnalysisImplementedParams(String file, List classes, - List members) { - this.file = file; - this.classes = classes; - this.members = members; - } + AnalysisImplementedParams(this.file, this.classes, this.members); factory AnalysisImplementedParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2134,7 +1722,7 @@ class AnalysisImplementedParams implements HasToJson { classes = jsonDecoder.decodeList( jsonPath + '.classes', json['classes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImplementedClass.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'classes'); @@ -2144,7 +1732,7 @@ class AnalysisImplementedParams implements HasToJson { members = jsonDecoder.decodeList( jsonPath + '.members', json['members'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImplementedMember.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'members'); @@ -2162,8 +1750,8 @@ class AnalysisImplementedParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['classes'] = classes.map((ImplementedClass value) => value.toJson()).toList(); @@ -2212,63 +1800,24 @@ class AnalysisImplementedParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisInvalidateParams implements HasToJson { - String _file; - - int _offset; - - int _length; - - int _delta; - /// The file whose information has been invalidated. - String get file => _file; - - /// The file whose information has been invalidated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the invalidated region. - int get offset => _offset; - - /// The offset of the invalidated region. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the invalidated region. - int get length => _length; - - /// The length of the invalidated region. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The delta to be applied to the offsets in information that follows the /// invalidated region in order to update it so that it doesn't need to be /// re-requested. - int get delta => _delta; + int delta; - /// The delta to be applied to the offsets in information that follows the - /// invalidated region in order to update it so that it doesn't need to be - /// re-requested. - set delta(int value) { - assert(value != null); - _delta = value; - } - - AnalysisInvalidateParams(String file, int offset, int length, int delta) { - this.file = file; - this.offset = offset; - this.length = length; - this.delta = delta; - } + AnalysisInvalidateParams(this.file, this.offset, this.length, this.delta); factory AnalysisInvalidateParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2307,8 +1856,8 @@ class AnalysisInvalidateParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -2356,22 +1905,8 @@ class AnalysisInvalidateParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisNavigationParams implements HasToJson { - String _file; - - List _regions; - - List _targets; - - List _files; - /// The file containing the navigation regions. - String get file => _file; - - /// The file containing the navigation regions. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The navigation regions contained in the file. The regions are sorted by /// their offsets. Each navigation region represents a list of targets @@ -2380,52 +1915,20 @@ class AnalysisNavigationParams implements HasToJson { /// multiple libraries or in Dart code that is compiled against multiple /// versions of a package. Note that the navigation regions that are returned /// do not overlap other navigation regions. - List get regions => _regions; - - /// The navigation regions contained in the file. The regions are sorted by - /// their offsets. Each navigation region represents a list of targets - /// associated with some range. The lists will usually contain a single - /// target, but can contain more in the case of a part that is included in - /// multiple libraries or in Dart code that is compiled against multiple - /// versions of a package. Note that the navigation regions that are returned - /// do not overlap other navigation regions. - set regions(List value) { - assert(value != null); - _regions = value; - } + List regions; /// The navigation targets referenced in the file. They are referenced by /// NavigationRegions by their index in this array. - List get targets => _targets; - - /// The navigation targets referenced in the file. They are referenced by - /// NavigationRegions by their index in this array. - set targets(List value) { - assert(value != null); - _targets = value; - } + List targets; /// The files containing navigation targets referenced in the file. They are /// referenced by NavigationTargets by their index in this array. - List get files => _files; + List files; - /// The files containing navigation targets referenced in the file. They are - /// referenced by NavigationTargets by their index in this array. - set files(List value) { - assert(value != null); - _files = value; - } - - AnalysisNavigationParams(String file, List regions, - List targets, List files) { - this.file = file; - this.regions = regions; - this.targets = targets; - this.files = files; - } + AnalysisNavigationParams(this.file, this.regions, this.targets, this.files); factory AnalysisNavigationParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2439,7 +1942,7 @@ class AnalysisNavigationParams implements HasToJson { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -2449,7 +1952,7 @@ class AnalysisNavigationParams implements HasToJson { targets = jsonDecoder.decodeList( jsonPath + '.targets', json['targets'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationTarget.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'targets'); @@ -2473,8 +1976,8 @@ class AnalysisNavigationParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['regions'] = regions.map((NavigationRegion value) => value.toJson()).toList(); @@ -2524,35 +2027,16 @@ class AnalysisNavigationParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOccurrencesParams implements HasToJson { - String _file; - - List _occurrences; - /// The file in which the references occur. - String get file => _file; - - /// The file in which the references occur. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The occurrences of references to elements within the file. - List get occurrences => _occurrences; + List occurrences; - /// The occurrences of references to elements within the file. - set occurrences(List value) { - assert(value != null); - _occurrences = value; - } - - AnalysisOccurrencesParams(String file, List occurrences) { - this.file = file; - this.occurrences = occurrences; - } + AnalysisOccurrencesParams(this.file, this.occurrences); factory AnalysisOccurrencesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2566,7 +2050,7 @@ class AnalysisOccurrencesParams implements HasToJson { occurrences = jsonDecoder.decodeList( jsonPath + '.occurrences', json['occurrences'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Occurrences.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'occurrences'); @@ -2584,8 +2068,8 @@ class AnalysisOccurrencesParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['occurrences'] = occurrences.map((Occurrences value) => value.toJson()).toList(); @@ -2633,176 +2117,96 @@ class AnalysisOccurrencesParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOptions implements HasToJson { - bool _enableAsync; - - bool _enableDeferredLoading; - - bool _enableEnums; - - bool _enableNullAwareOperators; - - bool _enableSuperMixins; - - bool _generateDart2jsHints; - - bool _generateHints; - - bool _generateLints; - /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed async /// feature. - bool get enableAsync => _enableAsync; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed async - /// feature. - set enableAsync(bool value) { - _enableAsync = value; - } + bool? enableAsync; /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed deferred /// loading feature. - bool get enableDeferredLoading => _enableDeferredLoading; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed deferred - /// loading feature. - set enableDeferredLoading(bool value) { - _enableDeferredLoading = value; - } + bool? enableDeferredLoading; /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed enum feature. - bool get enableEnums => _enableEnums; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed enum feature. - set enableEnums(bool value) { - _enableEnums = value; - } + bool? enableEnums; /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed "null aware /// operators" feature. - bool get enableNullAwareOperators => _enableNullAwareOperators; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed "null aware - /// operators" feature. - set enableNullAwareOperators(bool value) { - _enableNullAwareOperators = value; - } + bool? enableNullAwareOperators; /// True if the client wants to enable support for the proposed "less /// restricted mixins" proposal (DEP 34). - bool get enableSuperMixins => _enableSuperMixins; - - /// True if the client wants to enable support for the proposed "less - /// restricted mixins" proposal (DEP 34). - set enableSuperMixins(bool value) { - _enableSuperMixins = value; - } + bool? enableSuperMixins; /// True if hints that are specific to dart2js should be generated. This /// option is ignored if generateHints is false. - bool get generateDart2jsHints => _generateDart2jsHints; - - /// True if hints that are specific to dart2js should be generated. This - /// option is ignored if generateHints is false. - set generateDart2jsHints(bool value) { - _generateDart2jsHints = value; - } + bool? generateDart2jsHints; /// True if hints should be generated as part of generating errors and /// warnings. - bool get generateHints => _generateHints; - - /// True if hints should be generated as part of generating errors and - /// warnings. - set generateHints(bool value) { - _generateHints = value; - } + bool? generateHints; /// True if lints should be generated as part of generating errors and /// warnings. - bool get generateLints => _generateLints; - - /// True if lints should be generated as part of generating errors and - /// warnings. - set generateLints(bool value) { - _generateLints = value; - } + bool? generateLints; AnalysisOptions( - {bool enableAsync, - bool enableDeferredLoading, - bool enableEnums, - bool enableNullAwareOperators, - bool enableSuperMixins, - bool generateDart2jsHints, - bool generateHints, - bool generateLints}) { - this.enableAsync = enableAsync; - this.enableDeferredLoading = enableDeferredLoading; - this.enableEnums = enableEnums; - this.enableNullAwareOperators = enableNullAwareOperators; - this.enableSuperMixins = enableSuperMixins; - this.generateDart2jsHints = generateDart2jsHints; - this.generateHints = generateHints; - this.generateLints = generateLints; - } + {this.enableAsync, + this.enableDeferredLoading, + this.enableEnums, + this.enableNullAwareOperators, + this.enableSuperMixins, + this.generateDart2jsHints, + this.generateHints, + this.generateLints}); factory AnalysisOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - bool enableAsync; + bool? enableAsync; if (json.containsKey('enableAsync')) { enableAsync = jsonDecoder.decodeBool( jsonPath + '.enableAsync', json['enableAsync']); } - bool enableDeferredLoading; + bool? enableDeferredLoading; if (json.containsKey('enableDeferredLoading')) { enableDeferredLoading = jsonDecoder.decodeBool( jsonPath + '.enableDeferredLoading', json['enableDeferredLoading']); } - bool enableEnums; + bool? enableEnums; if (json.containsKey('enableEnums')) { enableEnums = jsonDecoder.decodeBool( jsonPath + '.enableEnums', json['enableEnums']); } - bool enableNullAwareOperators; + bool? enableNullAwareOperators; if (json.containsKey('enableNullAwareOperators')) { enableNullAwareOperators = jsonDecoder.decodeBool( jsonPath + '.enableNullAwareOperators', json['enableNullAwareOperators']); } - bool enableSuperMixins; + bool? enableSuperMixins; if (json.containsKey('enableSuperMixins')) { enableSuperMixins = jsonDecoder.decodeBool( jsonPath + '.enableSuperMixins', json['enableSuperMixins']); } - bool generateDart2jsHints; + bool? generateDart2jsHints; if (json.containsKey('generateDart2jsHints')) { generateDart2jsHints = jsonDecoder.decodeBool( jsonPath + '.generateDart2jsHints', json['generateDart2jsHints']); } - bool generateHints; + bool? generateHints; if (json.containsKey('generateHints')) { generateHints = jsonDecoder.decodeBool( jsonPath + '.generateHints', json['generateHints']); } - bool generateLints; + bool? generateLints; if (json.containsKey('generateLints')) { generateLints = jsonDecoder.decodeBool( jsonPath + '.generateLints', json['generateLints']); @@ -2822,29 +2226,37 @@ class AnalysisOptions implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var enableAsync = this.enableAsync; if (enableAsync != null) { result['enableAsync'] = enableAsync; } + var enableDeferredLoading = this.enableDeferredLoading; if (enableDeferredLoading != null) { result['enableDeferredLoading'] = enableDeferredLoading; } + var enableEnums = this.enableEnums; if (enableEnums != null) { result['enableEnums'] = enableEnums; } + var enableNullAwareOperators = this.enableNullAwareOperators; if (enableNullAwareOperators != null) { result['enableNullAwareOperators'] = enableNullAwareOperators; } + var enableSuperMixins = this.enableSuperMixins; if (enableSuperMixins != null) { result['enableSuperMixins'] = enableSuperMixins; } + var generateDart2jsHints = this.generateDart2jsHints; if (generateDart2jsHints != null) { result['generateDart2jsHints'] = generateDart2jsHints; } + var generateHints = this.generateHints; if (generateHints != null) { result['generateHints'] = generateHints; } + var generateLints = this.generateLints; if (generateLints != null) { result['generateLints'] = generateLints; } @@ -2895,67 +2307,26 @@ class AnalysisOptions implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOutlineParams implements HasToJson { - String _file; - - FileKind _kind; - - String _libraryName; - - Outline _outline; - /// The file with which the outline is associated. - String get file => _file; - - /// The file with which the outline is associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The kind of the file. - FileKind get kind => _kind; - - /// The kind of the file. - set kind(FileKind value) { - assert(value != null); - _kind = value; - } + FileKind kind; /// The name of the library defined by the file using a "library" directive, /// or referenced by a "part of" directive. If both "library" and "part of" /// directives are present, then the "library" directive takes precedence. /// This field will be omitted if the file has neither "library" nor "part /// of" directives. - String get libraryName => _libraryName; - - /// The name of the library defined by the file using a "library" directive, - /// or referenced by a "part of" directive. If both "library" and "part of" - /// directives are present, then the "library" directive takes precedence. - /// This field will be omitted if the file has neither "library" nor "part - /// of" directives. - set libraryName(String value) { - _libraryName = value; - } + String? libraryName; /// The outline associated with the file. - Outline get outline => _outline; + Outline outline; - /// The outline associated with the file. - set outline(Outline value) { - assert(value != null); - _outline = value; - } - - AnalysisOutlineParams(String file, FileKind kind, Outline outline, - {String libraryName}) { - this.file = file; - this.kind = kind; - this.libraryName = libraryName; - this.outline = outline; - } + AnalysisOutlineParams(this.file, this.kind, this.outline, {this.libraryName}); factory AnalysisOutlineParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2970,7 +2341,7 @@ class AnalysisOutlineParams implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'kind'); } - String libraryName; + String? libraryName; if (json.containsKey('libraryName')) { libraryName = jsonDecoder.decodeString( jsonPath + '.libraryName', json['libraryName']); @@ -2995,10 +2366,11 @@ class AnalysisOutlineParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['kind'] = kind.toJson(); + var libraryName = this.libraryName; if (libraryName != null) { result['libraryName'] = libraryName; } @@ -3044,35 +2416,16 @@ class AnalysisOutlineParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOverridesParams implements HasToJson { - String _file; - - List _overrides; - /// The file with which the overrides are associated. - String get file => _file; - - /// The file with which the overrides are associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The overrides associated with the file. - List get overrides => _overrides; + List overrides; - /// The overrides associated with the file. - set overrides(List value) { - assert(value != null); - _overrides = value; - } - - AnalysisOverridesParams(String file, List overrides) { - this.file = file; - this.overrides = overrides; - } + AnalysisOverridesParams(this.file, this.overrides); factory AnalysisOverridesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -3086,7 +2439,7 @@ class AnalysisOverridesParams implements HasToJson { overrides = jsonDecoder.decodeList( jsonPath + '.overrides', json['overrides'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Override.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'overrides'); @@ -3103,8 +2456,8 @@ class AnalysisOverridesParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['overrides'] = overrides.map((Override value) => value.toJson()).toList(); @@ -3142,7 +2495,7 @@ class AnalysisOverridesParams implements HasToJson { /// Clients may not extend, implement or mix-in this class. class AnalysisReanalyzeParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -3168,7 +2521,7 @@ class AnalysisReanalyzeParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisReanalyzeResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3269,7 +2622,7 @@ class AnalysisService implements Enum { } factory AnalysisService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return AnalysisService(json); @@ -3296,31 +2649,12 @@ class AnalysisService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetAnalysisRootsParams implements RequestParams { - List _included; - - List _excluded; - - Map _packageRoots; - /// A list of the files and directories that should be analyzed. - List get included => _included; - - /// A list of the files and directories that should be analyzed. - set included(List value) { - assert(value != null); - _included = value; - } + List included; /// A list of the files and directories within the included directories that /// should not be analyzed. - List get excluded => _excluded; - - /// A list of the files and directories within the included directories that - /// should not be analyzed. - set excluded(List value) { - assert(value != null); - _excluded = value; - } + List excluded; /// A mapping from source directories to package roots that should override /// the normal package: URI resolution mechanism. @@ -3334,33 +2668,13 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { /// their package: URI's resolved using the normal pubspec.yaml mechanism. If /// this field is absent, or the empty map is specified, that indicates that /// the normal pubspec.yaml mechanism should always be used. - Map get packageRoots => _packageRoots; + Map? packageRoots; - /// A mapping from source directories to package roots that should override - /// the normal package: URI resolution mechanism. - /// - /// If a package root is a file, then the analyzer will behave as though that - /// file is a ".packages" file in the source directory. The effect is the - /// same as specifying the file as a "--packages" parameter to the Dart VM - /// when executing any Dart file inside the source directory. - /// - /// Files in any directories that are not overridden by this mapping have - /// their package: URI's resolved using the normal pubspec.yaml mechanism. If - /// this field is absent, or the empty map is specified, that indicates that - /// the normal pubspec.yaml mechanism should always be used. - set packageRoots(Map value) { - _packageRoots = value; - } - - AnalysisSetAnalysisRootsParams(List included, List excluded, - {Map packageRoots}) { - this.included = included; - this.excluded = excluded; - this.packageRoots = packageRoots; - } + AnalysisSetAnalysisRootsParams(this.included, this.excluded, + {this.packageRoots}); factory AnalysisSetAnalysisRootsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List included; @@ -3377,7 +2691,7 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'excluded'); } - Map packageRoots; + Map? packageRoots; if (json.containsKey('packageRoots')) { packageRoots = jsonDecoder.decodeMap( jsonPath + '.packageRoots', json['packageRoots'], @@ -3397,10 +2711,11 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['included'] = included; result['excluded'] = excluded; + var packageRoots = this.packageRoots; if (packageRoots != null) { result['packageRoots'] = packageRoots; } @@ -3442,7 +2757,7 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetAnalysisRootsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3471,24 +2786,13 @@ class AnalysisSetAnalysisRootsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetGeneralSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - AnalysisSetGeneralSubscriptionsParams( - List subscriptions) { - this.subscriptions = subscriptions; - } + AnalysisSetGeneralSubscriptionsParams(this.subscriptions); factory AnalysisSetGeneralSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -3496,7 +2800,7 @@ class AnalysisSetGeneralSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => GeneralAnalysisService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -3514,8 +2818,8 @@ class AnalysisSetGeneralSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions .map((GeneralAnalysisService value) => value.toJson()) .toList(); @@ -3552,7 +2856,7 @@ class AnalysisSetGeneralSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetGeneralSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3581,23 +2885,13 @@ class AnalysisSetGeneralSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetPriorityFilesParams implements RequestParams { - List _files; - /// The files that are to be a priority for analysis. - List get files => _files; + List files; - /// The files that are to be a priority for analysis. - set files(List value) { - assert(value != null); - _files = value; - } - - AnalysisSetPriorityFilesParams(List files) { - this.files = files; - } + AnalysisSetPriorityFilesParams(this.files); factory AnalysisSetPriorityFilesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List files; @@ -3620,8 +2914,8 @@ class AnalysisSetPriorityFilesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = files; return result; } @@ -3655,7 +2949,7 @@ class AnalysisSetPriorityFilesParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetPriorityFilesResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3684,35 +2978,23 @@ class AnalysisSetPriorityFilesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetSubscriptionsParams implements RequestParams { - Map> _subscriptions; - /// A table mapping services to a list of the files being subscribed to the /// service. - Map> get subscriptions => _subscriptions; + Map> subscriptions; - /// A table mapping services to a list of the files being subscribed to the - /// service. - set subscriptions(Map> value) { - assert(value != null); - _subscriptions = value; - } - - AnalysisSetSubscriptionsParams( - Map> subscriptions) { - this.subscriptions = subscriptions; - } + AnalysisSetSubscriptionsParams(this.subscriptions); factory AnalysisSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map> subscriptions; if (json.containsKey('subscriptions')) { subscriptions = jsonDecoder.decodeMap( jsonPath + '.subscriptions', json['subscriptions'], - keyDecoder: (String jsonPath, Object json) => + keyDecoder: (String jsonPath, Object? json) => AnalysisService.fromJson(jsonDecoder, jsonPath, json), - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -3730,8 +3012,8 @@ class AnalysisSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = mapMap(subscriptions, keyCallback: (AnalysisService value) => value.toJson()); return result; @@ -3770,7 +3052,7 @@ class AnalysisSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3800,36 +3082,17 @@ class AnalysisSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisStatus implements HasToJson { - bool _isAnalyzing; - - String _analysisTarget; - /// True if analysis is currently being performed. - bool get isAnalyzing => _isAnalyzing; - - /// True if analysis is currently being performed. - set isAnalyzing(bool value) { - assert(value != null); - _isAnalyzing = value; - } + bool isAnalyzing; /// The name of the current target of analysis. This field is omitted if /// analyzing is false. - String get analysisTarget => _analysisTarget; + String? analysisTarget; - /// The name of the current target of analysis. This field is omitted if - /// analyzing is false. - set analysisTarget(String value) { - _analysisTarget = value; - } - - AnalysisStatus(bool isAnalyzing, {String analysisTarget}) { - this.isAnalyzing = isAnalyzing; - this.analysisTarget = analysisTarget; - } + AnalysisStatus(this.isAnalyzing, {this.analysisTarget}); factory AnalysisStatus.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool isAnalyzing; @@ -3839,7 +3102,7 @@ class AnalysisStatus implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'isAnalyzing'); } - String analysisTarget; + String? analysisTarget; if (json.containsKey('analysisTarget')) { analysisTarget = jsonDecoder.decodeString( jsonPath + '.analysisTarget', json['analysisTarget']); @@ -3851,9 +3114,10 @@ class AnalysisStatus implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['isAnalyzing'] = isAnalyzing; + var analysisTarget = this.analysisTarget; if (analysisTarget != null) { result['analysisTarget'] = analysisTarget; } @@ -3889,38 +3153,27 @@ class AnalysisStatus implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisUpdateContentParams implements RequestParams { - Map _files; - /// A table mapping the files whose content has changed to a description of /// the content change. - Map get files => _files; + Map files; - /// A table mapping the files whose content has changed to a description of - /// the content change. - set files(Map value) { - assert(value != null); - _files = value; - } - - AnalysisUpdateContentParams(Map files) { - this.files = files; - } + AnalysisUpdateContentParams(this.files); factory AnalysisUpdateContentParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map files; if (json.containsKey('files')) { files = jsonDecoder.decodeMap(jsonPath + '.files', json['files'], - valueDecoder: (String jsonPath, Object json) => + valueDecoder: (String jsonPath, Object? json) => jsonDecoder.decodeUnion(jsonPath, json, 'type', { - 'add': (String jsonPath, Object json) => + 'add': (String jsonPath, Object? json) => AddContentOverlay.fromJson(jsonDecoder, jsonPath, json), - 'change': (String jsonPath, Object json) => + 'change': (String jsonPath, Object? json) => ChangeContentOverlay.fromJson( jsonDecoder, jsonPath, json), - 'remove': (String jsonPath, Object json) => + 'remove': (String jsonPath, Object? json) => RemoveContentOverlay.fromJson(jsonDecoder, jsonPath, json) })); } else { @@ -3939,8 +3192,8 @@ class AnalysisUpdateContentParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = mapMap(files, valueCallback: (dynamic value) => value.toJson()); return result; @@ -3980,7 +3233,7 @@ class AnalysisUpdateContentResult implements ResponseResult { AnalysisUpdateContentResult(); factory AnalysisUpdateContentResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { return AnalysisUpdateContentResult(); @@ -3998,8 +3251,8 @@ class AnalysisUpdateContentResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -4034,23 +3287,13 @@ class AnalysisUpdateContentResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisUpdateOptionsParams implements RequestParams { - AnalysisOptions _options; - /// The options that are to be used to control analysis. - AnalysisOptions get options => _options; + AnalysisOptions options; - /// The options that are to be used to control analysis. - set options(AnalysisOptions value) { - assert(value != null); - _options = value; - } - - AnalysisUpdateOptionsParams(AnalysisOptions options) { - this.options = options; - } + AnalysisUpdateOptionsParams(this.options); factory AnalysisUpdateOptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { AnalysisOptions options; @@ -4073,8 +3316,8 @@ class AnalysisUpdateOptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['options'] = options.toJson(); return result; } @@ -4108,7 +3351,7 @@ class AnalysisUpdateOptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisUpdateOptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4137,23 +3380,13 @@ class AnalysisUpdateOptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsEnableParams implements RequestParams { - bool _value; - /// Enable or disable analytics. - bool get value => _value; + bool value; - /// Enable or disable analytics. - set value(bool value) { - assert(value != null); - _value = value; - } - - AnalyticsEnableParams(bool value) { - this.value = value; - } + AnalyticsEnableParams(this.value); factory AnalyticsEnableParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool value; @@ -4174,8 +3407,8 @@ class AnalyticsEnableParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['value'] = value; return result; } @@ -4209,7 +3442,7 @@ class AnalyticsEnableParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalyticsEnableResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4235,7 +3468,7 @@ class AnalyticsEnableResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class AnalyticsIsEnabledParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -4264,23 +3497,13 @@ class AnalyticsIsEnabledParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsIsEnabledResult implements ResponseResult { - bool _enabled; - /// Whether sending analytics is enabled or not. - bool get enabled => _enabled; + bool enabled; - /// Whether sending analytics is enabled or not. - set enabled(bool value) { - assert(value != null); - _enabled = value; - } - - AnalyticsIsEnabledResult(bool enabled) { - this.enabled = enabled; - } + AnalyticsIsEnabledResult(this.enabled); factory AnalyticsIsEnabledResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool enabled; @@ -4304,8 +3527,8 @@ class AnalyticsIsEnabledResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['enabled'] = enabled; return result; } @@ -4342,23 +3565,13 @@ class AnalyticsIsEnabledResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsSendEventParams implements RequestParams { - String _action; - /// The value used to indicate which action was performed. - String get action => _action; + String action; - /// The value used to indicate which action was performed. - set action(String value) { - assert(value != null); - _action = value; - } - - AnalyticsSendEventParams(String action) { - this.action = action; - } + AnalyticsSendEventParams(this.action); factory AnalyticsSendEventParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String action; @@ -4379,8 +3592,8 @@ class AnalyticsSendEventParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['action'] = action; return result; } @@ -4414,7 +3627,7 @@ class AnalyticsSendEventParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalyticsSendEventResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4444,35 +3657,16 @@ class AnalyticsSendEventResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsSendTimingParams implements RequestParams { - String _event; - - int _millis; - /// The name of the event. - String get event => _event; - - /// The name of the event. - set event(String value) { - assert(value != null); - _event = value; - } + String event; /// The duration of the event in milliseconds. - int get millis => _millis; + int millis; - /// The duration of the event in milliseconds. - set millis(int value) { - assert(value != null); - _millis = value; - } - - AnalyticsSendTimingParams(String event, int millis) { - this.event = event; - this.millis = millis; - } + AnalyticsSendTimingParams(this.event, this.millis); factory AnalyticsSendTimingParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String event; @@ -4499,8 +3693,8 @@ class AnalyticsSendTimingParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['event'] = event; result['millis'] = millis; return result; @@ -4536,7 +3730,7 @@ class AnalyticsSendTimingParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalyticsSendTimingResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4573,62 +3767,19 @@ class AnalyticsSendTimingResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AvailableSuggestion implements HasToJson { - String _label; - - String _declaringLibraryUri; - - Element _element; - - String _defaultArgumentListString; - - List _defaultArgumentListTextRanges; - - List _parameterNames; - - List _parameterTypes; - - List _relevanceTags; - - int _requiredParameterCount; - /// The identifier to present to the user for code completion. - String get label => _label; - - /// The identifier to present to the user for code completion. - set label(String value) { - assert(value != null); - _label = value; - } + String label; /// The URI of the library that declares the element being suggested, not the /// URI of the library associated with the enclosing AvailableSuggestionSet. - String get declaringLibraryUri => _declaringLibraryUri; - - /// The URI of the library that declares the element being suggested, not the - /// URI of the library associated with the enclosing AvailableSuggestionSet. - set declaringLibraryUri(String value) { - assert(value != null); - _declaringLibraryUri = value; - } + String declaringLibraryUri; /// Information about the element reference being suggested. - Element get element => _element; - - /// Information about the element reference being suggested. - set element(Element value) { - assert(value != null); - _element = value; - } + Element element; /// A default String for use in generating argument list source contents on /// the client side. - String get defaultArgumentListString => _defaultArgumentListString; - - /// A default String for use in generating argument list source contents on - /// the client side. - set defaultArgumentListString(String value) { - _defaultArgumentListString = value; - } + String? defaultArgumentListString; /// Pairs of offsets and lengths describing 'defaultArgumentListString' text /// ranges suitable for use by clients to set up linked edits of default @@ -4636,80 +3787,35 @@ class AvailableSuggestion implements HasToJson { /// y', the corresponding text range [0, 1, 3, 1], indicates two text ranges /// of length 1, starting at offsets 0 and 3. Clients can use these ranges to /// treat the 'x' and 'y' values specially for linked edits. - List get defaultArgumentListTextRanges => _defaultArgumentListTextRanges; - - /// Pairs of offsets and lengths describing 'defaultArgumentListString' text - /// ranges suitable for use by clients to set up linked edits of default - /// argument source contents. For example, given an argument list string 'x, - /// y', the corresponding text range [0, 1, 3, 1], indicates two text ranges - /// of length 1, starting at offsets 0 and 3. Clients can use these ranges to - /// treat the 'x' and 'y' values specially for linked edits. - set defaultArgumentListTextRanges(List value) { - _defaultArgumentListTextRanges = value; - } + List? defaultArgumentListTextRanges; /// If the element is an executable, the names of the formal parameters of /// all kinds - required, optional positional, and optional named. The names /// of positional parameters are empty strings. Omitted if the element is not /// an executable. - List get parameterNames => _parameterNames; - - /// If the element is an executable, the names of the formal parameters of - /// all kinds - required, optional positional, and optional named. The names - /// of positional parameters are empty strings. Omitted if the element is not - /// an executable. - set parameterNames(List value) { - _parameterNames = value; - } + List? parameterNames; /// If the element is an executable, the declared types of the formal /// parameters of all kinds - required, optional positional, and optional /// named. Omitted if the element is not an executable. - List get parameterTypes => _parameterTypes; - - /// If the element is an executable, the declared types of the formal - /// parameters of all kinds - required, optional positional, and optional - /// named. Omitted if the element is not an executable. - set parameterTypes(List value) { - _parameterTypes = value; - } + List? parameterTypes; /// This field is set if the relevance of this suggestion might be changed /// depending on where completion is requested. - List get relevanceTags => _relevanceTags; + List? relevanceTags; - /// This field is set if the relevance of this suggestion might be changed - /// depending on where completion is requested. - set relevanceTags(List value) { - _relevanceTags = value; - } + int? requiredParameterCount; - int get requiredParameterCount => _requiredParameterCount; - - set requiredParameterCount(int value) { - _requiredParameterCount = value; - } - - AvailableSuggestion(String label, String declaringLibraryUri, Element element, - {String defaultArgumentListString, - List defaultArgumentListTextRanges, - List parameterNames, - List parameterTypes, - List relevanceTags, - int requiredParameterCount}) { - this.label = label; - this.declaringLibraryUri = declaringLibraryUri; - this.element = element; - this.defaultArgumentListString = defaultArgumentListString; - this.defaultArgumentListTextRanges = defaultArgumentListTextRanges; - this.parameterNames = parameterNames; - this.parameterTypes = parameterTypes; - this.relevanceTags = relevanceTags; - this.requiredParameterCount = requiredParameterCount; - } + AvailableSuggestion(this.label, this.declaringLibraryUri, this.element, + {this.defaultArgumentListString, + this.defaultArgumentListTextRanges, + this.parameterNames, + this.parameterTypes, + this.relevanceTags, + this.requiredParameterCount}); factory AvailableSuggestion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String label; @@ -4732,35 +3838,35 @@ class AvailableSuggestion implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'element'); } - String defaultArgumentListString; + String? defaultArgumentListString; if (json.containsKey('defaultArgumentListString')) { defaultArgumentListString = jsonDecoder.decodeString( jsonPath + '.defaultArgumentListString', json['defaultArgumentListString']); } - List defaultArgumentListTextRanges; + List? defaultArgumentListTextRanges; if (json.containsKey('defaultArgumentListTextRanges')) { defaultArgumentListTextRanges = jsonDecoder.decodeList( jsonPath + '.defaultArgumentListTextRanges', json['defaultArgumentListTextRanges'], jsonDecoder.decodeInt); } - List parameterNames; + List? parameterNames; if (json.containsKey('parameterNames')) { parameterNames = jsonDecoder.decodeList(jsonPath + '.parameterNames', json['parameterNames'], jsonDecoder.decodeString); } - List parameterTypes; + List? parameterTypes; if (json.containsKey('parameterTypes')) { parameterTypes = jsonDecoder.decodeList(jsonPath + '.parameterTypes', json['parameterTypes'], jsonDecoder.decodeString); } - List relevanceTags; + List? relevanceTags; if (json.containsKey('relevanceTags')) { relevanceTags = jsonDecoder.decodeList(jsonPath + '.relevanceTags', json['relevanceTags'], jsonDecoder.decodeString); } - int requiredParameterCount; + int? requiredParameterCount; if (json.containsKey('requiredParameterCount')) { requiredParameterCount = jsonDecoder.decodeInt( jsonPath + '.requiredParameterCount', @@ -4779,26 +3885,32 @@ class AvailableSuggestion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['label'] = label; result['declaringLibraryUri'] = declaringLibraryUri; result['element'] = element.toJson(); + var defaultArgumentListString = this.defaultArgumentListString; if (defaultArgumentListString != null) { result['defaultArgumentListString'] = defaultArgumentListString; } + var defaultArgumentListTextRanges = this.defaultArgumentListTextRanges; if (defaultArgumentListTextRanges != null) { result['defaultArgumentListTextRanges'] = defaultArgumentListTextRanges; } + var parameterNames = this.parameterNames; if (parameterNames != null) { result['parameterNames'] = parameterNames; } + var parameterTypes = this.parameterTypes; if (parameterTypes != null) { result['parameterTypes'] = parameterTypes; } + var relevanceTags = this.relevanceTags; if (relevanceTags != null) { result['relevanceTags'] = relevanceTags; } + var requiredParameterCount = this.requiredParameterCount; if (requiredParameterCount != null) { result['requiredParameterCount'] = requiredParameterCount; } @@ -4854,45 +3966,18 @@ class AvailableSuggestion implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AvailableSuggestionSet implements HasToJson { - int _id; - - String _uri; - - List _items; - /// The id associated with the library. - int get id => _id; - - /// The id associated with the library. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The URI of the library. - String get uri => _uri; + String uri; - /// The URI of the library. - set uri(String value) { - assert(value != null); - _uri = value; - } + List items; - List get items => _items; - - set items(List value) { - assert(value != null); - _items = value; - } - - AvailableSuggestionSet(int id, String uri, List items) { - this.id = id; - this.uri = uri; - this.items = items; - } + AvailableSuggestionSet(this.id, this.uri, this.items); factory AvailableSuggestionSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int id; @@ -4912,7 +3997,7 @@ class AvailableSuggestionSet implements HasToJson { items = jsonDecoder.decodeList( jsonPath + '.items', json['items'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AvailableSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'items'); @@ -4924,8 +4009,8 @@ class AvailableSuggestionSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['uri'] = uri; result['items'] = @@ -4966,35 +4051,16 @@ class AvailableSuggestionSet implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class BulkFix implements HasToJson { - String _path; - - List _fixes; - /// The path of the library. - String get path => _path; - - /// The path of the library. - set path(String value) { - assert(value != null); - _path = value; - } + String path; /// A list of bulk fix details. - List get fixes => _fixes; + List fixes; - /// A list of bulk fix details. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - BulkFix(String path, List fixes) { - this.path = path; - this.fixes = fixes; - } + BulkFix(this.path, this.fixes); factory BulkFix.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String path; @@ -5008,7 +4074,7 @@ class BulkFix implements HasToJson { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => BulkFixDetail.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -5020,8 +4086,8 @@ class BulkFix implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['path'] = path; result['fixes'] = fixes.map((BulkFixDetail value) => value.toJson()).toList(); @@ -5059,37 +4125,17 @@ class BulkFix implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class BulkFixDetail implements HasToJson { - String _code; - - int _occurrences; - /// The code of the diagnostic associated with the fix. - String get code => _code; - - /// The code of the diagnostic associated with the fix. - set code(String value) { - assert(value != null); - _code = value; - } + String code; /// The number times the associated diagnostic was fixed in the associated /// source edit. - int get occurrences => _occurrences; + int occurrences; - /// The number times the associated diagnostic was fixed in the associated - /// source edit. - set occurrences(int value) { - assert(value != null); - _occurrences = value; - } - - BulkFixDetail(String code, int occurrences) { - this.code = code; - this.occurrences = occurrences; - } + BulkFixDetail(this.code, this.occurrences); factory BulkFixDetail.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String code; @@ -5112,8 +4158,8 @@ class BulkFixDetail implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['code'] = code; result['occurrences'] = occurrences; return result; @@ -5149,49 +4195,20 @@ class BulkFixDetail implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ClosingLabel implements HasToJson { - int _offset; - - int _length; - - String _label; - /// The offset of the construct being labelled. - int get offset => _offset; - - /// The offset of the construct being labelled. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the whole construct to be labelled. - int get length => _length; - - /// The length of the whole construct to be labelled. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The label associated with this range that should be displayed to the /// user. - String get label => _label; + String label; - /// The label associated with this range that should be displayed to the - /// user. - set label(String value) { - assert(value != null); - _label = value; - } - - ClosingLabel(int offset, int length, String label) { - this.offset = offset; - this.length = length; - this.label = label; - } + ClosingLabel(this.offset, this.length, this.label); factory ClosingLabel.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -5219,8 +4236,8 @@ class ClosingLabel implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['label'] = label; @@ -5259,48 +4276,29 @@ class ClosingLabel implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionAvailableSuggestionsParams implements HasToJson { - List _changedLibraries; - - List _removedLibraries; - /// A list of pre-computed, potential completions coming from this set of /// completion suggestions. - List get changedLibraries => _changedLibraries; - - /// A list of pre-computed, potential completions coming from this set of - /// completion suggestions. - set changedLibraries(List value) { - _changedLibraries = value; - } + List? changedLibraries; /// A list of library ids that no longer apply. - List get removedLibraries => _removedLibraries; - - /// A list of library ids that no longer apply. - set removedLibraries(List value) { - _removedLibraries = value; - } + List? removedLibraries; CompletionAvailableSuggestionsParams( - {List changedLibraries, - List removedLibraries}) { - this.changedLibraries = changedLibraries; - this.removedLibraries = removedLibraries; - } + {this.changedLibraries, this.removedLibraries}); factory CompletionAvailableSuggestionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List changedLibraries; + List? changedLibraries; if (json.containsKey('changedLibraries')) { changedLibraries = jsonDecoder.decodeList( jsonPath + '.changedLibraries', json['changedLibraries'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AvailableSuggestionSet.fromJson(jsonDecoder, jsonPath, json)); } - List removedLibraries; + List? removedLibraries; if (json.containsKey('removedLibraries')) { removedLibraries = jsonDecoder.decodeList( jsonPath + '.removedLibraries', @@ -5323,13 +4321,15 @@ class CompletionAvailableSuggestionsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var changedLibraries = this.changedLibraries; if (changedLibraries != null) { result['changedLibraries'] = changedLibraries .map((AvailableSuggestionSet value) => value.toJson()) .toList(); } + var removedLibraries = this.removedLibraries; if (removedLibraries != null) { result['removedLibraries'] = removedLibraries; } @@ -5372,35 +4372,16 @@ class CompletionAvailableSuggestionsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionExistingImportsParams implements HasToJson { - String _file; - - ExistingImports _imports; - /// The defining file of the library. - String get file => _file; - - /// The defining file of the library. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The existing imports in the library. - ExistingImports get imports => _imports; + ExistingImports imports; - /// The existing imports in the library. - set imports(ExistingImports value) { - assert(value != null); - _imports = value; - } - - CompletionExistingImportsParams(String file, ExistingImports imports) { - this.file = file; - this.imports = imports; - } + CompletionExistingImportsParams(this.file, this.imports); factory CompletionExistingImportsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5430,8 +4411,8 @@ class CompletionExistingImportsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['imports'] = imports.toJson(); return result; @@ -5472,64 +4453,25 @@ class CompletionExistingImportsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionDetailsParams implements RequestParams { - String _file; - - int _id; - - String _label; - - int _offset; - /// The path of the file into which this completion is being inserted. - String get file => _file; - - /// The path of the file into which this completion is being inserted. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The identifier of the AvailableSuggestionSet containing the selected /// label. - int get id => _id; - - /// The identifier of the AvailableSuggestionSet containing the selected - /// label. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The label from the AvailableSuggestionSet with the `id` for which /// insertion information is requested. - String get label => _label; - - /// The label from the AvailableSuggestionSet with the `id` for which - /// insertion information is requested. - set label(String value) { - assert(value != null); - _label = value; - } + String label; /// The offset in the file where the completion will be inserted. - int get offset => _offset; - - /// The offset in the file where the completion will be inserted. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; CompletionGetSuggestionDetailsParams( - String file, int id, String label, int offset) { - this.file = file; - this.id = id; - this.label = label; - this.offset = offset; - } + this.file, this.id, this.label, this.offset); factory CompletionGetSuggestionDetailsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5569,8 +4511,8 @@ class CompletionGetSuggestionDetailsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['id'] = id; result['label'] = label; @@ -5617,39 +4559,18 @@ class CompletionGetSuggestionDetailsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionDetailsResult implements ResponseResult { - String _completion; - - SourceChange _change; - /// The full text to insert, including any optional import prefix. - String get completion => _completion; - - /// The full text to insert, including any optional import prefix. - set completion(String value) { - assert(value != null); - _completion = value; - } + String completion; /// A change for the client to apply in case the library containing the /// accepted completion suggestion needs to be imported. The field will be /// omitted if there are no additional changes that need to be made. - SourceChange get change => _change; + SourceChange? change; - /// A change for the client to apply in case the library containing the - /// accepted completion suggestion needs to be imported. The field will be - /// omitted if there are no additional changes that need to be made. - set change(SourceChange value) { - _change = value; - } - - CompletionGetSuggestionDetailsResult(String completion, - {SourceChange change}) { - this.completion = completion; - this.change = change; - } + CompletionGetSuggestionDetailsResult(this.completion, {this.change}); factory CompletionGetSuggestionDetailsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String completion; @@ -5659,7 +4580,7 @@ class CompletionGetSuggestionDetailsResult implements ResponseResult { } else { throw jsonDecoder.mismatch(jsonPath, 'completion'); } - SourceChange change; + SourceChange? change; if (json.containsKey('change')) { change = SourceChange.fromJson( jsonDecoder, jsonPath + '.change', json['change']); @@ -5679,9 +4600,10 @@ class CompletionGetSuggestionDetailsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['completion'] = completion; + var change = this.change; if (change != null) { result['change'] = change.toJson(); } @@ -5722,35 +4644,16 @@ class CompletionGetSuggestionDetailsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionsParams implements RequestParams { - String _file; - - int _offset; - /// The file containing the point at which suggestions are to be made. - String get file => _file; - - /// The file containing the point at which suggestions are to be made. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset within the file at which suggestions are to be made. - int get offset => _offset; + int offset; - /// The offset within the file at which suggestions are to be made. - set offset(int value) { - assert(value != null); - _offset = value; - } - - CompletionGetSuggestionsParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + CompletionGetSuggestionsParams(this.file, this.offset); factory CompletionGetSuggestionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5778,8 +4681,8 @@ class CompletionGetSuggestionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -5818,23 +4721,13 @@ class CompletionGetSuggestionsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionsResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this completion request. - String get id => _id; + String id; - /// The identifier used to associate results with this completion request. - set id(String value) { - assert(value != null); - _id = value; - } - - CompletionGetSuggestionsResult(String id) { - this.id = id; - } + CompletionGetSuggestionsResult(this.id); factory CompletionGetSuggestionsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -5858,8 +4751,8 @@ class CompletionGetSuggestionsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -5896,29 +4789,16 @@ class CompletionGetSuggestionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class CompletionRegisterLibraryPathsParams implements RequestParams { - List _paths; - /// A list of objects each containing a path and the additional libraries /// from which the client is interested in receiving completion suggestions. /// If one configured path is beneath another, the descendent will override /// the ancestors' configured libraries of interest. - List get paths => _paths; + List paths; - /// A list of objects each containing a path and the additional libraries - /// from which the client is interested in receiving completion suggestions. - /// If one configured path is beneath another, the descendent will override - /// the ancestors' configured libraries of interest. - set paths(List value) { - assert(value != null); - _paths = value; - } - - CompletionRegisterLibraryPathsParams(List paths) { - this.paths = paths; - } + CompletionRegisterLibraryPathsParams(this.paths); factory CompletionRegisterLibraryPathsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List paths; @@ -5926,7 +4806,7 @@ class CompletionRegisterLibraryPathsParams implements RequestParams { paths = jsonDecoder.decodeList( jsonPath + '.paths', json['paths'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => LibraryPathSet.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'paths'); @@ -5944,8 +4824,8 @@ class CompletionRegisterLibraryPathsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['paths'] = paths.map((LibraryPathSet value) => value.toJson()).toList(); return result; @@ -5981,7 +4861,7 @@ class CompletionRegisterLibraryPathsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class CompletionRegisterLibraryPathsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -6018,131 +4898,48 @@ class CompletionRegisterLibraryPathsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class CompletionResultsParams implements HasToJson { - String _id; - - int _replacementOffset; - - int _replacementLength; - - List _results; - - bool _isLast; - - String _libraryFile; - - List _includedSuggestionSets; - - List _includedElementKinds; - - List _includedSuggestionRelevanceTags; - /// The id associated with the completion. - String get id => _id; - - /// The id associated with the completion. - set id(String value) { - assert(value != null); - _id = value; - } + String id; /// The offset of the start of the text to be replaced. This will be /// different than the offset used to request the completion suggestions if /// there was a portion of an identifier before the original offset. In /// particular, the replacementOffset will be the offset of the beginning of /// said identifier. - int get replacementOffset => _replacementOffset; - - /// The offset of the start of the text to be replaced. This will be - /// different than the offset used to request the completion suggestions if - /// there was a portion of an identifier before the original offset. In - /// particular, the replacementOffset will be the offset of the beginning of - /// said identifier. - set replacementOffset(int value) { - assert(value != null); - _replacementOffset = value; - } + int replacementOffset; /// The length of the text to be replaced if the remainder of the identifier /// containing the cursor is to be replaced when the suggestion is applied /// (that is, the number of characters in the existing identifier). - int get replacementLength => _replacementLength; - - /// The length of the text to be replaced if the remainder of the identifier - /// containing the cursor is to be replaced when the suggestion is applied - /// (that is, the number of characters in the existing identifier). - set replacementLength(int value) { - assert(value != null); - _replacementLength = value; - } + int replacementLength; /// The completion suggestions being reported. The notification contains all /// possible completions at the requested cursor position, even those that do /// not match the characters the user has already typed. This allows the /// client to respond to further keystrokes from the user without having to /// make additional requests. - List get results => _results; - - /// The completion suggestions being reported. The notification contains all - /// possible completions at the requested cursor position, even those that do - /// not match the characters the user has already typed. This allows the - /// client to respond to further keystrokes from the user without having to - /// make additional requests. - set results(List value) { - assert(value != null); - _results = value; - } + List results; /// True if this is that last set of results that will be returned for the /// indicated completion. - bool get isLast => _isLast; - - /// True if this is that last set of results that will be returned for the - /// indicated completion. - set isLast(bool value) { - assert(value != null); - _isLast = value; - } + bool isLast; /// The library file that contains the file where completion was requested. /// The client might use it for example together with the existingImports /// notification to filter out available suggestions. If there were changes /// to existing imports in the library, the corresponding existingImports /// notification will be sent before the completion notification. - String get libraryFile => _libraryFile; - - /// The library file that contains the file where completion was requested. - /// The client might use it for example together with the existingImports - /// notification to filter out available suggestions. If there were changes - /// to existing imports in the library, the corresponding existingImports - /// notification will be sent before the completion notification. - set libraryFile(String value) { - _libraryFile = value; - } + String? libraryFile; /// References to AvailableSuggestionSet objects previously sent to the /// client. The client can include applicable names from the referenced /// library in code completion suggestions. - List get includedSuggestionSets => - _includedSuggestionSets; - - /// References to AvailableSuggestionSet objects previously sent to the - /// client. The client can include applicable names from the referenced - /// library in code completion suggestions. - set includedSuggestionSets(List value) { - _includedSuggestionSets = value; - } + List? includedSuggestionSets; /// The client is expected to check this list against the ElementKind sent in /// IncludedSuggestionSet to decide whether or not these symbols should /// should be presented to the user. - List get includedElementKinds => _includedElementKinds; - - /// The client is expected to check this list against the ElementKind sent in - /// IncludedSuggestionSet to decide whether or not these symbols should - /// should be presented to the user. - set includedElementKinds(List value) { - _includedElementKinds = value; - } + List? includedElementKinds; /// The client is expected to check this list against the values of the field /// relevanceTags of AvailableSuggestion to decide if the suggestion should @@ -6152,41 +4949,17 @@ class CompletionResultsParams implements HasToJson { /// /// If an AvailableSuggestion has relevance tags that match more than one /// IncludedSuggestionRelevanceTag, the maximum relevance boost is used. - List get includedSuggestionRelevanceTags => - _includedSuggestionRelevanceTags; + List? includedSuggestionRelevanceTags; - /// The client is expected to check this list against the values of the field - /// relevanceTags of AvailableSuggestion to decide if the suggestion should - /// be given a different relevance than the IncludedSuggestionSet that - /// contains it. This might be used for example to give higher relevance to - /// suggestions of matching types. - /// - /// If an AvailableSuggestion has relevance tags that match more than one - /// IncludedSuggestionRelevanceTag, the maximum relevance boost is used. - set includedSuggestionRelevanceTags( - List value) { - _includedSuggestionRelevanceTags = value; - } - - CompletionResultsParams(String id, int replacementOffset, - int replacementLength, List results, bool isLast, - {String libraryFile, - List includedSuggestionSets, - List includedElementKinds, - List includedSuggestionRelevanceTags}) { - this.id = id; - this.replacementOffset = replacementOffset; - this.replacementLength = replacementLength; - this.results = results; - this.isLast = isLast; - this.libraryFile = libraryFile; - this.includedSuggestionSets = includedSuggestionSets; - this.includedElementKinds = includedElementKinds; - this.includedSuggestionRelevanceTags = includedSuggestionRelevanceTags; - } + CompletionResultsParams(this.id, this.replacementOffset, + this.replacementLength, this.results, this.isLast, + {this.libraryFile, + this.includedSuggestionSets, + this.includedElementKinds, + this.includedSuggestionRelevanceTags}); factory CompletionResultsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -6214,7 +4987,7 @@ class CompletionResultsParams implements HasToJson { results = jsonDecoder.decodeList( jsonPath + '.results', json['results'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'results'); @@ -6225,33 +4998,33 @@ class CompletionResultsParams implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'isLast'); } - String libraryFile; + String? libraryFile; if (json.containsKey('libraryFile')) { libraryFile = jsonDecoder.decodeString( jsonPath + '.libraryFile', json['libraryFile']); } - List includedSuggestionSets; + List? includedSuggestionSets; if (json.containsKey('includedSuggestionSets')) { includedSuggestionSets = jsonDecoder.decodeList( jsonPath + '.includedSuggestionSets', json['includedSuggestionSets'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => IncludedSuggestionSet.fromJson(jsonDecoder, jsonPath, json)); } - List includedElementKinds; + List? includedElementKinds; if (json.containsKey('includedElementKinds')) { includedElementKinds = jsonDecoder.decodeList( jsonPath + '.includedElementKinds', json['includedElementKinds'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ElementKind.fromJson(jsonDecoder, jsonPath, json)); } - List includedSuggestionRelevanceTags; + List? includedSuggestionRelevanceTags; if (json.containsKey('includedSuggestionRelevanceTags')) { includedSuggestionRelevanceTags = jsonDecoder.decodeList( jsonPath + '.includedSuggestionRelevanceTags', json['includedSuggestionRelevanceTags'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => IncludedSuggestionRelevanceTag.fromJson( jsonDecoder, jsonPath, json)); } @@ -6272,27 +5045,31 @@ class CompletionResultsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['replacementOffset'] = replacementOffset; result['replacementLength'] = replacementLength; result['results'] = results.map((CompletionSuggestion value) => value.toJson()).toList(); result['isLast'] = isLast; + var libraryFile = this.libraryFile; if (libraryFile != null) { result['libraryFile'] = libraryFile; } + var includedSuggestionSets = this.includedSuggestionSets; if (includedSuggestionSets != null) { result['includedSuggestionSets'] = includedSuggestionSets .map((IncludedSuggestionSet value) => value.toJson()) .toList(); } + var includedElementKinds = this.includedElementKinds; if (includedElementKinds != null) { result['includedElementKinds'] = includedElementKinds .map((ElementKind value) => value.toJson()) .toList(); } + var includedSuggestionRelevanceTags = this.includedSuggestionRelevanceTags; if (includedSuggestionRelevanceTags != null) { result['includedSuggestionRelevanceTags'] = includedSuggestionRelevanceTags @@ -6387,7 +5164,7 @@ class CompletionService implements Enum { } factory CompletionService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return CompletionService(json); @@ -6412,23 +5189,13 @@ class CompletionService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class CompletionSetSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - CompletionSetSubscriptionsParams(List subscriptions) { - this.subscriptions = subscriptions; - } + CompletionSetSubscriptionsParams(this.subscriptions); factory CompletionSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -6436,7 +5203,7 @@ class CompletionSetSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => CompletionService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -6454,8 +5221,8 @@ class CompletionSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions.map((CompletionService value) => value.toJson()).toList(); return result; @@ -6491,7 +5258,7 @@ class CompletionSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class CompletionSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -6524,72 +5291,26 @@ class CompletionSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ContextData implements HasToJson { - String _name; - - int _explicitFileCount; - - int _implicitFileCount; - - int _workItemQueueLength; - - List _cacheEntryExceptions; - /// The name of the context. - String get name => _name; - - /// The name of the context. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// Explicitly analyzed files. - int get explicitFileCount => _explicitFileCount; - - /// Explicitly analyzed files. - set explicitFileCount(int value) { - assert(value != null); - _explicitFileCount = value; - } + int explicitFileCount; /// Implicitly analyzed files. - int get implicitFileCount => _implicitFileCount; - - /// Implicitly analyzed files. - set implicitFileCount(int value) { - assert(value != null); - _implicitFileCount = value; - } + int implicitFileCount; /// The number of work items in the queue. - int get workItemQueueLength => _workItemQueueLength; - - /// The number of work items in the queue. - set workItemQueueLength(int value) { - assert(value != null); - _workItemQueueLength = value; - } + int workItemQueueLength; /// Exceptions associated with cache entries. - List get cacheEntryExceptions => _cacheEntryExceptions; + List cacheEntryExceptions; - /// Exceptions associated with cache entries. - set cacheEntryExceptions(List value) { - assert(value != null); - _cacheEntryExceptions = value; - } - - ContextData(String name, int explicitFileCount, int implicitFileCount, - int workItemQueueLength, List cacheEntryExceptions) { - this.name = name; - this.explicitFileCount = explicitFileCount; - this.implicitFileCount = implicitFileCount; - this.workItemQueueLength = workItemQueueLength; - this.cacheEntryExceptions = cacheEntryExceptions; - } + ContextData(this.name, this.explicitFileCount, this.implicitFileCount, + this.workItemQueueLength, this.cacheEntryExceptions); factory ContextData.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -6636,8 +5357,8 @@ class ContextData implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['explicitFileCount'] = explicitFileCount; result['implicitFileCount'] = implicitFileCount; @@ -6759,34 +5480,16 @@ class ConvertMethodToGetterOptions extends RefactoringOptions /// /// Clients may not extend, implement or mix-in this class. class DartFix implements HasToJson { - String _name; - - String _description; - /// The name of the fix. - String get name => _name; - - /// The name of the fix. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// A human readable description of the fix. - String get description => _description; + String? description; - /// A human readable description of the fix. - set description(String value) { - _description = value; - } - - DartFix(String name, {String description}) { - this.name = name; - this.description = description; - } + DartFix(this.name, {this.description}); factory DartFix.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -6795,7 +5498,7 @@ class DartFix implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - String description; + String? description; if (json.containsKey('description')) { description = jsonDecoder.decodeString( jsonPath + '.description', json['description']); @@ -6807,9 +5510,10 @@ class DartFix implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; + var description = this.description; if (description != null) { result['description'] = description; } @@ -6845,34 +5549,16 @@ class DartFix implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class DartFixSuggestion implements HasToJson { - String _description; - - Location _location; - /// A human readable description of the suggested change. - String get description => _description; - - /// A human readable description of the suggested change. - set description(String value) { - assert(value != null); - _description = value; - } + String description; /// The location of the suggested change. - Location get location => _location; + Location? location; - /// The location of the suggested change. - set location(Location value) { - _location = value; - } - - DartFixSuggestion(String description, {Location location}) { - this.description = description; - this.location = location; - } + DartFixSuggestion(this.description, {this.location}); factory DartFixSuggestion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String description; @@ -6882,7 +5568,7 @@ class DartFixSuggestion implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'description'); } - Location location; + Location? location; if (json.containsKey('location')) { location = Location.fromJson( jsonDecoder, jsonPath + '.location', json['location']); @@ -6894,9 +5580,10 @@ class DartFixSuggestion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['description'] = description; + var location = this.location; if (location != null) { result['location'] = location.toJson(); } @@ -6928,7 +5615,7 @@ class DartFixSuggestion implements HasToJson { /// Clients may not extend, implement or mix-in this class. class DiagnosticGetDiagnosticsParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -6957,23 +5644,13 @@ class DiagnosticGetDiagnosticsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class DiagnosticGetDiagnosticsResult implements ResponseResult { - List _contexts; - /// The list of analysis contexts. - List get contexts => _contexts; + List contexts; - /// The list of analysis contexts. - set contexts(List value) { - assert(value != null); - _contexts = value; - } - - DiagnosticGetDiagnosticsResult(List contexts) { - this.contexts = contexts; - } + DiagnosticGetDiagnosticsResult(this.contexts); factory DiagnosticGetDiagnosticsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List contexts; @@ -6981,7 +5658,7 @@ class DiagnosticGetDiagnosticsResult implements ResponseResult { contexts = jsonDecoder.decodeList( jsonPath + '.contexts', json['contexts'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ContextData.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'contexts'); @@ -7001,8 +5678,8 @@ class DiagnosticGetDiagnosticsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['contexts'] = contexts.map((ContextData value) => value.toJson()).toList(); return result; @@ -7038,7 +5715,7 @@ class DiagnosticGetDiagnosticsResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class DiagnosticGetServerPortParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -7067,23 +5744,13 @@ class DiagnosticGetServerPortParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class DiagnosticGetServerPortResult implements ResponseResult { - int _port; - /// The diagnostic server port. - int get port => _port; + int port; - /// The diagnostic server port. - set port(int value) { - assert(value != null); - _port = value; - } - - DiagnosticGetServerPortResult(int port) { - this.port = port; - } + DiagnosticGetServerPortResult(this.port); factory DiagnosticGetServerPortResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int port; @@ -7107,8 +5774,8 @@ class DiagnosticGetServerPortResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['port'] = port; return result; } @@ -7146,10 +5813,6 @@ class DiagnosticGetServerPortResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditBulkFixesParams implements RequestParams { - List _included; - - bool _inTestMode; - /// A list of the files and directories for which edits should be suggested. /// /// If a request is made with a path that is invalid, e.g. is not absolute @@ -7158,20 +5821,7 @@ class EditBulkFixesParams implements RequestParams { /// is not currently subject to analysis (e.g. because it is not associated /// with any analysis root specified to analysis.setAnalysisRoots), an error /// of type FILE_NOT_ANALYZED will be generated. - List get included => _included; - - /// A list of the files and directories for which edits should be suggested. - /// - /// If a request is made with a path that is invalid, e.g. is not absolute - /// and normalized, an error of type INVALID_FILE_PATH_FORMAT will be - /// generated. If a request is made for a file which does not exist, or which - /// is not currently subject to analysis (e.g. because it is not associated - /// with any analysis root specified to analysis.setAnalysisRoots), an error - /// of type FILE_NOT_ANALYZED will be generated. - set included(List value) { - assert(value != null); - _included = value; - } + List included; /// A flag indicating whether the bulk fixes are being run in test mode. The /// only difference is that in test mode the fix processor will look for a @@ -7179,25 +5829,12 @@ class EditBulkFixesParams implements RequestParams { /// compute the fixes when data-driven fixes are being considered. /// /// If this field is omitted the flag defaults to false. - bool get inTestMode => _inTestMode; + bool? inTestMode; - /// A flag indicating whether the bulk fixes are being run in test mode. The - /// only difference is that in test mode the fix processor will look for a - /// configuration file that can modify the content of the data file used to - /// compute the fixes when data-driven fixes are being considered. - /// - /// If this field is omitted the flag defaults to false. - set inTestMode(bool value) { - _inTestMode = value; - } - - EditBulkFixesParams(List included, {bool inTestMode}) { - this.included = included; - this.inTestMode = inTestMode; - } + EditBulkFixesParams(this.included, {this.inTestMode}); factory EditBulkFixesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List included; @@ -7207,7 +5844,7 @@ class EditBulkFixesParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'included'); } - bool inTestMode; + bool? inTestMode; if (json.containsKey('inTestMode')) { inTestMode = jsonDecoder.decodeBool( jsonPath + '.inTestMode', json['inTestMode']); @@ -7224,9 +5861,10 @@ class EditBulkFixesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['included'] = included; + var inTestMode = this.inTestMode; if (inTestMode != null) { result['inTestMode'] = inTestMode; } @@ -7269,35 +5907,16 @@ class EditBulkFixesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditBulkFixesResult implements ResponseResult { - List _edits; - - List _details; - /// A list of source edits to apply the recommended changes. - List get edits => _edits; - - /// A list of source edits to apply the recommended changes. - set edits(List value) { - assert(value != null); - _edits = value; - } + List edits; /// Details that summarize the fixes associated with the recommended changes. - List get details => _details; + List details; - /// Details that summarize the fixes associated with the recommended changes. - set details(List value) { - assert(value != null); - _details = value; - } - - EditBulkFixesResult(List edits, List details) { - this.edits = edits; - this.details = details; - } + EditBulkFixesResult(this.edits, this.details); factory EditBulkFixesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List edits; @@ -7305,7 +5924,7 @@ class EditBulkFixesResult implements ResponseResult { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -7315,7 +5934,7 @@ class EditBulkFixesResult implements ResponseResult { details = jsonDecoder.decodeList( jsonPath + '.details', json['details'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => BulkFix.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'details'); @@ -7334,8 +5953,8 @@ class EditBulkFixesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edits'] = edits.map((SourceFileEdit value) => value.toJson()).toList(); result['details'] = details.map((BulkFix value) => value.toJson()).toList(); @@ -7382,18 +6001,6 @@ class EditBulkFixesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditDartfixParams implements RequestParams { - List _included; - - List _includedFixes; - - bool _includePedanticFixes; - - List _excludedFixes; - - int _port; - - String _outputDir; - /// A list of the files and directories for which edits should be suggested. /// /// If a request is made with a path that is invalid, e.g. is not absolute @@ -7402,89 +6009,38 @@ class EditDartfixParams implements RequestParams { /// is not currently subject to analysis (e.g. because it is not associated /// with any analysis root specified to analysis.setAnalysisRoots), an error /// of type FILE_NOT_ANALYZED will be generated. - List get included => _included; - - /// A list of the files and directories for which edits should be suggested. - /// - /// If a request is made with a path that is invalid, e.g. is not absolute - /// and normalized, an error of type INVALID_FILE_PATH_FORMAT will be - /// generated. If a request is made for a file which does not exist, or which - /// is not currently subject to analysis (e.g. because it is not associated - /// with any analysis root specified to analysis.setAnalysisRoots), an error - /// of type FILE_NOT_ANALYZED will be generated. - set included(List value) { - assert(value != null); - _included = value; - } + List included; /// A list of names indicating which fixes should be applied. /// /// If a name is specified that does not match the name of a known fix, an /// error of type UNKNOWN_FIX will be generated. - List get includedFixes => _includedFixes; - - /// A list of names indicating which fixes should be applied. - /// - /// If a name is specified that does not match the name of a known fix, an - /// error of type UNKNOWN_FIX will be generated. - set includedFixes(List value) { - _includedFixes = value; - } + List? includedFixes; /// A flag indicating whether "pedantic" fixes should be applied. - bool get includePedanticFixes => _includePedanticFixes; - - /// A flag indicating whether "pedantic" fixes should be applied. - set includePedanticFixes(bool value) { - _includePedanticFixes = value; - } + bool? includePedanticFixes; /// A list of names indicating which fixes should not be applied. /// /// If a name is specified that does not match the name of a known fix, an /// error of type UNKNOWN_FIX will be generated. - List get excludedFixes => _excludedFixes; - - /// A list of names indicating which fixes should not be applied. - /// - /// If a name is specified that does not match the name of a known fix, an - /// error of type UNKNOWN_FIX will be generated. - set excludedFixes(List value) { - _excludedFixes = value; - } + List? excludedFixes; /// Deprecated: This field is now ignored by server. - int get port => _port; + int? port; /// Deprecated: This field is now ignored by server. - set port(int value) { - _port = value; - } + String? outputDir; - /// Deprecated: This field is now ignored by server. - String get outputDir => _outputDir; - - /// Deprecated: This field is now ignored by server. - set outputDir(String value) { - _outputDir = value; - } - - EditDartfixParams(List included, - {List includedFixes, - bool includePedanticFixes, - List excludedFixes, - int port, - String outputDir}) { - this.included = included; - this.includedFixes = includedFixes; - this.includePedanticFixes = includePedanticFixes; - this.excludedFixes = excludedFixes; - this.port = port; - this.outputDir = outputDir; - } + EditDartfixParams(this.included, + {this.includedFixes, + this.includePedanticFixes, + this.excludedFixes, + this.port, + this.outputDir}); factory EditDartfixParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List included; @@ -7494,26 +6050,26 @@ class EditDartfixParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'included'); } - List includedFixes; + List? includedFixes; if (json.containsKey('includedFixes')) { includedFixes = jsonDecoder.decodeList(jsonPath + '.includedFixes', json['includedFixes'], jsonDecoder.decodeString); } - bool includePedanticFixes; + bool? includePedanticFixes; if (json.containsKey('includePedanticFixes')) { includePedanticFixes = jsonDecoder.decodeBool( jsonPath + '.includePedanticFixes', json['includePedanticFixes']); } - List excludedFixes; + List? excludedFixes; if (json.containsKey('excludedFixes')) { excludedFixes = jsonDecoder.decodeList(jsonPath + '.excludedFixes', json['excludedFixes'], jsonDecoder.decodeString); } - int port; + int? port; if (json.containsKey('port')) { port = jsonDecoder.decodeInt(jsonPath + '.port', json['port']); } - String outputDir; + String? outputDir; if (json.containsKey('outputDir')) { outputDir = jsonDecoder.decodeString( jsonPath + '.outputDir', json['outputDir']); @@ -7535,21 +6091,26 @@ class EditDartfixParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['included'] = included; + var includedFixes = this.includedFixes; if (includedFixes != null) { result['includedFixes'] = includedFixes; } + var includePedanticFixes = this.includePedanticFixes; if (includePedanticFixes != null) { result['includePedanticFixes'] = includePedanticFixes; } + var excludedFixes = this.excludedFixes; if (excludedFixes != null) { result['excludedFixes'] = excludedFixes; } + var port = this.port; if (port != null) { result['port'] = port; } + var outputDir = this.outputDir; if (outputDir != null) { result['outputDir'] = outputDir; } @@ -7607,117 +6168,42 @@ class EditDartfixParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditDartfixResult implements ResponseResult { - List _suggestions; - - List _otherSuggestions; - - bool _hasErrors; - - List _edits; - - List _details; - - int _port; - - List _urls; - /// A list of recommended changes that can be automatically made by applying /// the 'edits' included in this response. - List get suggestions => _suggestions; - - /// A list of recommended changes that can be automatically made by applying - /// the 'edits' included in this response. - set suggestions(List value) { - assert(value != null); - _suggestions = value; - } + List suggestions; /// A list of recommended changes that could not be automatically made. - List get otherSuggestions => _otherSuggestions; - - /// A list of recommended changes that could not be automatically made. - set otherSuggestions(List value) { - assert(value != null); - _otherSuggestions = value; - } + List otherSuggestions; /// True if the analyzed source contains errors that might impact the /// correctness of the recommended changes that can be automatically applied. - bool get hasErrors => _hasErrors; - - /// True if the analyzed source contains errors that might impact the - /// correctness of the recommended changes that can be automatically applied. - set hasErrors(bool value) { - assert(value != null); - _hasErrors = value; - } + bool hasErrors; /// A list of source edits to apply the recommended changes. - List get edits => _edits; - - /// A list of source edits to apply the recommended changes. - set edits(List value) { - assert(value != null); - _edits = value; - } + List edits; /// Messages that should be displayed to the user that describe details of /// the fix generation. For example, the messages might (a) point out details /// that users might want to explore before committing the changes or (b) /// describe exceptions that were thrown but that did not stop the fixes from /// being produced. The list will be omitted if it is empty. - List get details => _details; - - /// Messages that should be displayed to the user that describe details of - /// the fix generation. For example, the messages might (a) point out details - /// that users might want to explore before committing the changes or (b) - /// describe exceptions that were thrown but that did not stop the fixes from - /// being produced. The list will be omitted if it is empty. - set details(List value) { - _details = value; - } + List? details; /// The port on which the preview tool will respond to GET requests. The /// field is omitted if a preview was not requested. - int get port => _port; - - /// The port on which the preview tool will respond to GET requests. The - /// field is omitted if a preview was not requested. - set port(int value) { - _port = value; - } + int? port; /// The URLs that users can visit in a browser to see a preview of the /// proposed changes. There is one URL for each of the included file paths. /// The field is omitted if a preview was not requested. - List get urls => _urls; - - /// The URLs that users can visit in a browser to see a preview of the - /// proposed changes. There is one URL for each of the included file paths. - /// The field is omitted if a preview was not requested. - set urls(List value) { - _urls = value; - } + List? urls; EditDartfixResult( - List suggestions, - List otherSuggestions, - bool hasErrors, - List edits, - {List details, - int port, - List urls}) { - this.suggestions = suggestions; - this.otherSuggestions = otherSuggestions; - this.hasErrors = hasErrors; - this.edits = edits; - this.details = details; - this.port = port; - this.urls = urls; - } + this.suggestions, this.otherSuggestions, this.hasErrors, this.edits, + {this.details, this.port, this.urls}); factory EditDartfixResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List suggestions; @@ -7725,7 +6211,7 @@ class EditDartfixResult implements ResponseResult { suggestions = jsonDecoder.decodeList( jsonPath + '.suggestions', json['suggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DartFixSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'suggestions'); @@ -7735,7 +6221,7 @@ class EditDartfixResult implements ResponseResult { otherSuggestions = jsonDecoder.decodeList( jsonPath + '.otherSuggestions', json['otherSuggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DartFixSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'otherSuggestions'); @@ -7752,21 +6238,21 @@ class EditDartfixResult implements ResponseResult { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); } - List details; + List? details; if (json.containsKey('details')) { details = jsonDecoder.decodeList( jsonPath + '.details', json['details'], jsonDecoder.decodeString); } - int port; + int? port; if (json.containsKey('port')) { port = jsonDecoder.decodeInt(jsonPath + '.port', json['port']); } - List urls; + List? urls; if (json.containsKey('urls')) { urls = jsonDecoder.decodeList( jsonPath + '.urls', json['urls'], jsonDecoder.decodeString); @@ -7786,8 +6272,8 @@ class EditDartfixResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['suggestions'] = suggestions.map((DartFixSuggestion value) => value.toJson()).toList(); result['otherSuggestions'] = otherSuggestions @@ -7796,12 +6282,15 @@ class EditDartfixResult implements ResponseResult { result['hasErrors'] = hasErrors; result['edits'] = edits.map((SourceFileEdit value) => value.toJson()).toList(); + var details = this.details; if (details != null) { result['details'] = details; } + var port = this.port; if (port != null) { result['port'] = port; } + var urls = this.urls; if (urls != null) { result['urls'] = urls; } @@ -7858,59 +6347,23 @@ class EditDartfixResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditFormatParams implements RequestParams { - String _file; - - int _selectionOffset; - - int _selectionLength; - - int _lineLength; - /// The file containing the code to be formatted. - String get file => _file; - - /// The file containing the code to be formatted. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the current selection in the file. - int get selectionOffset => _selectionOffset; - - /// The offset of the current selection in the file. - set selectionOffset(int value) { - assert(value != null); - _selectionOffset = value; - } + int selectionOffset; /// The length of the current selection in the file. - int get selectionLength => _selectionLength; - - /// The length of the current selection in the file. - set selectionLength(int value) { - assert(value != null); - _selectionLength = value; - } + int selectionLength; /// The line length to be used by the formatter. - int get lineLength => _lineLength; + int? lineLength; - /// The line length to be used by the formatter. - set lineLength(int value) { - _lineLength = value; - } - - EditFormatParams(String file, int selectionOffset, int selectionLength, - {int lineLength}) { - this.file = file; - this.selectionOffset = selectionOffset; - this.selectionLength = selectionLength; - this.lineLength = lineLength; - } + EditFormatParams(this.file, this.selectionOffset, this.selectionLength, + {this.lineLength}); factory EditFormatParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -7933,7 +6386,7 @@ class EditFormatParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'selectionLength'); } - int lineLength; + int? lineLength; if (json.containsKey('lineLength')) { lineLength = jsonDecoder.decodeInt(jsonPath + '.lineLength', json['lineLength']); @@ -7951,11 +6404,12 @@ class EditFormatParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['selectionOffset'] = selectionOffset; result['selectionLength'] = selectionLength; + var lineLength = this.lineLength; if (lineLength != null) { result['lineLength'] = lineLength; } @@ -8002,50 +6456,20 @@ class EditFormatParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditFormatResult implements ResponseResult { - List _edits; - - int _selectionOffset; - - int _selectionLength; - /// The edit(s) to be applied in order to format the code. The list will be /// empty if the code was already formatted (there are no changes). - List get edits => _edits; - - /// The edit(s) to be applied in order to format the code. The list will be - /// empty if the code was already formatted (there are no changes). - set edits(List value) { - assert(value != null); - _edits = value; - } + List edits; /// The offset of the selection after formatting the code. - int get selectionOffset => _selectionOffset; - - /// The offset of the selection after formatting the code. - set selectionOffset(int value) { - assert(value != null); - _selectionOffset = value; - } + int selectionOffset; /// The length of the selection after formatting the code. - int get selectionLength => _selectionLength; + int selectionLength; - /// The length of the selection after formatting the code. - set selectionLength(int value) { - assert(value != null); - _selectionLength = value; - } - - EditFormatResult( - List edits, int selectionOffset, int selectionLength) { - this.edits = edits; - this.selectionOffset = selectionOffset; - this.selectionLength = selectionLength; - } + EditFormatResult(this.edits, this.selectionOffset, this.selectionLength); factory EditFormatResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List edits; @@ -8053,7 +6477,7 @@ class EditFormatResult implements ResponseResult { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -8086,8 +6510,8 @@ class EditFormatResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edits'] = edits.map((SourceEdit value) => value.toJson()).toList(); result['selectionOffset'] = selectionOffset; result['selectionLength'] = selectionLength; @@ -8133,47 +6557,19 @@ class EditFormatResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetAssistsParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file containing the code for which assists are being requested. - String get file => _file; - - /// The file containing the code for which assists are being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the code for which assists are being requested. - int get offset => _offset; - - /// The offset of the code for which assists are being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the code for which assists are being requested. - int get length => _length; + int length; - /// The length of the code for which assists are being requested. - set length(int value) { - assert(value != null); - _length = value; - } - - EditGetAssistsParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + EditGetAssistsParams(this.file, this.offset, this.length); factory EditGetAssistsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8206,8 +6602,8 @@ class EditGetAssistsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -8250,23 +6646,13 @@ class EditGetAssistsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetAssistsResult implements ResponseResult { - List _assists; - /// The assists that are available at the given location. - List get assists => _assists; + List assists; - /// The assists that are available at the given location. - set assists(List value) { - assert(value != null); - _assists = value; - } - - EditGetAssistsResult(List assists) { - this.assists = assists; - } + EditGetAssistsResult(this.assists); factory EditGetAssistsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List assists; @@ -8274,7 +6660,7 @@ class EditGetAssistsResult implements ResponseResult { assists = jsonDecoder.decodeList( jsonPath + '.assists', json['assists'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceChange.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'assists'); @@ -8293,8 +6679,8 @@ class EditGetAssistsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['assists'] = assists.map((SourceChange value) => value.toJson()).toList(); return result; @@ -8335,47 +6721,19 @@ class EditGetAssistsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetAvailableRefactoringsParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file containing the code on which the refactoring would be based. - String get file => _file; - - /// The file containing the code on which the refactoring would be based. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the code on which the refactoring would be based. - int get offset => _offset; - - /// The offset of the code on which the refactoring would be based. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the code on which the refactoring would be based. - int get length => _length; + int length; - /// The length of the code on which the refactoring would be based. - set length(int value) { - assert(value != null); - _length = value; - } - - EditGetAvailableRefactoringsParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + EditGetAvailableRefactoringsParams(this.file, this.offset, this.length); factory EditGetAvailableRefactoringsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8409,8 +6767,8 @@ class EditGetAvailableRefactoringsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -8453,23 +6811,13 @@ class EditGetAvailableRefactoringsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetAvailableRefactoringsResult implements ResponseResult { - List _kinds; - /// The kinds of refactorings that are valid for the given selection. - List get kinds => _kinds; + List kinds; - /// The kinds of refactorings that are valid for the given selection. - set kinds(List value) { - assert(value != null); - _kinds = value; - } - - EditGetAvailableRefactoringsResult(List kinds) { - this.kinds = kinds; - } + EditGetAvailableRefactoringsResult(this.kinds); factory EditGetAvailableRefactoringsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List kinds; @@ -8477,7 +6825,7 @@ class EditGetAvailableRefactoringsResult implements ResponseResult { kinds = jsonDecoder.decodeList( jsonPath + '.kinds', json['kinds'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringKind.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'kinds'); @@ -8497,8 +6845,8 @@ class EditGetAvailableRefactoringsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kinds'] = kinds.map((RefactoringKind value) => value.toJson()).toList(); return result; @@ -8539,7 +6887,7 @@ class EditGetDartfixInfoParams implements RequestParams { EditGetDartfixInfoParams(); factory EditGetDartfixInfoParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { return EditGetDartfixInfoParams(); @@ -8554,8 +6902,8 @@ class EditGetDartfixInfoParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -8590,23 +6938,13 @@ class EditGetDartfixInfoParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetDartfixInfoResult implements ResponseResult { - List _fixes; - /// A list of fixes that can be specified in an edit.dartfix request. - List get fixes => _fixes; + List fixes; - /// A list of fixes that can be specified in an edit.dartfix request. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - EditGetDartfixInfoResult(List fixes) { - this.fixes = fixes; - } + EditGetDartfixInfoResult(this.fixes); factory EditGetDartfixInfoResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List fixes; @@ -8614,7 +6952,7 @@ class EditGetDartfixInfoResult implements ResponseResult { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DartFix.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -8633,8 +6971,8 @@ class EditGetDartfixInfoResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['fixes'] = fixes.map((DartFix value) => value.toJson()).toList(); return result; } @@ -8672,35 +7010,16 @@ class EditGetDartfixInfoResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetFixesParams implements RequestParams { - String _file; - - int _offset; - /// The file containing the errors for which fixes are being requested. - String get file => _file; - - /// The file containing the errors for which fixes are being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset used to select the errors for which fixes will be returned. - int get offset => _offset; + int offset; - /// The offset used to select the errors for which fixes will be returned. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditGetFixesParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + EditGetFixesParams(this.file, this.offset); factory EditGetFixesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8727,8 +7046,8 @@ class EditGetFixesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -8767,23 +7086,13 @@ class EditGetFixesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetFixesResult implements ResponseResult { - List _fixes; - /// The fixes that are available for the errors at the given offset. - List get fixes => _fixes; + List fixes; - /// The fixes that are available for the errors at the given offset. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - EditGetFixesResult(List fixes) { - this.fixes = fixes; - } + EditGetFixesResult(this.fixes); factory EditGetFixesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List fixes; @@ -8791,7 +7100,7 @@ class EditGetFixesResult implements ResponseResult { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AnalysisErrorFixes.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -8810,8 +7119,8 @@ class EditGetFixesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['fixes'] = fixes.map((AnalysisErrorFixes value) => value.toJson()).toList(); return result; @@ -8852,49 +7161,20 @@ class EditGetFixesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetPostfixCompletionParams implements RequestParams { - String _file; - - String _key; - - int _offset; - /// The file containing the postfix template to be expanded. - String get file => _file; - - /// The file containing the postfix template to be expanded. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The unique name that identifies the template in use. - String get key => _key; - - /// The unique name that identifies the template in use. - set key(String value) { - assert(value != null); - _key = value; - } + String key; /// The offset used to identify the code to which the template will be /// applied. - int get offset => _offset; + int offset; - /// The offset used to identify the code to which the template will be - /// applied. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditGetPostfixCompletionParams(String file, String key, int offset) { - this.file = file; - this.key = key; - this.offset = offset; - } + EditGetPostfixCompletionParams(this.file, this.key, this.offset); factory EditGetPostfixCompletionParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8928,8 +7208,8 @@ class EditGetPostfixCompletionParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['key'] = key; result['offset'] = offset; @@ -8970,23 +7250,13 @@ class EditGetPostfixCompletionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetPostfixCompletionResult implements ResponseResult { - SourceChange _change; - /// The change to be applied in order to complete the statement. - SourceChange get change => _change; + SourceChange change; - /// The change to be applied in order to complete the statement. - set change(SourceChange value) { - assert(value != null); - _change = value; - } - - EditGetPostfixCompletionResult(SourceChange change) { - this.change = change; - } + EditGetPostfixCompletionResult(this.change); factory EditGetPostfixCompletionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceChange change; @@ -9011,8 +7281,8 @@ class EditGetPostfixCompletionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['change'] = change.toJson(); return result; } @@ -9054,94 +7324,35 @@ class EditGetPostfixCompletionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetRefactoringParams implements RequestParams { - RefactoringKind _kind; - - String _file; - - int _offset; - - int _length; - - bool _validateOnly; - - RefactoringOptions _options; - /// The kind of refactoring to be performed. - RefactoringKind get kind => _kind; - - /// The kind of refactoring to be performed. - set kind(RefactoringKind value) { - assert(value != null); - _kind = value; - } + RefactoringKind kind; /// The file containing the code involved in the refactoring. - String get file => _file; - - /// The file containing the code involved in the refactoring. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the region involved in the refactoring. - int get offset => _offset; - - /// The offset of the region involved in the refactoring. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the region involved in the refactoring. - int get length => _length; - - /// The length of the region involved in the refactoring. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// True if the client is only requesting that the values of the options be /// validated and no change be generated. - bool get validateOnly => _validateOnly; - - /// True if the client is only requesting that the values of the options be - /// validated and no change be generated. - set validateOnly(bool value) { - assert(value != null); - _validateOnly = value; - } + bool validateOnly; /// Data used to provide values provided by the user. The structure of the /// data is dependent on the kind of refactoring being performed. The data /// that is expected is documented in the section titled Refactorings, /// labeled as "Options". This field can be omitted if the refactoring does /// not require any options or if the values of those options are not known. - RefactoringOptions get options => _options; + RefactoringOptions? options; - /// Data used to provide values provided by the user. The structure of the - /// data is dependent on the kind of refactoring being performed. The data - /// that is expected is documented in the section titled Refactorings, - /// labeled as "Options". This field can be omitted if the refactoring does - /// not require any options or if the values of those options are not known. - set options(RefactoringOptions value) { - _options = value; - } - - EditGetRefactoringParams(RefactoringKind kind, String file, int offset, - int length, bool validateOnly, - {RefactoringOptions options}) { - this.kind = kind; - this.file = file; - this.offset = offset; - this.length = length; - this.validateOnly = validateOnly; - this.options = options; - } + EditGetRefactoringParams( + this.kind, this.file, this.offset, this.length, this.validateOnly, + {this.options}); factory EditGetRefactoringParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { RefactoringKind kind; @@ -9176,7 +7387,7 @@ class EditGetRefactoringParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'validateOnly'); } - RefactoringOptions options; + RefactoringOptions? options; if (json.containsKey('options')) { options = RefactoringOptions.fromJson( jsonDecoder, jsonPath + '.options', json['options'], kind); @@ -9196,13 +7407,14 @@ class EditGetRefactoringParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['file'] = file; result['offset'] = offset; result['length'] = length; result['validateOnly'] = validateOnly; + var options = this.options; if (options != null) { result['options'] = options.toJson(); } @@ -9256,84 +7468,32 @@ class EditGetRefactoringParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetRefactoringResult implements ResponseResult { - List _initialProblems; - - List _optionsProblems; - - List _finalProblems; - - RefactoringFeedback _feedback; - - SourceChange _change; - - List _potentialEdits; - /// The initial status of the refactoring, i.e. problems related to the /// context in which the refactoring is requested. The array will be empty if /// there are no known problems. - List get initialProblems => _initialProblems; - - /// The initial status of the refactoring, i.e. problems related to the - /// context in which the refactoring is requested. The array will be empty if - /// there are no known problems. - set initialProblems(List value) { - assert(value != null); - _initialProblems = value; - } + List initialProblems; /// The options validation status, i.e. problems in the given options, such /// as light-weight validation of a new name, flags compatibility, etc. The /// array will be empty if there are no known problems. - List get optionsProblems => _optionsProblems; - - /// The options validation status, i.e. problems in the given options, such - /// as light-weight validation of a new name, flags compatibility, etc. The - /// array will be empty if there are no known problems. - set optionsProblems(List value) { - assert(value != null); - _optionsProblems = value; - } + List optionsProblems; /// The final status of the refactoring, i.e. problems identified in the /// result of a full, potentially expensive validation and / or change /// creation. The array will be empty if there are no known problems. - List get finalProblems => _finalProblems; - - /// The final status of the refactoring, i.e. problems identified in the - /// result of a full, potentially expensive validation and / or change - /// creation. The array will be empty if there are no known problems. - set finalProblems(List value) { - assert(value != null); - _finalProblems = value; - } + List finalProblems; /// Data used to provide feedback to the user. The structure of the data is /// dependent on the kind of refactoring being created. The data that is /// returned is documented in the section titled Refactorings, labeled as /// "Feedback". - RefactoringFeedback get feedback => _feedback; - - /// Data used to provide feedback to the user. The structure of the data is - /// dependent on the kind of refactoring being created. The data that is - /// returned is documented in the section titled Refactorings, labeled as - /// "Feedback". - set feedback(RefactoringFeedback value) { - _feedback = value; - } + RefactoringFeedback? feedback; /// The changes that are to be applied to affect the refactoring. This field /// will be omitted if there are problems that prevent a set of changes from /// being computed, such as having no options specified for a refactoring /// that requires them, or if only validation was requested. - SourceChange get change => _change; - - /// The changes that are to be applied to affect the refactoring. This field - /// will be omitted if there are problems that prevent a set of changes from - /// being computed, such as having no options specified for a refactoring - /// that requires them, or if only validation was requested. - set change(SourceChange value) { - _change = value; - } + SourceChange? change; /// The ids of source edits that are not known to be valid. An edit is not /// known to be valid if there was insufficient type information for the @@ -9342,36 +7502,14 @@ class EditGetRefactoringResult implements ResponseResult { /// to a member from an unknown type. This field will be omitted if the /// change field is omitted or if there are no potential edits for the /// refactoring. - List get potentialEdits => _potentialEdits; - - /// The ids of source edits that are not known to be valid. An edit is not - /// known to be valid if there was insufficient type information for the - /// server to be able to determine whether or not the code needs to be - /// modified, such as when a member is being renamed and there is a reference - /// to a member from an unknown type. This field will be omitted if the - /// change field is omitted or if there are no potential edits for the - /// refactoring. - set potentialEdits(List value) { - _potentialEdits = value; - } + List? potentialEdits; EditGetRefactoringResult( - List initialProblems, - List optionsProblems, - List finalProblems, - {RefactoringFeedback feedback, - SourceChange change, - List potentialEdits}) { - this.initialProblems = initialProblems; - this.optionsProblems = optionsProblems; - this.finalProblems = finalProblems; - this.feedback = feedback; - this.change = change; - this.potentialEdits = potentialEdits; - } + this.initialProblems, this.optionsProblems, this.finalProblems, + {this.feedback, this.change, this.potentialEdits}); factory EditGetRefactoringResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List initialProblems; @@ -9379,7 +7517,7 @@ class EditGetRefactoringResult implements ResponseResult { initialProblems = jsonDecoder.decodeList( jsonPath + '.initialProblems', json['initialProblems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'initialProblems'); @@ -9389,7 +7527,7 @@ class EditGetRefactoringResult implements ResponseResult { optionsProblems = jsonDecoder.decodeList( jsonPath + '.optionsProblems', json['optionsProblems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'optionsProblems'); @@ -9399,22 +7537,22 @@ class EditGetRefactoringResult implements ResponseResult { finalProblems = jsonDecoder.decodeList( jsonPath + '.finalProblems', json['finalProblems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'finalProblems'); } - RefactoringFeedback feedback; + RefactoringFeedback? feedback; if (json.containsKey('feedback')) { feedback = RefactoringFeedback.fromJson( jsonDecoder, jsonPath + '.feedback', json['feedback'], json); } - SourceChange change; + SourceChange? change; if (json.containsKey('change')) { change = SourceChange.fromJson( jsonDecoder, jsonPath + '.change', json['change']); } - List potentialEdits; + List? potentialEdits; if (json.containsKey('potentialEdits')) { potentialEdits = jsonDecoder.decodeList(jsonPath + '.potentialEdits', json['potentialEdits'], jsonDecoder.decodeString); @@ -9435,8 +7573,8 @@ class EditGetRefactoringResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['initialProblems'] = initialProblems .map((RefactoringProblem value) => value.toJson()) .toList(); @@ -9446,12 +7584,15 @@ class EditGetRefactoringResult implements ResponseResult { result['finalProblems'] = finalProblems .map((RefactoringProblem value) => value.toJson()) .toList(); + var feedback = this.feedback; if (feedback != null) { result['feedback'] = feedback.toJson(); } + var change = this.change; if (change != null) { result['change'] = change.toJson(); } + var potentialEdits = this.potentialEdits; if (potentialEdits != null) { result['potentialEdits'] = potentialEdits; } @@ -9505,35 +7646,16 @@ class EditGetRefactoringResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetStatementCompletionParams implements RequestParams { - String _file; - - int _offset; - /// The file containing the statement to be completed. - String get file => _file; - - /// The file containing the statement to be completed. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset used to identify the statement to be completed. - int get offset => _offset; + int offset; - /// The offset used to identify the statement to be completed. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditGetStatementCompletionParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + EditGetStatementCompletionParams(this.file, this.offset); factory EditGetStatementCompletionParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -9561,8 +7683,8 @@ class EditGetStatementCompletionParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -9602,37 +7724,17 @@ class EditGetStatementCompletionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetStatementCompletionResult implements ResponseResult { - SourceChange _change; - - bool _whitespaceOnly; - /// The change to be applied in order to complete the statement. - SourceChange get change => _change; - - /// The change to be applied in order to complete the statement. - set change(SourceChange value) { - assert(value != null); - _change = value; - } + SourceChange change; /// Will be true if the change contains nothing but whitespace characters, or /// is empty. - bool get whitespaceOnly => _whitespaceOnly; + bool whitespaceOnly; - /// Will be true if the change contains nothing but whitespace characters, or - /// is empty. - set whitespaceOnly(bool value) { - assert(value != null); - _whitespaceOnly = value; - } - - EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) { - this.change = change; - this.whitespaceOnly = whitespaceOnly; - } + EditGetStatementCompletionResult(this.change, this.whitespaceOnly); factory EditGetStatementCompletionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceChange change; @@ -9664,8 +7766,8 @@ class EditGetStatementCompletionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['change'] = change.toJson(); result['whitespaceOnly'] = whitespaceOnly; return result; @@ -9706,53 +7808,22 @@ class EditGetStatementCompletionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditImportElementsParams implements RequestParams { - String _file; - - List _elements; - - int _offset; - /// The file in which the specified elements are to be made accessible. - String get file => _file; - - /// The file in which the specified elements are to be made accessible. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The elements to be made accessible in the specified file. - List get elements => _elements; - - /// The elements to be made accessible in the specified file. - set elements(List value) { - assert(value != null); - _elements = value; - } + List elements; /// The offset at which the specified elements need to be made accessible. If /// provided, this is used to guard against adding imports for text that /// would be inserted into a comment, string literal, or other location where /// the imports would not be necessary. - int get offset => _offset; + int? offset; - /// The offset at which the specified elements need to be made accessible. If - /// provided, this is used to guard against adding imports for text that - /// would be inserted into a comment, string literal, or other location where - /// the imports would not be necessary. - set offset(int value) { - _offset = value; - } - - EditImportElementsParams(String file, List elements, - {int offset}) { - this.file = file; - this.elements = elements; - this.offset = offset; - } + EditImportElementsParams(this.file, this.elements, {this.offset}); factory EditImportElementsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -9766,12 +7837,12 @@ class EditImportElementsParams implements RequestParams { elements = jsonDecoder.decodeList( jsonPath + '.elements', json['elements'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImportedElements.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'elements'); } - int offset; + int? offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']); } @@ -9787,11 +7858,12 @@ class EditImportElementsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['elements'] = elements.map((ImportedElements value) => value.toJson()).toList(); + var offset = this.offset; if (offset != null) { result['offset'] = offset; } @@ -9835,35 +7907,21 @@ class EditImportElementsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditImportElementsResult implements ResponseResult { - SourceFileEdit _edit; - /// The edits to be applied in order to make the specified elements /// accessible. The file to be edited will be the defining compilation unit /// of the library containing the file specified in the request, which can be /// different than the file specified in the request if the specified file is /// a part file. This field will be omitted if there are no edits that need /// to be applied. - SourceFileEdit get edit => _edit; + SourceFileEdit? edit; - /// The edits to be applied in order to make the specified elements - /// accessible. The file to be edited will be the defining compilation unit - /// of the library containing the file specified in the request, which can be - /// different than the file specified in the request if the specified file is - /// a part file. This field will be omitted if there are no edits that need - /// to be applied. - set edit(SourceFileEdit value) { - _edit = value; - } - - EditImportElementsResult({SourceFileEdit edit}) { - this.edit = edit; - } + EditImportElementsResult({this.edit}); factory EditImportElementsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - SourceFileEdit edit; + SourceFileEdit? edit; if (json.containsKey('edit')) { edit = SourceFileEdit.fromJson( jsonDecoder, jsonPath + '.edit', json['edit']); @@ -9882,8 +7940,9 @@ class EditImportElementsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var edit = this.edit; if (edit != null) { result['edit'] = edit.toJson(); } @@ -9924,49 +7983,20 @@ class EditImportElementsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditIsPostfixCompletionApplicableParams implements RequestParams { - String _file; - - String _key; - - int _offset; - /// The file containing the postfix template to be expanded. - String get file => _file; - - /// The file containing the postfix template to be expanded. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The unique name that identifies the template in use. - String get key => _key; - - /// The unique name that identifies the template in use. - set key(String value) { - assert(value != null); - _key = value; - } + String key; /// The offset used to identify the code to which the template will be /// applied. - int get offset => _offset; + int offset; - /// The offset used to identify the code to which the template will be - /// applied. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditIsPostfixCompletionApplicableParams(String file, String key, int offset) { - this.file = file; - this.key = key; - this.offset = offset; - } + EditIsPostfixCompletionApplicableParams(this.file, this.key, this.offset); factory EditIsPostfixCompletionApplicableParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10000,8 +8030,8 @@ class EditIsPostfixCompletionApplicableParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['key'] = key; result['offset'] = offset; @@ -10042,23 +8072,13 @@ class EditIsPostfixCompletionApplicableParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditIsPostfixCompletionApplicableResult implements ResponseResult { - bool _value; - /// True if the template can be expanded at the given location. - bool get value => _value; + bool value; - /// True if the template can be expanded at the given location. - set value(bool value) { - assert(value != null); - _value = value; - } - - EditIsPostfixCompletionApplicableResult(bool value) { - this.value = value; - } + EditIsPostfixCompletionApplicableResult(this.value); factory EditIsPostfixCompletionApplicableResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool value; @@ -10083,8 +8103,8 @@ class EditIsPostfixCompletionApplicableResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['value'] = value; return result; } @@ -10118,7 +8138,7 @@ class EditIsPostfixCompletionApplicableResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class EditListPostfixCompletionTemplatesParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -10147,24 +8167,13 @@ class EditListPostfixCompletionTemplatesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditListPostfixCompletionTemplatesResult implements ResponseResult { - List _templates; - /// The list of available templates. - List get templates => _templates; + List templates; - /// The list of available templates. - set templates(List value) { - assert(value != null); - _templates = value; - } - - EditListPostfixCompletionTemplatesResult( - List templates) { - this.templates = templates; - } + EditListPostfixCompletionTemplatesResult(this.templates); factory EditListPostfixCompletionTemplatesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List templates; @@ -10172,7 +8181,7 @@ class EditListPostfixCompletionTemplatesResult implements ResponseResult { templates = jsonDecoder.decodeList( jsonPath + '.templates', json['templates'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => PostfixTemplateDescriptor.fromJson( jsonDecoder, jsonPath, json)); } else { @@ -10194,8 +8203,8 @@ class EditListPostfixCompletionTemplatesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['templates'] = templates .map((PostfixTemplateDescriptor value) => value.toJson()) .toList(); @@ -10235,23 +8244,13 @@ class EditListPostfixCompletionTemplatesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditOrganizeDirectivesParams implements RequestParams { - String _file; - /// The Dart file to organize directives in. - String get file => _file; + String file; - /// The Dart file to organize directives in. - set file(String value) { - assert(value != null); - _file = value; - } - - EditOrganizeDirectivesParams(String file) { - this.file = file; - } + EditOrganizeDirectivesParams(this.file); factory EditOrganizeDirectivesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10273,8 +8272,8 @@ class EditOrganizeDirectivesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -10311,25 +8310,14 @@ class EditOrganizeDirectivesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditOrganizeDirectivesResult implements ResponseResult { - SourceFileEdit _edit; - /// The file edit that is to be applied to the given file to effect the /// organizing. - SourceFileEdit get edit => _edit; + SourceFileEdit edit; - /// The file edit that is to be applied to the given file to effect the - /// organizing. - set edit(SourceFileEdit value) { - assert(value != null); - _edit = value; - } - - EditOrganizeDirectivesResult(SourceFileEdit edit) { - this.edit = edit; - } + EditOrganizeDirectivesResult(this.edit); factory EditOrganizeDirectivesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceFileEdit edit; @@ -10354,8 +8342,8 @@ class EditOrganizeDirectivesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edit'] = edit.toJson(); return result; } @@ -10392,23 +8380,13 @@ class EditOrganizeDirectivesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditSortMembersParams implements RequestParams { - String _file; - /// The Dart file to sort. - String get file => _file; + String file; - /// The Dart file to sort. - set file(String value) { - assert(value != null); - _file = value; - } - - EditSortMembersParams(String file) { - this.file = file; - } + EditSortMembersParams(this.file); factory EditSortMembersParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10429,8 +8407,8 @@ class EditSortMembersParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -10467,25 +8445,14 @@ class EditSortMembersParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditSortMembersResult implements ResponseResult { - SourceFileEdit _edit; - /// The file edit that is to be applied to the given file to effect the /// sorting. - SourceFileEdit get edit => _edit; + SourceFileEdit edit; - /// The file edit that is to be applied to the given file to effect the - /// sorting. - set edit(SourceFileEdit value) { - assert(value != null); - _edit = value; - } - - EditSortMembersResult(SourceFileEdit edit) { - this.edit = edit; - } + EditSortMembersResult(this.edit); factory EditSortMembersResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceFileEdit edit; @@ -10509,8 +8476,8 @@ class EditSortMembersResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edit'] = edit.toJson(); return result; } @@ -10557,119 +8524,37 @@ class EditSortMembersResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ElementDeclaration implements HasToJson { - String _name; - - ElementKind _kind; - - int _fileIndex; - - int _offset; - - int _line; - - int _column; - - int _codeOffset; - - int _codeLength; - - String _className; - - String _mixinName; - - String _parameters; - /// The name of the declaration. - String get name => _name; - - /// The name of the declaration. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The kind of the element that corresponds to the declaration. - ElementKind get kind => _kind; - - /// The kind of the element that corresponds to the declaration. - set kind(ElementKind value) { - assert(value != null); - _kind = value; - } + ElementKind kind; /// The index of the file (in the enclosing response). - int get fileIndex => _fileIndex; - - /// The index of the file (in the enclosing response). - set fileIndex(int value) { - assert(value != null); - _fileIndex = value; - } + int fileIndex; /// The offset of the declaration name in the file. - int get offset => _offset; - - /// The offset of the declaration name in the file. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The one-based index of the line containing the declaration name. - int get line => _line; - - /// The one-based index of the line containing the declaration name. - set line(int value) { - assert(value != null); - _line = value; - } + int line; /// The one-based index of the column containing the declaration name. - int get column => _column; - - /// The one-based index of the column containing the declaration name. - set column(int value) { - assert(value != null); - _column = value; - } + int column; /// The offset of the first character of the declaration code in the file. - int get codeOffset => _codeOffset; - - /// The offset of the first character of the declaration code in the file. - set codeOffset(int value) { - assert(value != null); - _codeOffset = value; - } + int codeOffset; /// The length of the declaration code in the file. - int get codeLength => _codeLength; - - /// The length of the declaration code in the file. - set codeLength(int value) { - assert(value != null); - _codeLength = value; - } + int codeLength; /// The name of the class enclosing this declaration. If the declaration is /// not a class member, this field will be absent. - String get className => _className; - - /// The name of the class enclosing this declaration. If the declaration is - /// not a class member, this field will be absent. - set className(String value) { - _className = value; - } + String? className; /// The name of the mixin enclosing this declaration. If the declaration is /// not a mixin member, this field will be absent. - String get mixinName => _mixinName; - - /// The name of the mixin enclosing this declaration. If the declaration is - /// not a mixin member, this field will be absent. - set mixinName(String value) { - _mixinName = value; - } + String? mixinName; /// The parameter list for the element. If the element is not a method or /// function this field will not be defined. If the element doesn't have @@ -10677,36 +8562,14 @@ class ElementDeclaration implements HasToJson { /// has zero parameters, this field will have a value of "()". The value /// should not be treated as exact presentation of parameters, it is just /// approximation of parameters to give the user general idea. - String get parameters => _parameters; + String? parameters; - /// The parameter list for the element. If the element is not a method or - /// function this field will not be defined. If the element doesn't have - /// parameters (e.g. getter), this field will not be defined. If the element - /// has zero parameters, this field will have a value of "()". The value - /// should not be treated as exact presentation of parameters, it is just - /// approximation of parameters to give the user general idea. - set parameters(String value) { - _parameters = value; - } - - ElementDeclaration(String name, ElementKind kind, int fileIndex, int offset, - int line, int column, int codeOffset, int codeLength, - {String className, String mixinName, String parameters}) { - this.name = name; - this.kind = kind; - this.fileIndex = fileIndex; - this.offset = offset; - this.line = line; - this.column = column; - this.codeOffset = codeOffset; - this.codeLength = codeLength; - this.className = className; - this.mixinName = mixinName; - this.parameters = parameters; - } + ElementDeclaration(this.name, this.kind, this.fileIndex, this.offset, + this.line, this.column, this.codeOffset, this.codeLength, + {this.className, this.mixinName, this.parameters}); factory ElementDeclaration.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -10761,17 +8624,17 @@ class ElementDeclaration implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'codeLength'); } - String className; + String? className; if (json.containsKey('className')) { className = jsonDecoder.decodeString( jsonPath + '.className', json['className']); } - String mixinName; + String? mixinName; if (json.containsKey('mixinName')) { mixinName = jsonDecoder.decodeString( jsonPath + '.mixinName', json['mixinName']); } - String parameters; + String? parameters; if (json.containsKey('parameters')) { parameters = jsonDecoder.decodeString( jsonPath + '.parameters', json['parameters']); @@ -10785,8 +8648,8 @@ class ElementDeclaration implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['kind'] = kind.toJson(); result['fileIndex'] = fileIndex; @@ -10795,12 +8658,15 @@ class ElementDeclaration implements HasToJson { result['column'] = column; result['codeOffset'] = codeOffset; result['codeLength'] = codeLength; + var className = this.className; if (className != null) { result['className'] = className; } + var mixinName = this.mixinName; if (mixinName != null) { result['mixinName'] = mixinName; } + var parameters = this.parameters; if (parameters != null) { result['parameters'] = parameters; } @@ -10855,35 +8721,16 @@ class ElementDeclaration implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExecutableFile implements HasToJson { - String _file; - - ExecutableKind _kind; - /// The path of the executable file. - String get file => _file; - - /// The path of the executable file. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The kind of the executable file. - ExecutableKind get kind => _kind; + ExecutableKind kind; - /// The kind of the executable file. - set kind(ExecutableKind value) { - assert(value != null); - _kind = value; - } - - ExecutableFile(String file, ExecutableKind kind) { - this.file = file; - this.kind = kind; - } + ExecutableFile(this.file, this.kind); factory ExecutableFile.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10906,8 +8753,8 @@ class ExecutableFile implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['kind'] = kind.toJson(); return result; @@ -10981,7 +8828,7 @@ class ExecutableKind implements Enum { } factory ExecutableKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ExecutableKind(json); @@ -11006,25 +8853,14 @@ class ExecutableKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ExecutionCreateContextParams implements RequestParams { - String _contextRoot; - /// The path of the Dart or HTML file that will be launched, or the path of /// the directory containing the file. - String get contextRoot => _contextRoot; + String contextRoot; - /// The path of the Dart or HTML file that will be launched, or the path of - /// the directory containing the file. - set contextRoot(String value) { - assert(value != null); - _contextRoot = value; - } - - ExecutionCreateContextParams(String contextRoot) { - this.contextRoot = contextRoot; - } + ExecutionCreateContextParams(this.contextRoot); factory ExecutionCreateContextParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String contextRoot; @@ -11047,8 +8883,8 @@ class ExecutionCreateContextParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['contextRoot'] = contextRoot; return result; } @@ -11085,23 +8921,13 @@ class ExecutionCreateContextParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ExecutionCreateContextResult implements ResponseResult { - String _id; - /// The identifier used to refer to the execution context that was created. - String get id => _id; + String id; - /// The identifier used to refer to the execution context that was created. - set id(String value) { - assert(value != null); - _id = value; - } - - ExecutionCreateContextResult(String id) { - this.id = id; - } + ExecutionCreateContextResult(this.id); factory ExecutionCreateContextResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -11125,8 +8951,8 @@ class ExecutionCreateContextResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -11163,23 +8989,13 @@ class ExecutionCreateContextResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExecutionDeleteContextParams implements RequestParams { - String _id; - /// The identifier of the execution context that is to be deleted. - String get id => _id; + String id; - /// The identifier of the execution context that is to be deleted. - set id(String value) { - assert(value != null); - _id = value; - } - - ExecutionDeleteContextParams(String id) { - this.id = id; - } + ExecutionDeleteContextParams(this.id); factory ExecutionDeleteContextParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -11201,8 +9017,8 @@ class ExecutionDeleteContextParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -11236,7 +9052,7 @@ class ExecutionDeleteContextParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ExecutionDeleteContextResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -11270,72 +9086,25 @@ class ExecutionDeleteContextResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExecutionGetSuggestionsParams implements RequestParams { - String _code; - - int _offset; - - String _contextFile; - - int _contextOffset; - - List _variables; - - List _expressions; - /// The code to get suggestions in. - String get code => _code; - - /// The code to get suggestions in. - set code(String value) { - assert(value != null); - _code = value; - } + String code; /// The offset within the code to get suggestions at. - int get offset => _offset; - - /// The offset within the code to get suggestions at. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The path of the context file, e.g. the file of the current debugger /// frame. The combination of the context file and context offset can be used /// to ensure that all variables of the context are available for completion /// (with their static types). - String get contextFile => _contextFile; - - /// The path of the context file, e.g. the file of the current debugger - /// frame. The combination of the context file and context offset can be used - /// to ensure that all variables of the context are available for completion - /// (with their static types). - set contextFile(String value) { - assert(value != null); - _contextFile = value; - } + String contextFile; /// The offset in the context file, e.g. the line offset in the current /// debugger frame. - int get contextOffset => _contextOffset; - - /// The offset in the context file, e.g. the line offset in the current - /// debugger frame. - set contextOffset(int value) { - assert(value != null); - _contextOffset = value; - } + int contextOffset; /// The runtime context variables that are potentially referenced in the /// code. - List get variables => _variables; - - /// The runtime context variables that are potentially referenced in the - /// code. - set variables(List value) { - assert(value != null); - _variables = value; - } + List variables; /// The list of sub-expressions in the code for which the client wants to /// provide runtime types. It does not have to be the full list of @@ -11346,34 +9115,14 @@ class ExecutionGetSuggestionsParams implements RequestParams { /// only when there are no interesting sub-expressions in the given code. The /// client may provide an empty list, in this case the server will return /// completion suggestions. - List get expressions => _expressions; + List? expressions; - /// The list of sub-expressions in the code for which the client wants to - /// provide runtime types. It does not have to be the full list of - /// expressions requested by the server, for missing expressions their static - /// types will be used. - /// - /// When this field is omitted, the server will return completion suggestions - /// only when there are no interesting sub-expressions in the given code. The - /// client may provide an empty list, in this case the server will return - /// completion suggestions. - set expressions(List value) { - _expressions = value; - } - - ExecutionGetSuggestionsParams(String code, int offset, String contextFile, - int contextOffset, List variables, - {List expressions}) { - this.code = code; - this.offset = offset; - this.contextFile = contextFile; - this.contextOffset = contextOffset; - this.variables = variables; - this.expressions = expressions; - } + ExecutionGetSuggestionsParams(this.code, this.offset, this.contextFile, + this.contextOffset, this.variables, + {this.expressions}); factory ExecutionGetSuggestionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String code; @@ -11407,18 +9156,18 @@ class ExecutionGetSuggestionsParams implements RequestParams { variables = jsonDecoder.decodeList( jsonPath + '.variables', json['variables'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionVariable.fromJson( jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'variables'); } - List expressions; + List? expressions; if (json.containsKey('expressions')) { expressions = jsonDecoder.decodeList( jsonPath + '.expressions', json['expressions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpression.fromJson( jsonDecoder, jsonPath, json)); } @@ -11437,8 +9186,8 @@ class ExecutionGetSuggestionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['code'] = code; result['offset'] = offset; result['contextFile'] = contextFile; @@ -11446,6 +9195,7 @@ class ExecutionGetSuggestionsParams implements RequestParams { result['variables'] = variables .map((RuntimeCompletionVariable value) => value.toJson()) .toList(); + var expressions = this.expressions; if (expressions != null) { result['expressions'] = expressions .map((RuntimeCompletionExpression value) => value.toJson()) @@ -11505,10 +9255,6 @@ class ExecutionGetSuggestionsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ExecutionGetSuggestionsResult implements ResponseResult { - List _suggestions; - - List _expressions; - /// The completion suggestions. In contrast to usual completion request, /// suggestions for private elements also will be provided. /// @@ -11517,59 +9263,34 @@ class ExecutionGetSuggestionsResult implements ResponseResult { /// their actual runtime types can improve completion results, the server /// omits this field in the response, and instead will return the /// "expressions" field. - List get suggestions => _suggestions; - - /// The completion suggestions. In contrast to usual completion request, - /// suggestions for private elements also will be provided. - /// - /// If there are sub-expressions that can have different runtime types, and - /// are considered to be safe to evaluate at runtime (e.g. getters), so using - /// their actual runtime types can improve completion results, the server - /// omits this field in the response, and instead will return the - /// "expressions" field. - set suggestions(List value) { - _suggestions = value; - } + List? suggestions; /// The list of sub-expressions in the code for which the server would like /// to know runtime types to provide better completion suggestions. /// /// This field is omitted the field "suggestions" is returned. - List get expressions => _expressions; + List? expressions; - /// The list of sub-expressions in the code for which the server would like - /// to know runtime types to provide better completion suggestions. - /// - /// This field is omitted the field "suggestions" is returned. - set expressions(List value) { - _expressions = value; - } - - ExecutionGetSuggestionsResult( - {List suggestions, - List expressions}) { - this.suggestions = suggestions; - this.expressions = expressions; - } + ExecutionGetSuggestionsResult({this.suggestions, this.expressions}); factory ExecutionGetSuggestionsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List suggestions; + List? suggestions; if (json.containsKey('suggestions')) { suggestions = jsonDecoder.decodeList( jsonPath + '.suggestions', json['suggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json)); } - List expressions; + List? expressions; if (json.containsKey('expressions')) { expressions = jsonDecoder.decodeList( jsonPath + '.expressions', json['expressions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpression.fromJson( jsonDecoder, jsonPath, json)); } @@ -11589,13 +9310,15 @@ class ExecutionGetSuggestionsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var suggestions = this.suggestions; if (suggestions != null) { result['suggestions'] = suggestions .map((CompletionSuggestion value) => value.toJson()) .toList(); } + var expressions = this.expressions; if (expressions != null) { result['expressions'] = expressions .map((RuntimeCompletionExpression value) => value.toJson()) @@ -11645,52 +9368,22 @@ class ExecutionGetSuggestionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExecutionLaunchDataParams implements HasToJson { - String _file; - - ExecutableKind _kind; - - List _referencedFiles; - /// The file for which launch data is being provided. This will either be a /// Dart library or an HTML file. - String get file => _file; - - /// The file for which launch data is being provided. This will either be a - /// Dart library or an HTML file. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The kind of the executable file. This field is omitted if the file is not /// a Dart file. - ExecutableKind get kind => _kind; - - /// The kind of the executable file. This field is omitted if the file is not - /// a Dart file. - set kind(ExecutableKind value) { - _kind = value; - } + ExecutableKind? kind; /// A list of the Dart files that are referenced by the file. This field is /// omitted if the file is not an HTML file. - List get referencedFiles => _referencedFiles; + List? referencedFiles; - /// A list of the Dart files that are referenced by the file. This field is - /// omitted if the file is not an HTML file. - set referencedFiles(List value) { - _referencedFiles = value; - } - - ExecutionLaunchDataParams(String file, - {ExecutableKind kind, List referencedFiles}) { - this.file = file; - this.kind = kind; - this.referencedFiles = referencedFiles; - } + ExecutionLaunchDataParams(this.file, {this.kind, this.referencedFiles}); factory ExecutionLaunchDataParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -11699,12 +9392,12 @@ class ExecutionLaunchDataParams implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'file'); } - ExecutableKind kind; + ExecutableKind? kind; if (json.containsKey('kind')) { kind = ExecutableKind.fromJson( jsonDecoder, jsonPath + '.kind', json['kind']); } - List referencedFiles; + List? referencedFiles; if (json.containsKey('referencedFiles')) { referencedFiles = jsonDecoder.decodeList(jsonPath + '.referencedFiles', json['referencedFiles'], jsonDecoder.decodeString); @@ -11723,12 +9416,14 @@ class ExecutionLaunchDataParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; + var kind = this.kind; if (kind != null) { result['kind'] = kind.toJson(); } + var referencedFiles = this.referencedFiles; if (referencedFiles != null) { result['referencedFiles'] = referencedFiles; } @@ -11773,45 +9468,19 @@ class ExecutionLaunchDataParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExecutionMapUriParams implements RequestParams { - String _id; - - String _file; - - String _uri; - /// The identifier of the execution context in which the URI is to be mapped. - String get id => _id; - - /// The identifier of the execution context in which the URI is to be mapped. - set id(String value) { - assert(value != null); - _id = value; - } + String id; /// The path of the file to be mapped into a URI. - String get file => _file; - - /// The path of the file to be mapped into a URI. - set file(String value) { - _file = value; - } + String? file; /// The URI to be mapped into a file path. - String get uri => _uri; + String? uri; - /// The URI to be mapped into a file path. - set uri(String value) { - _uri = value; - } - - ExecutionMapUriParams(String id, {String file, String uri}) { - this.id = id; - this.file = file; - this.uri = uri; - } + ExecutionMapUriParams(this.id, {this.file, this.uri}); factory ExecutionMapUriParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -11820,11 +9489,11 @@ class ExecutionMapUriParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'id'); } - String file; + String? file; if (json.containsKey('file')) { file = jsonDecoder.decodeString(jsonPath + '.file', json['file']); } - String uri; + String? uri; if (json.containsKey('uri')) { uri = jsonDecoder.decodeString(jsonPath + '.uri', json['uri']); } @@ -11840,12 +9509,14 @@ class ExecutionMapUriParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; + var file = this.file; if (file != null) { result['file'] = file; } + var uri = this.uri; if (uri != null) { result['uri'] = uri; } @@ -11887,44 +9558,25 @@ class ExecutionMapUriParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ExecutionMapUriResult implements ResponseResult { - String _file; - - String _uri; - /// The file to which the URI was mapped. This field is omitted if the uri /// field was not given in the request. - String get file => _file; - - /// The file to which the URI was mapped. This field is omitted if the uri - /// field was not given in the request. - set file(String value) { - _file = value; - } + String? file; /// The URI to which the file path was mapped. This field is omitted if the /// file field was not given in the request. - String get uri => _uri; + String? uri; - /// The URI to which the file path was mapped. This field is omitted if the - /// file field was not given in the request. - set uri(String value) { - _uri = value; - } - - ExecutionMapUriResult({String file, String uri}) { - this.file = file; - this.uri = uri; - } + ExecutionMapUriResult({this.file, this.uri}); factory ExecutionMapUriResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String file; + String? file; if (json.containsKey('file')) { file = jsonDecoder.decodeString(jsonPath + '.file', json['file']); } - String uri; + String? uri; if (json.containsKey('uri')) { uri = jsonDecoder.decodeString(jsonPath + '.uri', json['uri']); } @@ -11942,11 +9594,13 @@ class ExecutionMapUriResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var file = this.file; if (file != null) { result['file'] = file; } + var uri = this.uri; if (uri != null) { result['uri'] = uri; } @@ -12005,7 +9659,7 @@ class ExecutionService implements Enum { } factory ExecutionService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ExecutionService(json); @@ -12030,23 +9684,13 @@ class ExecutionService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ExecutionSetSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - ExecutionSetSubscriptionsParams(List subscriptions) { - this.subscriptions = subscriptions; - } + ExecutionSetSubscriptionsParams(this.subscriptions); factory ExecutionSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -12054,7 +9698,7 @@ class ExecutionSetSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ExecutionService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -12072,8 +9716,8 @@ class ExecutionSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions.map((ExecutionService value) => value.toJson()).toList(); return result; @@ -12109,7 +9753,7 @@ class ExecutionSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ExecutionSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -12139,37 +9783,17 @@ class ExecutionSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExistingImport implements HasToJson { - int _uri; - - List _elements; - /// The URI of the imported library. It is an index in the strings field, in /// the enclosing ExistingImports and its ImportedElementSet object. - int get uri => _uri; - - /// The URI of the imported library. It is an index in the strings field, in - /// the enclosing ExistingImports and its ImportedElementSet object. - set uri(int value) { - assert(value != null); - _uri = value; - } + int uri; /// The list of indexes of elements, in the enclosing ExistingImports object. - List get elements => _elements; + List elements; - /// The list of indexes of elements, in the enclosing ExistingImports object. - set elements(List value) { - assert(value != null); - _elements = value; - } - - ExistingImport(int uri, List elements) { - this.uri = uri; - this.elements = elements; - } + ExistingImport(this.uri, this.elements); factory ExistingImport.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int uri; @@ -12192,8 +9816,8 @@ class ExistingImport implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['uri'] = uri; result['elements'] = elements; return result; @@ -12229,35 +9853,16 @@ class ExistingImport implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExistingImports implements HasToJson { - ImportedElementSet _elements; - - List _imports; - /// The set of all unique imported elements for all imports. - ImportedElementSet get elements => _elements; - - /// The set of all unique imported elements for all imports. - set elements(ImportedElementSet value) { - assert(value != null); - _elements = value; - } + ImportedElementSet elements; /// The list of imports in the library. - List get imports => _imports; + List imports; - /// The list of imports in the library. - set imports(List value) { - assert(value != null); - _imports = value; - } - - ExistingImports(ImportedElementSet elements, List imports) { - this.elements = elements; - this.imports = imports; - } + ExistingImports(this.elements, this.imports); factory ExistingImports.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ImportedElementSet elements; @@ -12272,7 +9877,7 @@ class ExistingImports implements HasToJson { imports = jsonDecoder.decodeList( jsonPath + '.imports', json['imports'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ExistingImport.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'imports'); @@ -12284,8 +9889,8 @@ class ExistingImports implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['elements'] = elements.toJson(); result['imports'] = imports.map((ExistingImport value) => value.toJson()).toList(); @@ -12326,94 +9931,42 @@ class ExistingImports implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExtractLocalVariableFeedback extends RefactoringFeedback { - List _coveringExpressionOffsets; - - List _coveringExpressionLengths; - - List _names; - - List _offsets; - - List _lengths; - /// The offsets of the expressions that cover the specified selection, from /// the down most to the up most. - List get coveringExpressionOffsets => _coveringExpressionOffsets; - - /// The offsets of the expressions that cover the specified selection, from - /// the down most to the up most. - set coveringExpressionOffsets(List value) { - _coveringExpressionOffsets = value; - } + List? coveringExpressionOffsets; /// The lengths of the expressions that cover the specified selection, from /// the down most to the up most. - List get coveringExpressionLengths => _coveringExpressionLengths; - - /// The lengths of the expressions that cover the specified selection, from - /// the down most to the up most. - set coveringExpressionLengths(List value) { - _coveringExpressionLengths = value; - } + List? coveringExpressionLengths; /// The proposed names for the local variable. - List get names => _names; - - /// The proposed names for the local variable. - set names(List value) { - assert(value != null); - _names = value; - } + List names; /// The offsets of the expressions that would be replaced by a reference to /// the variable. - List get offsets => _offsets; - - /// The offsets of the expressions that would be replaced by a reference to - /// the variable. - set offsets(List value) { - assert(value != null); - _offsets = value; - } + List offsets; /// The lengths of the expressions that would be replaced by a reference to /// the variable. The lengths correspond to the offsets. In other words, for /// a given expression, if the offset of that expression is offsets[i], then /// the length of that expression is lengths[i]. - List get lengths => _lengths; + List lengths; - /// The lengths of the expressions that would be replaced by a reference to - /// the variable. The lengths correspond to the offsets. In other words, for - /// a given expression, if the offset of that expression is offsets[i], then - /// the length of that expression is lengths[i]. - set lengths(List value) { - assert(value != null); - _lengths = value; - } - - ExtractLocalVariableFeedback( - List names, List offsets, List lengths, - {List coveringExpressionOffsets, - List coveringExpressionLengths}) { - this.coveringExpressionOffsets = coveringExpressionOffsets; - this.coveringExpressionLengths = coveringExpressionLengths; - this.names = names; - this.offsets = offsets; - this.lengths = lengths; - } + ExtractLocalVariableFeedback(this.names, this.offsets, this.lengths, + {this.coveringExpressionOffsets, this.coveringExpressionLengths}); factory ExtractLocalVariableFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List coveringExpressionOffsets; + List? coveringExpressionOffsets; if (json.containsKey('coveringExpressionOffsets')) { coveringExpressionOffsets = jsonDecoder.decodeList( jsonPath + '.coveringExpressionOffsets', json['coveringExpressionOffsets'], jsonDecoder.decodeInt); } - List coveringExpressionLengths; + List? coveringExpressionLengths; if (json.containsKey('coveringExpressionLengths')) { coveringExpressionLengths = jsonDecoder.decodeList( jsonPath + '.coveringExpressionLengths', @@ -12451,11 +10004,13 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var coveringExpressionOffsets = this.coveringExpressionOffsets; if (coveringExpressionOffsets != null) { result['coveringExpressionOffsets'] = coveringExpressionOffsets; } + var coveringExpressionLengths = this.coveringExpressionLengths; if (coveringExpressionLengths != null) { result['coveringExpressionLengths'] = coveringExpressionLengths; } @@ -12503,41 +10058,19 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class ExtractLocalVariableOptions extends RefactoringOptions { - String _name; - - bool _extractAll; - /// The name that the local variable should be given. - String get name => _name; - - /// The name that the local variable should be given. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// True if all occurrences of the expression within the scope in which the /// variable will be defined should be replaced by a reference to the local /// variable. The expression used to initiate the refactoring will always be /// replaced. - bool get extractAll => _extractAll; + bool extractAll; - /// True if all occurrences of the expression within the scope in which the - /// variable will be defined should be replaced by a reference to the local - /// variable. The expression used to initiate the refactoring will always be - /// replaced. - set extractAll(bool value) { - assert(value != null); - _extractAll = value; - } - - ExtractLocalVariableOptions(String name, bool extractAll) { - this.name = name; - this.extractAll = extractAll; - } + ExtractLocalVariableOptions(this.name, this.extractAll); factory ExtractLocalVariableOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -12567,8 +10100,8 @@ class ExtractLocalVariableOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['extractAll'] = extractAll; return result; @@ -12609,129 +10142,42 @@ class ExtractLocalVariableOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class ExtractMethodFeedback extends RefactoringFeedback { - int _offset; - - int _length; - - String _returnType; - - List _names; - - bool _canCreateGetter; - - List _parameters; - - List _offsets; - - List _lengths; - /// The offset to the beginning of the expression or statements that will be /// extracted. - int get offset => _offset; - - /// The offset to the beginning of the expression or statements that will be - /// extracted. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the expression or statements that will be extracted. - int get length => _length; - - /// The length of the expression or statements that will be extracted. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The proposed return type for the method. If the returned element does not /// have a declared return type, this field will contain an empty string. - String get returnType => _returnType; - - /// The proposed return type for the method. If the returned element does not - /// have a declared return type, this field will contain an empty string. - set returnType(String value) { - assert(value != null); - _returnType = value; - } + String returnType; /// The proposed names for the method. - List get names => _names; - - /// The proposed names for the method. - set names(List value) { - assert(value != null); - _names = value; - } + List names; /// True if a getter could be created rather than a method. - bool get canCreateGetter => _canCreateGetter; - - /// True if a getter could be created rather than a method. - set canCreateGetter(bool value) { - assert(value != null); - _canCreateGetter = value; - } + bool canCreateGetter; /// The proposed parameters for the method. - List get parameters => _parameters; - - /// The proposed parameters for the method. - set parameters(List value) { - assert(value != null); - _parameters = value; - } + List parameters; /// The offsets of the expressions or statements that would be replaced by an /// invocation of the method. - List get offsets => _offsets; - - /// The offsets of the expressions or statements that would be replaced by an - /// invocation of the method. - set offsets(List value) { - assert(value != null); - _offsets = value; - } + List offsets; /// The lengths of the expressions or statements that would be replaced by an /// invocation of the method. The lengths correspond to the offsets. In other /// words, for a given expression (or block of statements), if the offset of /// that expression is offsets[i], then the length of that expression is /// lengths[i]. - List get lengths => _lengths; + List lengths; - /// The lengths of the expressions or statements that would be replaced by an - /// invocation of the method. The lengths correspond to the offsets. In other - /// words, for a given expression (or block of statements), if the offset of - /// that expression is offsets[i], then the length of that expression is - /// lengths[i]. - set lengths(List value) { - assert(value != null); - _lengths = value; - } - - ExtractMethodFeedback( - int offset, - int length, - String returnType, - List names, - bool canCreateGetter, - List parameters, - List offsets, - List lengths) { - this.offset = offset; - this.length = length; - this.returnType = returnType; - this.names = names; - this.canCreateGetter = canCreateGetter; - this.parameters = parameters; - this.offsets = offsets; - this.lengths = lengths; - } + ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, + this.canCreateGetter, this.parameters, this.offsets, this.lengths); factory ExtractMethodFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -12772,7 +10218,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { parameters = jsonDecoder.decodeList( jsonPath + '.parameters', json['parameters'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringMethodParameter.fromJson( jsonDecoder, jsonPath, json)); } else { @@ -12800,8 +10246,8 @@ class ExtractMethodFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['returnType'] = returnType; @@ -12864,44 +10310,15 @@ class ExtractMethodFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class ExtractMethodOptions extends RefactoringOptions { - String _returnType; - - bool _createGetter; - - String _name; - - List _parameters; - - bool _extractAll; - /// The return type that should be defined for the method. - String get returnType => _returnType; - - /// The return type that should be defined for the method. - set returnType(String value) { - assert(value != null); - _returnType = value; - } + String returnType; /// True if a getter should be created rather than a method. It is an error /// if this field is true and the list of parameters is non-empty. - bool get createGetter => _createGetter; - - /// True if a getter should be created rather than a method. It is an error - /// if this field is true and the list of parameters is non-empty. - set createGetter(bool value) { - assert(value != null); - _createGetter = value; - } + bool createGetter; /// The name that the method should be given. - String get name => _name; - - /// The name that the method should be given. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The parameters that should be defined for the method. /// @@ -12913,47 +10330,18 @@ class ExtractMethodOptions extends RefactoringOptions { /// with the same identifiers as proposed. /// - To add new parameters, omit their identifier. /// - To remove some parameters, omit them in this list. - List get parameters => _parameters; - - /// The parameters that should be defined for the method. - /// - /// It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL - /// parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a - /// NAMED parameter. - /// - /// - To change the order and/or update proposed parameters, add parameters - /// with the same identifiers as proposed. - /// - To add new parameters, omit their identifier. - /// - To remove some parameters, omit them in this list. - set parameters(List value) { - assert(value != null); - _parameters = value; - } + List parameters; /// True if all occurrences of the expression or statements should be /// replaced by an invocation of the method. The expression or statements /// used to initiate the refactoring will always be replaced. - bool get extractAll => _extractAll; + bool extractAll; - /// True if all occurrences of the expression or statements should be - /// replaced by an invocation of the method. The expression or statements - /// used to initiate the refactoring will always be replaced. - set extractAll(bool value) { - assert(value != null); - _extractAll = value; - } - - ExtractMethodOptions(String returnType, bool createGetter, String name, - List parameters, bool extractAll) { - this.returnType = returnType; - this.createGetter = createGetter; - this.name = name; - this.parameters = parameters; - this.extractAll = extractAll; - } + ExtractMethodOptions(this.returnType, this.createGetter, this.name, + this.parameters, this.extractAll); factory ExtractMethodOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String returnType; @@ -12981,7 +10369,7 @@ class ExtractMethodOptions extends RefactoringOptions { parameters = jsonDecoder.decodeList( jsonPath + '.parameters', json['parameters'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringMethodParameter.fromJson( jsonDecoder, jsonPath, json)); } else { @@ -13008,8 +10396,8 @@ class ExtractMethodOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['returnType'] = returnType; result['createGetter'] = createGetter; result['name'] = name; @@ -13061,7 +10449,7 @@ class ExtractWidgetFeedback extends RefactoringFeedback { ExtractWidgetFeedback(); factory ExtractWidgetFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { return ExtractWidgetFeedback(); @@ -13071,8 +10459,8 @@ class ExtractWidgetFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -13102,23 +10490,13 @@ class ExtractWidgetFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class ExtractWidgetOptions extends RefactoringOptions { - String _name; - /// The name that the widget class should be given. - String get name => _name; + String name; - /// The name that the widget class should be given. - set name(String value) { - assert(value != null); - _name = value; - } - - ExtractWidgetOptions(String name) { - this.name = name; - } + ExtractWidgetOptions(this.name); factory ExtractWidgetOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -13140,8 +10518,8 @@ class ExtractWidgetOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; return result; } @@ -13197,7 +10575,7 @@ class FileKind implements Enum { } factory FileKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FileKind(json); @@ -13223,35 +10601,16 @@ class FileKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterGetWidgetDescriptionParams implements RequestParams { - String _file; - - int _offset; - /// The file where the widget instance is created. - String get file => _file; - - /// The file where the widget instance is created. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset in the file where the widget instance is created. - int get offset => _offset; + int offset; - /// The offset in the file where the widget instance is created. - set offset(int value) { - assert(value != null); - _offset = value; - } - - FlutterGetWidgetDescriptionParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + FlutterGetWidgetDescriptionParams(this.file, this.offset); factory FlutterGetWidgetDescriptionParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -13279,8 +10638,8 @@ class FlutterGetWidgetDescriptionParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -13319,29 +10678,16 @@ class FlutterGetWidgetDescriptionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class FlutterGetWidgetDescriptionResult implements ResponseResult { - List _properties; - /// The list of properties of the widget. Some of the properties might be /// read only, when their editor is not set. This might be because they have /// type that we don't know how to edit, or for compound properties that work /// as containers for sub-properties. - List get properties => _properties; + List properties; - /// The list of properties of the widget. Some of the properties might be - /// read only, when their editor is not set. This might be because they have - /// type that we don't know how to edit, or for compound properties that work - /// as containers for sub-properties. - set properties(List value) { - assert(value != null); - _properties = value; - } - - FlutterGetWidgetDescriptionResult(List properties) { - this.properties = properties; - } + FlutterGetWidgetDescriptionResult(this.properties); factory FlutterGetWidgetDescriptionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List properties; @@ -13349,7 +10695,7 @@ class FlutterGetWidgetDescriptionResult implements ResponseResult { properties = jsonDecoder.decodeList( jsonPath + '.properties', json['properties'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterWidgetProperty.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'properties'); @@ -13369,8 +10715,8 @@ class FlutterGetWidgetDescriptionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['properties'] = properties .map((FlutterWidgetProperty value) => value.toJson()) .toList(); @@ -13421,178 +10767,65 @@ class FlutterGetWidgetDescriptionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class FlutterOutline implements HasToJson { - FlutterOutlineKind _kind; - - int _offset; - - int _length; - - int _codeOffset; - - int _codeLength; - - String _label; - - Element _dartElement; - - List _attributes; - - String _className; - - String _parentAssociationLabel; - - String _variableName; - - List _children; - /// The kind of the node. - FlutterOutlineKind get kind => _kind; - - /// The kind of the node. - set kind(FlutterOutlineKind value) { - assert(value != null); - _kind = value; - } + FlutterOutlineKind kind; /// The offset of the first character of the element. This is different than /// the offset in the Element, which is the offset of the name of the /// element. It can be used, for example, to map locations in the file back /// to an outline. - int get offset => _offset; - - /// The offset of the first character of the element. This is different than - /// the offset in the Element, which is the offset of the name of the - /// element. It can be used, for example, to map locations in the file back - /// to an outline. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the element. - int get length => _length; - - /// The length of the element. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The offset of the first character of the element code, which is neither /// documentation, nor annotation. - int get codeOffset => _codeOffset; - - /// The offset of the first character of the element code, which is neither - /// documentation, nor annotation. - set codeOffset(int value) { - assert(value != null); - _codeOffset = value; - } + int codeOffset; /// The length of the element code. - int get codeLength => _codeLength; - - /// The length of the element code. - set codeLength(int value) { - assert(value != null); - _codeLength = value; - } + int codeLength; /// The text label of the node children of the node. It is provided for any /// FlutterOutlineKind.GENERIC node, where better information is not /// available. - String get label => _label; - - /// The text label of the node children of the node. It is provided for any - /// FlutterOutlineKind.GENERIC node, where better information is not - /// available. - set label(String value) { - _label = value; - } + String? label; /// If this node is a Dart element, the description of it; omitted otherwise. - Element get dartElement => _dartElement; - - /// If this node is a Dart element, the description of it; omitted otherwise. - set dartElement(Element value) { - _dartElement = value; - } + Element? dartElement; /// Additional attributes for this node, which might be interesting to /// display on the client. These attributes are usually arguments for the /// instance creation or the invocation that created the widget. - List get attributes => _attributes; - - /// Additional attributes for this node, which might be interesting to - /// display on the client. These attributes are usually arguments for the - /// instance creation or the invocation that created the widget. - set attributes(List value) { - _attributes = value; - } + List? attributes; /// If the node creates a new class instance, or a reference to an instance, /// this field has the name of the class. - String get className => _className; - - /// If the node creates a new class instance, or a reference to an instance, - /// this field has the name of the class. - set className(String value) { - _className = value; - } + String? className; /// A short text description how this node is associated with the parent /// node. For example "appBar" or "body" in Scaffold. - String get parentAssociationLabel => _parentAssociationLabel; - - /// A short text description how this node is associated with the parent - /// node. For example "appBar" or "body" in Scaffold. - set parentAssociationLabel(String value) { - _parentAssociationLabel = value; - } + String? parentAssociationLabel; /// If FlutterOutlineKind.VARIABLE, the name of the variable. - String get variableName => _variableName; - - /// If FlutterOutlineKind.VARIABLE, the name of the variable. - set variableName(String value) { - _variableName = value; - } + String? variableName; /// The children of the node. The field will be omitted if the node has no /// children. - List get children => _children; + List? children; - /// The children of the node. The field will be omitted if the node has no - /// children. - set children(List value) { - _children = value; - } - - FlutterOutline(FlutterOutlineKind kind, int offset, int length, - int codeOffset, int codeLength, - {String label, - Element dartElement, - List attributes, - String className, - String parentAssociationLabel, - String variableName, - List children}) { - this.kind = kind; - this.offset = offset; - this.length = length; - this.codeOffset = codeOffset; - this.codeLength = codeLength; - this.label = label; - this.dartElement = dartElement; - this.attributes = attributes; - this.className = className; - this.parentAssociationLabel = parentAssociationLabel; - this.variableName = variableName; - this.children = children; - } + FlutterOutline( + this.kind, this.offset, this.length, this.codeOffset, this.codeLength, + {this.label, + this.dartElement, + this.attributes, + this.className, + this.parentAssociationLabel, + this.variableName, + this.children}); factory FlutterOutline.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { FlutterOutlineKind kind; @@ -13628,45 +10861,45 @@ class FlutterOutline implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'codeLength'); } - String label; + String? label; if (json.containsKey('label')) { label = jsonDecoder.decodeString(jsonPath + '.label', json['label']); } - Element dartElement; + Element? dartElement; if (json.containsKey('dartElement')) { dartElement = Element.fromJson( jsonDecoder, jsonPath + '.dartElement', json['dartElement']); } - List attributes; + List? attributes; if (json.containsKey('attributes')) { attributes = jsonDecoder.decodeList( jsonPath + '.attributes', json['attributes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterOutlineAttribute.fromJson(jsonDecoder, jsonPath, json)); } - String className; + String? className; if (json.containsKey('className')) { className = jsonDecoder.decodeString( jsonPath + '.className', json['className']); } - String parentAssociationLabel; + String? parentAssociationLabel; if (json.containsKey('parentAssociationLabel')) { parentAssociationLabel = jsonDecoder.decodeString( jsonPath + '.parentAssociationLabel', json['parentAssociationLabel']); } - String variableName; + String? variableName; if (json.containsKey('variableName')) { variableName = jsonDecoder.decodeString( jsonPath + '.variableName', json['variableName']); } - List children; + List? children; if (json.containsKey('children')) { children = jsonDecoder.decodeList( jsonPath + '.children', json['children'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterOutline.fromJson(jsonDecoder, jsonPath, json)); } return FlutterOutline(kind, offset, length, codeOffset, codeLength, @@ -13683,33 +10916,40 @@ class FlutterOutline implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['offset'] = offset; result['length'] = length; result['codeOffset'] = codeOffset; result['codeLength'] = codeLength; + var label = this.label; if (label != null) { result['label'] = label; } + var dartElement = this.dartElement; if (dartElement != null) { result['dartElement'] = dartElement.toJson(); } + var attributes = this.attributes; if (attributes != null) { result['attributes'] = attributes .map((FlutterOutlineAttribute value) => value.toJson()) .toList(); } + var className = this.className; if (className != null) { result['className'] = className; } + var parentAssociationLabel = this.parentAssociationLabel; if (parentAssociationLabel != null) { result['parentAssociationLabel'] = parentAssociationLabel; } + var variableName = this.variableName; if (variableName != null) { result['variableName'] = variableName; } + var children = this.children; if (children != null) { result['children'] = children.map((FlutterOutline value) => value.toJson()).toList(); @@ -13777,111 +11017,44 @@ class FlutterOutline implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class FlutterOutlineAttribute implements HasToJson { - String _name; - - String _label; - - bool _literalValueBoolean; - - int _literalValueInteger; - - String _literalValueString; - - Location _nameLocation; - - Location _valueLocation; - /// The name of the attribute. - String get name => _name; - - /// The name of the attribute. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The label of the attribute value, usually the Dart code. It might be /// quite long, the client should abbreviate as needed. - String get label => _label; - - /// The label of the attribute value, usually the Dart code. It might be - /// quite long, the client should abbreviate as needed. - set label(String value) { - assert(value != null); - _label = value; - } + String label; /// The boolean literal value of the attribute. This field is absent if the /// value is not a boolean literal. - bool get literalValueBoolean => _literalValueBoolean; - - /// The boolean literal value of the attribute. This field is absent if the - /// value is not a boolean literal. - set literalValueBoolean(bool value) { - _literalValueBoolean = value; - } + bool? literalValueBoolean; /// The integer literal value of the attribute. This field is absent if the /// value is not an integer literal. - int get literalValueInteger => _literalValueInteger; - - /// The integer literal value of the attribute. This field is absent if the - /// value is not an integer literal. - set literalValueInteger(int value) { - _literalValueInteger = value; - } + int? literalValueInteger; /// The string literal value of the attribute. This field is absent if the /// value is not a string literal. - String get literalValueString => _literalValueString; - - /// The string literal value of the attribute. This field is absent if the - /// value is not a string literal. - set literalValueString(String value) { - _literalValueString = value; - } + String? literalValueString; /// If the attribute is a named argument, the location of the name, without /// the colon. - Location get nameLocation => _nameLocation; - - /// If the attribute is a named argument, the location of the name, without - /// the colon. - set nameLocation(Location value) { - _nameLocation = value; - } + Location? nameLocation; /// The location of the value. /// /// This field is always available, but marked optional for backward /// compatibility between new clients with older servers. - Location get valueLocation => _valueLocation; + Location? valueLocation; - /// The location of the value. - /// - /// This field is always available, but marked optional for backward - /// compatibility between new clients with older servers. - set valueLocation(Location value) { - _valueLocation = value; - } - - FlutterOutlineAttribute(String name, String label, - {bool literalValueBoolean, - int literalValueInteger, - String literalValueString, - Location nameLocation, - Location valueLocation}) { - this.name = name; - this.label = label; - this.literalValueBoolean = literalValueBoolean; - this.literalValueInteger = literalValueInteger; - this.literalValueString = literalValueString; - this.nameLocation = nameLocation; - this.valueLocation = valueLocation; - } + FlutterOutlineAttribute(this.name, this.label, + {this.literalValueBoolean, + this.literalValueInteger, + this.literalValueString, + this.nameLocation, + this.valueLocation}); factory FlutterOutlineAttribute.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -13896,27 +11069,27 @@ class FlutterOutlineAttribute implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'label'); } - bool literalValueBoolean; + bool? literalValueBoolean; if (json.containsKey('literalValueBoolean')) { literalValueBoolean = jsonDecoder.decodeBool( jsonPath + '.literalValueBoolean', json['literalValueBoolean']); } - int literalValueInteger; + int? literalValueInteger; if (json.containsKey('literalValueInteger')) { literalValueInteger = jsonDecoder.decodeInt( jsonPath + '.literalValueInteger', json['literalValueInteger']); } - String literalValueString; + String? literalValueString; if (json.containsKey('literalValueString')) { literalValueString = jsonDecoder.decodeString( jsonPath + '.literalValueString', json['literalValueString']); } - Location nameLocation; + Location? nameLocation; if (json.containsKey('nameLocation')) { nameLocation = Location.fromJson( jsonDecoder, jsonPath + '.nameLocation', json['nameLocation']); } - Location valueLocation; + Location? valueLocation; if (json.containsKey('valueLocation')) { valueLocation = Location.fromJson( jsonDecoder, jsonPath + '.valueLocation', json['valueLocation']); @@ -13933,22 +11106,27 @@ class FlutterOutlineAttribute implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['label'] = label; + var literalValueBoolean = this.literalValueBoolean; if (literalValueBoolean != null) { result['literalValueBoolean'] = literalValueBoolean; } + var literalValueInteger = this.literalValueInteger; if (literalValueInteger != null) { result['literalValueInteger'] = literalValueInteger; } + var literalValueString = this.literalValueString; if (literalValueString != null) { result['literalValueString'] = literalValueString; } + var nameLocation = this.nameLocation; if (nameLocation != null) { result['nameLocation'] = nameLocation.toJson(); } + var valueLocation = this.valueLocation; if (valueLocation != null) { result['valueLocation'] = valueLocation.toJson(); } @@ -14057,7 +11235,7 @@ class FlutterOutlineKind implements Enum { } factory FlutterOutlineKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FlutterOutlineKind(json); @@ -14083,35 +11261,16 @@ class FlutterOutlineKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterOutlineParams implements HasToJson { - String _file; - - FlutterOutline _outline; - /// The file with which the outline is associated. - String get file => _file; - - /// The file with which the outline is associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The outline associated with the file. - FlutterOutline get outline => _outline; + FlutterOutline outline; - /// The outline associated with the file. - set outline(FlutterOutline value) { - assert(value != null); - _outline = value; - } - - FlutterOutlineParams(String file, FlutterOutline outline) { - this.file = file; - this.outline = outline; - } + FlutterOutlineParams(this.file, this.outline); factory FlutterOutlineParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -14139,8 +11298,8 @@ class FlutterOutlineParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['outline'] = outline.toJson(); return result; @@ -14197,7 +11356,7 @@ class FlutterService implements Enum { } factory FlutterService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FlutterService(json); @@ -14222,35 +11381,23 @@ class FlutterService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterSetSubscriptionsParams implements RequestParams { - Map> _subscriptions; - /// A table mapping services to a list of the files being subscribed to the /// service. - Map> get subscriptions => _subscriptions; + Map> subscriptions; - /// A table mapping services to a list of the files being subscribed to the - /// service. - set subscriptions(Map> value) { - assert(value != null); - _subscriptions = value; - } - - FlutterSetSubscriptionsParams( - Map> subscriptions) { - this.subscriptions = subscriptions; - } + FlutterSetSubscriptionsParams(this.subscriptions); factory FlutterSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map> subscriptions; if (json.containsKey('subscriptions')) { subscriptions = jsonDecoder.decodeMap( jsonPath + '.subscriptions', json['subscriptions'], - keyDecoder: (String jsonPath, Object json) => + keyDecoder: (String jsonPath, Object? json) => FlutterService.fromJson(jsonDecoder, jsonPath, json), - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -14268,8 +11415,8 @@ class FlutterSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = mapMap(subscriptions, keyCallback: (FlutterService value) => value.toJson()); return result; @@ -14308,7 +11455,7 @@ class FlutterSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class FlutterSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -14338,26 +11485,12 @@ class FlutterSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class FlutterSetWidgetPropertyValueParams implements RequestParams { - int _id; - - FlutterWidgetPropertyValue _value; - /// The identifier of the property, previously returned as a part of a /// FlutterWidgetProperty. /// /// An error of type FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID is /// generated if the identifier is not valid. - int get id => _id; - - /// The identifier of the property, previously returned as a part of a - /// FlutterWidgetProperty. - /// - /// An error of type FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID is - /// generated if the identifier is not valid. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The new value to set for the property. /// @@ -14368,29 +11501,12 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { /// /// If the expression is not a syntactically valid Dart code, then /// FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION is reported. - FlutterWidgetPropertyValue get value => _value; + FlutterWidgetPropertyValue? value; - /// The new value to set for the property. - /// - /// If absent, indicates that the property should be removed. If the property - /// corresponds to an optional parameter, the corresponding named argument is - /// removed. If the property isRequired is true, - /// FLUTTER_SET_WIDGET_PROPERTY_VALUE_IS_REQUIRED error is generated. - /// - /// If the expression is not a syntactically valid Dart code, then - /// FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION is reported. - set value(FlutterWidgetPropertyValue value) { - _value = value; - } - - FlutterSetWidgetPropertyValueParams(int id, - {FlutterWidgetPropertyValue value}) { - this.id = id; - this.value = value; - } + FlutterSetWidgetPropertyValueParams(this.id, {this.value}); factory FlutterSetWidgetPropertyValueParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int id; @@ -14399,7 +11515,7 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'id'); } - FlutterWidgetPropertyValue value; + FlutterWidgetPropertyValue? value; if (json.containsKey('value')) { value = FlutterWidgetPropertyValue.fromJson( jsonDecoder, jsonPath + '.value', json['value']); @@ -14417,9 +11533,10 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; + var value = this.value; if (value != null) { result['value'] = value.toJson(); } @@ -14459,23 +11576,13 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class FlutterSetWidgetPropertyValueResult implements ResponseResult { - SourceChange _change; - /// The change that should be applied. - SourceChange get change => _change; + SourceChange change; - /// The change that should be applied. - set change(SourceChange value) { - assert(value != null); - _change = value; - } - - FlutterSetWidgetPropertyValueResult(SourceChange change) { - this.change = change; - } + FlutterSetWidgetPropertyValueResult(this.change); factory FlutterSetWidgetPropertyValueResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceChange change; @@ -14500,8 +11607,8 @@ class FlutterSetWidgetPropertyValueResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['change'] = change.toJson(); return result; } @@ -14546,158 +11653,66 @@ class FlutterSetWidgetPropertyValueResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetProperty implements HasToJson { - String _documentation; - - String _expression; - - int _id; - - bool _isRequired; - - bool _isSafeToUpdate; - - String _name; - - List _children; - - FlutterWidgetPropertyEditor _editor; - - FlutterWidgetPropertyValue _value; - /// The documentation of the property to show to the user. Omitted if the /// server does not know the documentation, e.g. because the corresponding /// field is not documented. - String get documentation => _documentation; - - /// The documentation of the property to show to the user. Omitted if the - /// server does not know the documentation, e.g. because the corresponding - /// field is not documented. - set documentation(String value) { - _documentation = value; - } + String? documentation; /// If the value of this property is set, the Dart code of the expression of /// this property. - String get expression => _expression; - - /// If the value of this property is set, the Dart code of the expression of - /// this property. - set expression(String value) { - _expression = value; - } + String? expression; /// The unique identifier of the property, must be passed back to the server /// when updating the property value. Identifiers become invalid on any /// source code change. - int get id => _id; - - /// The unique identifier of the property, must be passed back to the server - /// when updating the property value. Identifiers become invalid on any - /// source code change. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// True if the property is required, e.g. because it corresponds to a /// required parameter of a constructor. - bool get isRequired => _isRequired; - - /// True if the property is required, e.g. because it corresponds to a - /// required parameter of a constructor. - set isRequired(bool value) { - assert(value != null); - _isRequired = value; - } + bool isRequired; /// If the property expression is a concrete value (e.g. a literal, or an /// enum constant), then it is safe to replace the expression with another /// concrete value. In this case this field is true. Otherwise, for example /// when the expression is a reference to a field, so that its value is /// provided from outside, this field is false. - bool get isSafeToUpdate => _isSafeToUpdate; - - /// If the property expression is a concrete value (e.g. a literal, or an - /// enum constant), then it is safe to replace the expression with another - /// concrete value. In this case this field is true. Otherwise, for example - /// when the expression is a reference to a field, so that its value is - /// provided from outside, this field is false. - set isSafeToUpdate(bool value) { - assert(value != null); - _isSafeToUpdate = value; - } + bool isSafeToUpdate; /// The name of the property to display to the user. - String get name => _name; - - /// The name of the property to display to the user. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The list of children properties, if any. For example any property of type /// EdgeInsets will have four children properties of type double - left / top /// / right / bottom. - List get children => _children; - - /// The list of children properties, if any. For example any property of type - /// EdgeInsets will have four children properties of type double - left / top - /// / right / bottom. - set children(List value) { - _children = value; - } + List? children; /// The editor that should be used by the client. This field is omitted if /// the server does not know the editor for this property, for example /// because it does not have one of the supported types. - FlutterWidgetPropertyEditor get editor => _editor; - - /// The editor that should be used by the client. This field is omitted if - /// the server does not know the editor for this property, for example - /// because it does not have one of the supported types. - set editor(FlutterWidgetPropertyEditor value) { - _editor = value; - } + FlutterWidgetPropertyEditor? editor; /// If the expression is set, and the server knows the value of the /// expression, this field is set. - FlutterWidgetPropertyValue get value => _value; - - /// If the expression is set, and the server knows the value of the - /// expression, this field is set. - set value(FlutterWidgetPropertyValue value) { - _value = value; - } + FlutterWidgetPropertyValue? value; FlutterWidgetProperty( - int id, bool isRequired, bool isSafeToUpdate, String name, - {String documentation, - String expression, - List children, - FlutterWidgetPropertyEditor editor, - FlutterWidgetPropertyValue value}) { - this.documentation = documentation; - this.expression = expression; - this.id = id; - this.isRequired = isRequired; - this.isSafeToUpdate = isSafeToUpdate; - this.name = name; - this.children = children; - this.editor = editor; - this.value = value; - } + this.id, this.isRequired, this.isSafeToUpdate, this.name, + {this.documentation, + this.expression, + this.children, + this.editor, + this.value}); factory FlutterWidgetProperty.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String documentation; + String? documentation; if (json.containsKey('documentation')) { documentation = jsonDecoder.decodeString( jsonPath + '.documentation', json['documentation']); } - String expression; + String? expression; if (json.containsKey('expression')) { expression = jsonDecoder.decodeString( jsonPath + '.expression', json['expression']); @@ -14728,20 +11743,20 @@ class FlutterWidgetProperty implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - List children; + List? children; if (json.containsKey('children')) { children = jsonDecoder.decodeList( jsonPath + '.children', json['children'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterWidgetProperty.fromJson(jsonDecoder, jsonPath, json)); } - FlutterWidgetPropertyEditor editor; + FlutterWidgetPropertyEditor? editor; if (json.containsKey('editor')) { editor = FlutterWidgetPropertyEditor.fromJson( jsonDecoder, jsonPath + '.editor', json['editor']); } - FlutterWidgetPropertyValue value; + FlutterWidgetPropertyValue? value; if (json.containsKey('value')) { value = FlutterWidgetPropertyValue.fromJson( jsonDecoder, jsonPath + '.value', json['value']); @@ -14758,11 +11773,13 @@ class FlutterWidgetProperty implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var documentation = this.documentation; if (documentation != null) { result['documentation'] = documentation; } + var expression = this.expression; if (expression != null) { result['expression'] = expression; } @@ -14770,14 +11787,17 @@ class FlutterWidgetProperty implements HasToJson { result['isRequired'] = isRequired; result['isSafeToUpdate'] = isSafeToUpdate; result['name'] = name; + var children = this.children; if (children != null) { result['children'] = children .map((FlutterWidgetProperty value) => value.toJson()) .toList(); } + var editor = this.editor; if (editor != null) { result['editor'] = editor.toJson(); } + var value = this.value; if (value != null) { result['value'] = value.toJson(); } @@ -14829,31 +11849,14 @@ class FlutterWidgetProperty implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetPropertyEditor implements HasToJson { - FlutterWidgetPropertyEditorKind _kind; + FlutterWidgetPropertyEditorKind kind; - List _enumItems; + List? enumItems; - FlutterWidgetPropertyEditorKind get kind => _kind; - - set kind(FlutterWidgetPropertyEditorKind value) { - assert(value != null); - _kind = value; - } - - List get enumItems => _enumItems; - - set enumItems(List value) { - _enumItems = value; - } - - FlutterWidgetPropertyEditor(FlutterWidgetPropertyEditorKind kind, - {List enumItems}) { - this.kind = kind; - this.enumItems = enumItems; - } + FlutterWidgetPropertyEditor(this.kind, {this.enumItems}); factory FlutterWidgetPropertyEditor.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { FlutterWidgetPropertyEditorKind kind; @@ -14863,12 +11866,12 @@ class FlutterWidgetPropertyEditor implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'kind'); } - List enumItems; + List? enumItems; if (json.containsKey('enumItems')) { enumItems = jsonDecoder.decodeList( jsonPath + '.enumItems', json['enumItems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterWidgetPropertyValueEnumItem.fromJson( jsonDecoder, jsonPath, json)); } @@ -14879,9 +11882,10 @@ class FlutterWidgetPropertyEditor implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); + var enumItems = this.enumItems; if (enumItems != null) { result['enumItems'] = enumItems .map((FlutterWidgetPropertyValueEnumItem value) => value.toJson()) @@ -14991,7 +11995,7 @@ class FlutterWidgetPropertyEditorKind implements Enum { } factory FlutterWidgetPropertyEditorKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FlutterWidgetPropertyEditorKind(json); @@ -15022,101 +12026,57 @@ class FlutterWidgetPropertyEditorKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetPropertyValue implements HasToJson { - bool _boolValue; + bool? boolValue; - double _doubleValue; + double? doubleValue; - int _intValue; + int? intValue; - String _stringValue; + String? stringValue; - FlutterWidgetPropertyValueEnumItem _enumValue; - - String _expression; - - bool get boolValue => _boolValue; - - set boolValue(bool value) { - _boolValue = value; - } - - double get doubleValue => _doubleValue; - - set doubleValue(double value) { - _doubleValue = value; - } - - int get intValue => _intValue; - - set intValue(int value) { - _intValue = value; - } - - String get stringValue => _stringValue; - - set stringValue(String value) { - _stringValue = value; - } - - FlutterWidgetPropertyValueEnumItem get enumValue => _enumValue; - - set enumValue(FlutterWidgetPropertyValueEnumItem value) { - _enumValue = value; - } + FlutterWidgetPropertyValueEnumItem? enumValue; /// A free-form expression, which will be used as the value as is. - String get expression => _expression; - - /// A free-form expression, which will be used as the value as is. - set expression(String value) { - _expression = value; - } + String? expression; FlutterWidgetPropertyValue( - {bool boolValue, - double doubleValue, - int intValue, - String stringValue, - FlutterWidgetPropertyValueEnumItem enumValue, - String expression}) { - this.boolValue = boolValue; - this.doubleValue = doubleValue; - this.intValue = intValue; - this.stringValue = stringValue; - this.enumValue = enumValue; - this.expression = expression; - } + {this.boolValue, + this.doubleValue, + this.intValue, + this.stringValue, + this.enumValue, + this.expression}); factory FlutterWidgetPropertyValue.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - bool boolValue; + bool? boolValue; if (json.containsKey('boolValue')) { boolValue = jsonDecoder.decodeBool(jsonPath + '.boolValue', json['boolValue']); } - double doubleValue; + double? doubleValue; if (json.containsKey('doubleValue')) { doubleValue = jsonDecoder.decodeDouble( jsonPath + '.doubleValue', json['doubleValue']); } - int intValue; + int? intValue; if (json.containsKey('intValue')) { intValue = jsonDecoder.decodeInt(jsonPath + '.intValue', json['intValue']); } - String stringValue; + String? stringValue; if (json.containsKey('stringValue')) { stringValue = jsonDecoder.decodeString( jsonPath + '.stringValue', json['stringValue']); } - FlutterWidgetPropertyValueEnumItem enumValue; + FlutterWidgetPropertyValueEnumItem? enumValue; if (json.containsKey('enumValue')) { enumValue = FlutterWidgetPropertyValueEnumItem.fromJson( jsonDecoder, jsonPath + '.enumValue', json['enumValue']); } - String expression; + String? expression; if (json.containsKey('expression')) { expression = jsonDecoder.decodeString( jsonPath + '.expression', json['expression']); @@ -15134,23 +12094,29 @@ class FlutterWidgetPropertyValue implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var boolValue = this.boolValue; if (boolValue != null) { result['boolValue'] = boolValue; } + var doubleValue = this.doubleValue; if (doubleValue != null) { result['doubleValue'] = doubleValue; } + var intValue = this.intValue; if (intValue != null) { result['intValue'] = intValue; } + var stringValue = this.stringValue; if (stringValue != null) { result['stringValue'] = stringValue; } + var enumValue = this.enumValue; if (enumValue != null) { result['enumValue'] = enumValue.toJson(); } + var expression = this.expression; if (expression != null) { result['expression'] = expression; } @@ -15197,70 +12163,28 @@ class FlutterWidgetPropertyValue implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetPropertyValueEnumItem implements HasToJson { - String _libraryUri; - - String _className; - - String _name; - - String _documentation; - /// The URI of the library containing the className. When the enum item is /// passed back, this will allow the server to import the corresponding /// library if necessary. - String get libraryUri => _libraryUri; - - /// The URI of the library containing the className. When the enum item is - /// passed back, this will allow the server to import the corresponding - /// library if necessary. - set libraryUri(String value) { - assert(value != null); - _libraryUri = value; - } + String libraryUri; /// The name of the class or enum. - String get className => _className; - - /// The name of the class or enum. - set className(String value) { - assert(value != null); - _className = value; - } + String className; /// The name of the field in the enumeration, or the static field in the /// class. - String get name => _name; - - /// The name of the field in the enumeration, or the static field in the - /// class. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The documentation to show to the user. Omitted if the server does not /// know the documentation, e.g. because the corresponding field is not /// documented. - String get documentation => _documentation; + String? documentation; - /// The documentation to show to the user. Omitted if the server does not - /// know the documentation, e.g. because the corresponding field is not - /// documented. - set documentation(String value) { - _documentation = value; - } - - FlutterWidgetPropertyValueEnumItem( - String libraryUri, String className, String name, - {String documentation}) { - this.libraryUri = libraryUri; - this.className = className; - this.name = name; - this.documentation = documentation; - } + FlutterWidgetPropertyValueEnumItem(this.libraryUri, this.className, this.name, + {this.documentation}); factory FlutterWidgetPropertyValueEnumItem.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String libraryUri; @@ -15283,7 +12207,7 @@ class FlutterWidgetPropertyValueEnumItem implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - String documentation; + String? documentation; if (json.containsKey('documentation')) { documentation = jsonDecoder.decodeString( jsonPath + '.documentation', json['documentation']); @@ -15297,11 +12221,12 @@ class FlutterWidgetPropertyValueEnumItem implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['libraryUri'] = libraryUri; result['className'] = className; result['name'] = name; + var documentation = this.documentation; if (documentation != null) { result['documentation'] = documentation; } @@ -15363,7 +12288,7 @@ class GeneralAnalysisService implements Enum { } factory GeneralAnalysisService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return GeneralAnalysisService(json); @@ -15399,195 +12324,76 @@ class GeneralAnalysisService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class HoverInformation implements HasToJson { - int _offset; - - int _length; - - String _containingLibraryPath; - - String _containingLibraryName; - - String _containingClassDescription; - - String _dartdoc; - - String _elementDescription; - - String _elementKind; - - bool _isDeprecated; - - String _parameter; - - String _propagatedType; - - String _staticType; - /// The offset of the range of characters that encompasses the cursor /// position and has the same hover information as the cursor position. - int get offset => _offset; - - /// The offset of the range of characters that encompasses the cursor - /// position and has the same hover information as the cursor position. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the range of characters that encompasses the cursor /// position and has the same hover information as the cursor position. - int get length => _length; - - /// The length of the range of characters that encompasses the cursor - /// position and has the same hover information as the cursor position. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The path to the defining compilation unit of the library in which the /// referenced element is declared. This data is omitted if there is no /// referenced element, or if the element is declared inside an HTML file. - String get containingLibraryPath => _containingLibraryPath; - - /// The path to the defining compilation unit of the library in which the - /// referenced element is declared. This data is omitted if there is no - /// referenced element, or if the element is declared inside an HTML file. - set containingLibraryPath(String value) { - _containingLibraryPath = value; - } + String? containingLibraryPath; /// The URI of the containing library, examples here include "dart:core", /// "package:.." and file uris represented by the path on disk, "/..". The /// data is omitted if the element is declared inside an HTML file. - String get containingLibraryName => _containingLibraryName; - - /// The URI of the containing library, examples here include "dart:core", - /// "package:.." and file uris represented by the path on disk, "/..". The - /// data is omitted if the element is declared inside an HTML file. - set containingLibraryName(String value) { - _containingLibraryName = value; - } + String? containingLibraryName; /// A human-readable description of the class declaring the element being /// referenced. This data is omitted if there is no referenced element, or if /// the element is not a class member. - String get containingClassDescription => _containingClassDescription; - - /// A human-readable description of the class declaring the element being - /// referenced. This data is omitted if there is no referenced element, or if - /// the element is not a class member. - set containingClassDescription(String value) { - _containingClassDescription = value; - } + String? containingClassDescription; /// The dartdoc associated with the referenced element. Other than the /// removal of the comment delimiters, including leading asterisks in the /// case of a block comment, the dartdoc is unprocessed markdown. This data /// is omitted if there is no referenced element, or if the element has no /// dartdoc. - String get dartdoc => _dartdoc; - - /// The dartdoc associated with the referenced element. Other than the - /// removal of the comment delimiters, including leading asterisks in the - /// case of a block comment, the dartdoc is unprocessed markdown. This data - /// is omitted if there is no referenced element, or if the element has no - /// dartdoc. - set dartdoc(String value) { - _dartdoc = value; - } + String? dartdoc; /// A human-readable description of the element being referenced. This data /// is omitted if there is no referenced element. - String get elementDescription => _elementDescription; - - /// A human-readable description of the element being referenced. This data - /// is omitted if there is no referenced element. - set elementDescription(String value) { - _elementDescription = value; - } + String? elementDescription; /// A human-readable description of the kind of element being referenced /// (such as "class" or "function type alias"). This data is omitted if there /// is no referenced element. - String get elementKind => _elementKind; - - /// A human-readable description of the kind of element being referenced - /// (such as "class" or "function type alias"). This data is omitted if there - /// is no referenced element. - set elementKind(String value) { - _elementKind = value; - } + String? elementKind; /// True if the referenced element is deprecated. - bool get isDeprecated => _isDeprecated; - - /// True if the referenced element is deprecated. - set isDeprecated(bool value) { - _isDeprecated = value; - } + bool? isDeprecated; /// A human-readable description of the parameter corresponding to the /// expression being hovered over. This data is omitted if the location is /// not in an argument to a function. - String get parameter => _parameter; - - /// A human-readable description of the parameter corresponding to the - /// expression being hovered over. This data is omitted if the location is - /// not in an argument to a function. - set parameter(String value) { - _parameter = value; - } + String? parameter; /// The name of the propagated type of the expression. This data is omitted /// if the location does not correspond to an expression or if there is no /// propagated type information. - String get propagatedType => _propagatedType; - - /// The name of the propagated type of the expression. This data is omitted - /// if the location does not correspond to an expression or if there is no - /// propagated type information. - set propagatedType(String value) { - _propagatedType = value; - } + String? propagatedType; /// The name of the static type of the expression. This data is omitted if /// the location does not correspond to an expression. - String get staticType => _staticType; + String? staticType; - /// The name of the static type of the expression. This data is omitted if - /// the location does not correspond to an expression. - set staticType(String value) { - _staticType = value; - } - - HoverInformation(int offset, int length, - {String containingLibraryPath, - String containingLibraryName, - String containingClassDescription, - String dartdoc, - String elementDescription, - String elementKind, - bool isDeprecated, - String parameter, - String propagatedType, - String staticType}) { - this.offset = offset; - this.length = length; - this.containingLibraryPath = containingLibraryPath; - this.containingLibraryName = containingLibraryName; - this.containingClassDescription = containingClassDescription; - this.dartdoc = dartdoc; - this.elementDescription = elementDescription; - this.elementKind = elementKind; - this.isDeprecated = isDeprecated; - this.parameter = parameter; - this.propagatedType = propagatedType; - this.staticType = staticType; - } + HoverInformation(this.offset, this.length, + {this.containingLibraryPath, + this.containingLibraryName, + this.containingClassDescription, + this.dartdoc, + this.elementDescription, + this.elementKind, + this.isDeprecated, + this.parameter, + this.propagatedType, + this.staticType}); factory HoverInformation.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -15602,53 +12408,53 @@ class HoverInformation implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'length'); } - String containingLibraryPath; + String? containingLibraryPath; if (json.containsKey('containingLibraryPath')) { containingLibraryPath = jsonDecoder.decodeString( jsonPath + '.containingLibraryPath', json['containingLibraryPath']); } - String containingLibraryName; + String? containingLibraryName; if (json.containsKey('containingLibraryName')) { containingLibraryName = jsonDecoder.decodeString( jsonPath + '.containingLibraryName', json['containingLibraryName']); } - String containingClassDescription; + String? containingClassDescription; if (json.containsKey('containingClassDescription')) { containingClassDescription = jsonDecoder.decodeString( jsonPath + '.containingClassDescription', json['containingClassDescription']); } - String dartdoc; + String? dartdoc; if (json.containsKey('dartdoc')) { dartdoc = jsonDecoder.decodeString(jsonPath + '.dartdoc', json['dartdoc']); } - String elementDescription; + String? elementDescription; if (json.containsKey('elementDescription')) { elementDescription = jsonDecoder.decodeString( jsonPath + '.elementDescription', json['elementDescription']); } - String elementKind; + String? elementKind; if (json.containsKey('elementKind')) { elementKind = jsonDecoder.decodeString( jsonPath + '.elementKind', json['elementKind']); } - bool isDeprecated; + bool? isDeprecated; if (json.containsKey('isDeprecated')) { isDeprecated = jsonDecoder.decodeBool( jsonPath + '.isDeprecated', json['isDeprecated']); } - String parameter; + String? parameter; if (json.containsKey('parameter')) { parameter = jsonDecoder.decodeString( jsonPath + '.parameter', json['parameter']); } - String propagatedType; + String? propagatedType; if (json.containsKey('propagatedType')) { propagatedType = jsonDecoder.decodeString( jsonPath + '.propagatedType', json['propagatedType']); } - String staticType; + String? staticType; if (json.containsKey('staticType')) { staticType = jsonDecoder.decodeString( jsonPath + '.staticType', json['staticType']); @@ -15670,37 +12476,47 @@ class HoverInformation implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; + var containingLibraryPath = this.containingLibraryPath; if (containingLibraryPath != null) { result['containingLibraryPath'] = containingLibraryPath; } + var containingLibraryName = this.containingLibraryName; if (containingLibraryName != null) { result['containingLibraryName'] = containingLibraryName; } + var containingClassDescription = this.containingClassDescription; if (containingClassDescription != null) { result['containingClassDescription'] = containingClassDescription; } + var dartdoc = this.dartdoc; if (dartdoc != null) { result['dartdoc'] = dartdoc; } + var elementDescription = this.elementDescription; if (elementDescription != null) { result['elementDescription'] = elementDescription; } + var elementKind = this.elementKind; if (elementKind != null) { result['elementKind'] = elementKind; } + var isDeprecated = this.isDeprecated; if (isDeprecated != null) { result['isDeprecated'] = isDeprecated; } + var parameter = this.parameter; if (parameter != null) { result['parameter'] = parameter; } + var propagatedType = this.propagatedType; if (propagatedType != null) { result['propagatedType'] = propagatedType; } + var staticType = this.staticType; if (staticType != null) { result['staticType'] = staticType; } @@ -15757,35 +12573,16 @@ class HoverInformation implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImplementedClass implements HasToJson { - int _offset; - - int _length; - /// The offset of the name of the implemented class. - int get offset => _offset; - - /// The offset of the name of the implemented class. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name of the implemented class. - int get length => _length; + int length; - /// The length of the name of the implemented class. - set length(int value) { - assert(value != null); - _length = value; - } - - ImplementedClass(int offset, int length) { - this.offset = offset; - this.length = length; - } + ImplementedClass(this.offset, this.length); factory ImplementedClass.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -15807,8 +12604,8 @@ class ImplementedClass implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; return result; @@ -15843,35 +12640,16 @@ class ImplementedClass implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImplementedMember implements HasToJson { - int _offset; - - int _length; - /// The offset of the name of the implemented member. - int get offset => _offset; - - /// The offset of the name of the implemented member. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name of the implemented member. - int get length => _length; + int length; - /// The length of the name of the implemented member. - set length(int value) { - assert(value != null); - _length = value; - } - - ImplementedMember(int offset, int length) { - this.offset = offset; - this.length = length; - } + ImplementedMember(this.offset, this.length); factory ImplementedMember.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -15893,8 +12671,8 @@ class ImplementedMember implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; return result; @@ -15930,47 +12708,19 @@ class ImplementedMember implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImportedElementSet implements HasToJson { - List _strings; - - List _uris; - - List _names; - /// The list of unique strings in this object. - List get strings => _strings; - - /// The list of unique strings in this object. - set strings(List value) { - assert(value != null); - _strings = value; - } + List strings; /// The library URI part of the element. It is an index in the strings field. - List get uris => _uris; - - /// The library URI part of the element. It is an index in the strings field. - set uris(List value) { - assert(value != null); - _uris = value; - } + List uris; /// The name part of a the element. It is an index in the strings field. - List get names => _names; + List names; - /// The name part of a the element. It is an index in the strings field. - set names(List value) { - assert(value != null); - _names = value; - } - - ImportedElementSet(List strings, List uris, List names) { - this.strings = strings; - this.uris = uris; - this.names = names; - } + ImportedElementSet(this.strings, this.uris, this.names); factory ImportedElementSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List strings; @@ -16001,8 +12751,8 @@ class ImportedElementSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['strings'] = strings; result['uris'] = uris; result['names'] = names; @@ -16043,49 +12793,20 @@ class ImportedElementSet implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImportedElements implements HasToJson { - String _path; - - String _prefix; - - List _elements; - /// The absolute and normalized path of the file containing the library. - String get path => _path; - - /// The absolute and normalized path of the file containing the library. - set path(String value) { - assert(value != null); - _path = value; - } + String path; /// The prefix that was used when importing the library into the original /// source. - String get prefix => _prefix; - - /// The prefix that was used when importing the library into the original - /// source. - set prefix(String value) { - assert(value != null); - _prefix = value; - } + String prefix; /// The names of the elements imported from the library. - List get elements => _elements; + List elements; - /// The names of the elements imported from the library. - set elements(List value) { - assert(value != null); - _elements = value; - } - - ImportedElements(String path, String prefix, List elements) { - this.path = path; - this.prefix = prefix; - this.elements = elements; - } + ImportedElements(this.path, this.prefix, this.elements); factory ImportedElements.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String path; @@ -16114,8 +12835,8 @@ class ImportedElements implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['path'] = path; result['prefix'] = prefix; result['elements'] = elements; @@ -16154,39 +12875,18 @@ class ImportedElements implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class IncludedSuggestionRelevanceTag implements HasToJson { - String _tag; - - int _relevanceBoost; - /// The opaque value of the tag. - String get tag => _tag; - - /// The opaque value of the tag. - set tag(String value) { - assert(value != null); - _tag = value; - } + String tag; /// The boost to the relevance of the completion suggestions that match this /// tag, which is added to the relevance of the containing /// IncludedSuggestionSet. - int get relevanceBoost => _relevanceBoost; + int relevanceBoost; - /// The boost to the relevance of the completion suggestions that match this - /// tag, which is added to the relevance of the containing - /// IncludedSuggestionSet. - set relevanceBoost(int value) { - assert(value != null); - _relevanceBoost = value; - } - - IncludedSuggestionRelevanceTag(String tag, int relevanceBoost) { - this.tag = tag; - this.relevanceBoost = relevanceBoost; - } + IncludedSuggestionRelevanceTag(this.tag, this.relevanceBoost); factory IncludedSuggestionRelevanceTag.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String tag; @@ -16210,8 +12910,8 @@ class IncludedSuggestionRelevanceTag implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['tag'] = tag; result['relevanceBoost'] = relevanceBoost; return result; @@ -16247,33 +12947,13 @@ class IncludedSuggestionRelevanceTag implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class IncludedSuggestionSet implements HasToJson { - int _id; - - int _relevance; - - String _displayUri; - /// Clients should use it to access the set of precomputed completions to be /// displayed to the user. - int get id => _id; - - /// Clients should use it to access the set of precomputed completions to be - /// displayed to the user. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The relevance of completion suggestions from this library where a higher /// number indicates a higher relevance. - int get relevance => _relevance; - - /// The relevance of completion suggestions from this library where a higher - /// number indicates a higher relevance. - set relevance(int value) { - assert(value != null); - _relevance = value; - } + int relevance; /// The optional string that should be displayed instead of the uri of the /// referenced AvailableSuggestionSet. @@ -16282,27 +12962,12 @@ class IncludedSuggestionSet implements HasToJson { /// "file://" URIs, so are usually long, and don't look nice, but actual /// import directives will use relative URIs, which are short, so we probably /// want to display such relative URIs to the user. - String get displayUri => _displayUri; + String? displayUri; - /// The optional string that should be displayed instead of the uri of the - /// referenced AvailableSuggestionSet. - /// - /// For example libraries in the "test" directory of a package have only - /// "file://" URIs, so are usually long, and don't look nice, but actual - /// import directives will use relative URIs, which are short, so we probably - /// want to display such relative URIs to the user. - set displayUri(String value) { - _displayUri = value; - } - - IncludedSuggestionSet(int id, int relevance, {String displayUri}) { - this.id = id; - this.relevance = relevance; - this.displayUri = displayUri; - } + IncludedSuggestionSet(this.id, this.relevance, {this.displayUri}); factory IncludedSuggestionSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int id; @@ -16318,7 +12983,7 @@ class IncludedSuggestionSet implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'relevance'); } - String displayUri; + String? displayUri; if (json.containsKey('displayUri')) { displayUri = jsonDecoder.decodeString( jsonPath + '.displayUri', json['displayUri']); @@ -16330,10 +12995,11 @@ class IncludedSuggestionSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['relevance'] = relevance; + var displayUri = this.displayUri; if (displayUri != null) { result['displayUri'] = displayUri; } @@ -16372,35 +13038,16 @@ class IncludedSuggestionSet implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class InlineLocalVariableFeedback extends RefactoringFeedback { - String _name; - - int _occurrences; - /// The name of the variable being inlined. - String get name => _name; - - /// The name of the variable being inlined. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The number of times the variable occurs. - int get occurrences => _occurrences; + int occurrences; - /// The number of times the variable occurs. - set occurrences(int value) { - assert(value != null); - _occurrences = value; - } - - InlineLocalVariableFeedback(String name, int occurrences) { - this.name = name; - this.occurrences = occurrences; - } + InlineLocalVariableFeedback(this.name, this.occurrences); factory InlineLocalVariableFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -16424,8 +13071,8 @@ class InlineLocalVariableFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['occurrences'] = occurrences; return result; @@ -16480,54 +13127,24 @@ class InlineLocalVariableOptions extends RefactoringOptions /// /// Clients may not extend, implement or mix-in this class. class InlineMethodFeedback extends RefactoringFeedback { - String _className; - - String _methodName; - - bool _isDeclaration; - /// The name of the class enclosing the method being inlined. If not a class /// member is being inlined, this field will be absent. - String get className => _className; - - /// The name of the class enclosing the method being inlined. If not a class - /// member is being inlined, this field will be absent. - set className(String value) { - _className = value; - } + String? className; /// The name of the method (or function) being inlined. - String get methodName => _methodName; - - /// The name of the method (or function) being inlined. - set methodName(String value) { - assert(value != null); - _methodName = value; - } + String methodName; /// True if the declaration of the method is selected. So all references /// should be inlined. - bool get isDeclaration => _isDeclaration; + bool isDeclaration; - /// True if the declaration of the method is selected. So all references - /// should be inlined. - set isDeclaration(bool value) { - assert(value != null); - _isDeclaration = value; - } - - InlineMethodFeedback(String methodName, bool isDeclaration, - {String className}) { - this.className = className; - this.methodName = methodName; - this.isDeclaration = isDeclaration; - } + InlineMethodFeedback(this.methodName, this.isDeclaration, {this.className}); factory InlineMethodFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String className; + String? className; if (json.containsKey('className')) { className = jsonDecoder.decodeString( jsonPath + '.className', json['className']); @@ -16554,8 +13171,9 @@ class InlineMethodFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var className = this.className; if (className != null) { result['className'] = className; } @@ -16596,39 +13214,18 @@ class InlineMethodFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class InlineMethodOptions extends RefactoringOptions { - bool _deleteSource; - - bool _inlineAll; - /// True if the method being inlined should be removed. It is an error if /// this field is true and inlineAll is false. - bool get deleteSource => _deleteSource; - - /// True if the method being inlined should be removed. It is an error if - /// this field is true and inlineAll is false. - set deleteSource(bool value) { - assert(value != null); - _deleteSource = value; - } + bool deleteSource; /// True if all invocations of the method should be inlined, or false if only /// the invocation site used to create this refactoring should be inlined. - bool get inlineAll => _inlineAll; + bool inlineAll; - /// True if all invocations of the method should be inlined, or false if only - /// the invocation site used to create this refactoring should be inlined. - set inlineAll(bool value) { - assert(value != null); - _inlineAll = value; - } - - InlineMethodOptions(bool deleteSource, bool inlineAll) { - this.deleteSource = deleteSource; - this.inlineAll = inlineAll; - } + InlineMethodOptions(this.deleteSource, this.inlineAll); factory InlineMethodOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool deleteSource; @@ -16658,8 +13255,8 @@ class InlineMethodOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['deleteSource'] = deleteSource; result['inlineAll'] = inlineAll; return result; @@ -16693,25 +13290,14 @@ class InlineMethodOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class KytheGetKytheEntriesParams implements RequestParams { - String _file; - /// The file containing the code for which the Kythe Entry objects are being /// requested. - String get file => _file; + String file; - /// The file containing the code for which the Kythe Entry objects are being - /// requested. - set file(String value) { - assert(value != null); - _file = value; - } - - KytheGetKytheEntriesParams(String file) { - this.file = file; - } + KytheGetKytheEntriesParams(this.file); factory KytheGetKytheEntriesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -16733,8 +13319,8 @@ class KytheGetKytheEntriesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -16772,41 +13358,19 @@ class KytheGetKytheEntriesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class KytheGetKytheEntriesResult implements ResponseResult { - List _entries; - - List _files; - /// The list of KytheEntry objects for the queried file. - List get entries => _entries; - - /// The list of KytheEntry objects for the queried file. - set entries(List value) { - assert(value != null); - _entries = value; - } + List entries; /// The set of files paths that were required, but not in the file system, to /// give a complete and accurate Kythe graph for the file. This could be due /// to a referenced file that does not exist or generated files not being /// generated or passed before the call to "getKytheEntries". - List get files => _files; + List files; - /// The set of files paths that were required, but not in the file system, to - /// give a complete and accurate Kythe graph for the file. This could be due - /// to a referenced file that does not exist or generated files not being - /// generated or passed before the call to "getKytheEntries". - set files(List value) { - assert(value != null); - _files = value; - } - - KytheGetKytheEntriesResult(List entries, List files) { - this.entries = entries; - this.files = files; - } + KytheGetKytheEntriesResult(this.entries, this.files); factory KytheGetKytheEntriesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List entries; @@ -16814,7 +13378,7 @@ class KytheGetKytheEntriesResult implements ResponseResult { entries = jsonDecoder.decodeList( jsonPath + '.entries', json['entries'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => KytheEntry.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'entries'); @@ -16841,8 +13405,8 @@ class KytheGetKytheEntriesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['entries'] = entries.map((KytheEntry value) => value.toJson()).toList(); result['files'] = files; @@ -16885,41 +13449,19 @@ class KytheGetKytheEntriesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class LibraryPathSet implements HasToJson { - String _scope; - - List _libraryPaths; - /// The filepath for which this request's libraries should be active in /// completion suggestions. This object associates filesystem regions to /// libraries and library directories of interest to the client. - String get scope => _scope; - - /// The filepath for which this request's libraries should be active in - /// completion suggestions. This object associates filesystem regions to - /// libraries and library directories of interest to the client. - set scope(String value) { - assert(value != null); - _scope = value; - } + String scope; /// The paths of the libraries of interest to the client for completion /// suggestions. - List get libraryPaths => _libraryPaths; + List libraryPaths; - /// The paths of the libraries of interest to the client for completion - /// suggestions. - set libraryPaths(List value) { - assert(value != null); - _libraryPaths = value; - } - - LibraryPathSet(String scope, List libraryPaths) { - this.scope = scope; - this.libraryPaths = libraryPaths; - } + LibraryPathSet(this.scope, this.libraryPaths); factory LibraryPathSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String scope; @@ -16942,8 +13484,8 @@ class LibraryPathSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['scope'] = scope; result['libraryPaths'] = libraryPaths; return result; @@ -16997,23 +13539,13 @@ class MoveFileFeedback extends RefactoringFeedback implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class MoveFileOptions extends RefactoringOptions { - String _newFile; - /// The new file path to which the given file is being moved. - String get newFile => _newFile; + String newFile; - /// The new file path to which the given file is being moved. - set newFile(String value) { - assert(value != null); - _newFile = value; - } - - MoveFileOptions(String newFile) { - this.newFile = newFile; - } + MoveFileOptions(this.newFile); factory MoveFileOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String newFile; @@ -17036,8 +13568,8 @@ class MoveFileOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['newFile'] = newFile; return result; } @@ -17070,35 +13602,16 @@ class MoveFileOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class OverriddenMember implements HasToJson { - Element _element; - - String _className; - /// The element that is being overridden. - Element get element => _element; - - /// The element that is being overridden. - set element(Element value) { - assert(value != null); - _element = value; - } + Element element; /// The name of the class in which the member is defined. - String get className => _className; + String className; - /// The name of the class in which the member is defined. - set className(String value) { - assert(value != null); - _className = value; - } - - OverriddenMember(Element element, String className) { - this.element = element; - this.className = className; - } + OverriddenMember(this.element, this.className); factory OverriddenMember.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Element element; @@ -17122,8 +13635,8 @@ class OverriddenMember implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['element'] = element.toJson(); result['className'] = className; return result; @@ -17160,67 +13673,27 @@ class OverriddenMember implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class Override implements HasToJson { - int _offset; - - int _length; - - OverriddenMember _superclassMember; - - List _interfaceMembers; - /// The offset of the name of the overriding member. - int get offset => _offset; - - /// The offset of the name of the overriding member. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name of the overriding member. - int get length => _length; - - /// The length of the name of the overriding member. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The member inherited from a superclass that is overridden by the /// overriding member. The field is omitted if there is no superclass member, /// in which case there must be at least one interface member. - OverriddenMember get superclassMember => _superclassMember; - - /// The member inherited from a superclass that is overridden by the - /// overriding member. The field is omitted if there is no superclass member, - /// in which case there must be at least one interface member. - set superclassMember(OverriddenMember value) { - _superclassMember = value; - } + OverriddenMember? superclassMember; /// The members inherited from interfaces that are overridden by the /// overriding member. The field is omitted if there are no interface /// members, in which case there must be a superclass member. - List get interfaceMembers => _interfaceMembers; + List? interfaceMembers; - /// The members inherited from interfaces that are overridden by the - /// overriding member. The field is omitted if there are no interface - /// members, in which case there must be a superclass member. - set interfaceMembers(List value) { - _interfaceMembers = value; - } - - Override(int offset, int length, - {OverriddenMember superclassMember, - List interfaceMembers}) { - this.offset = offset; - this.length = length; - this.superclassMember = superclassMember; - this.interfaceMembers = interfaceMembers; - } + Override(this.offset, this.length, + {this.superclassMember, this.interfaceMembers}); factory Override.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -17235,17 +13708,17 @@ class Override implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'length'); } - OverriddenMember superclassMember; + OverriddenMember? superclassMember; if (json.containsKey('superclassMember')) { superclassMember = OverriddenMember.fromJson(jsonDecoder, jsonPath + '.superclassMember', json['superclassMember']); } - List interfaceMembers; + List? interfaceMembers; if (json.containsKey('interfaceMembers')) { interfaceMembers = jsonDecoder.decodeList( jsonPath + '.interfaceMembers', json['interfaceMembers'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => OverriddenMember.fromJson(jsonDecoder, jsonPath, json)); } return Override(offset, length, @@ -17257,13 +13730,15 @@ class Override implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; + var superclassMember = this.superclassMember; if (superclassMember != null) { result['superclassMember'] = superclassMember.toJson(); } + var interfaceMembers = this.interfaceMembers; if (interfaceMembers != null) { result['interfaceMembers'] = interfaceMembers .map((OverriddenMember value) => value.toJson()) @@ -17308,49 +13783,20 @@ class Override implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class PostfixTemplateDescriptor implements HasToJson { - String _name; - - String _key; - - String _example; - /// The template name, shown in the UI. - String get name => _name; - - /// The template name, shown in the UI. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The unique template key, not shown in the UI. - String get key => _key; - - /// The unique template key, not shown in the UI. - set key(String value) { - assert(value != null); - _key = value; - } + String key; /// A short example of the transformation performed when the template is /// applied. - String get example => _example; + String example; - /// A short example of the transformation performed when the template is - /// applied. - set example(String value) { - assert(value != null); - _example = value; - } - - PostfixTemplateDescriptor(String name, String key, String example) { - this.name = name; - this.key = key; - this.example = example; - } + PostfixTemplateDescriptor(this.name, this.key, this.example); factory PostfixTemplateDescriptor.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -17379,8 +13825,8 @@ class PostfixTemplateDescriptor implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['key'] = key; result['example'] = example; @@ -17416,25 +13862,14 @@ class PostfixTemplateDescriptor implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class PubStatus implements HasToJson { - bool _isListingPackageDirs; - /// True if the server is currently running pub to produce a list of package /// directories. - bool get isListingPackageDirs => _isListingPackageDirs; + bool isListingPackageDirs; - /// True if the server is currently running pub to produce a list of package - /// directories. - set isListingPackageDirs(bool value) { - assert(value != null); - _isListingPackageDirs = value; - } - - PubStatus(bool isListingPackageDirs) { - this.isListingPackageDirs = isListingPackageDirs; - } + PubStatus(this.isListingPackageDirs); factory PubStatus.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool isListingPackageDirs; @@ -17451,8 +13886,8 @@ class PubStatus implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['isListingPackageDirs'] = isListingPackageDirs; return result; } @@ -17485,15 +13920,15 @@ class PubStatus implements HasToJson { class RefactoringFeedback implements HasToJson { RefactoringFeedback(); - factory RefactoringFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) { + static RefactoringFeedback? fromJson(JsonDecoder jsonDecoder, String jsonPath, + Object? json, Map responseJson) { return refactoringFeedbackFromJson( jsonDecoder, jsonPath, json, responseJson); } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -17524,14 +13959,14 @@ class RefactoringFeedback implements HasToJson { class RefactoringOptions implements HasToJson { RefactoringOptions(); - factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, - Object json, RefactoringKind kind) { + static RefactoringOptions? fromJson(JsonDecoder jsonDecoder, String jsonPath, + Object? json, RefactoringKind kind) { return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -17564,64 +13999,24 @@ class RefactoringOptions implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class RenameFeedback extends RefactoringFeedback { - int _offset; - - int _length; - - String _elementKindName; - - String _oldName; - /// The offset to the beginning of the name selected to be renamed, or -1 if /// the name does not exist yet. - int get offset => _offset; - - /// The offset to the beginning of the name selected to be renamed, or -1 if - /// the name does not exist yet. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name selected to be renamed. - int get length => _length; - - /// The length of the name selected to be renamed. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The human-readable description of the kind of element being renamed (such /// as "class" or "function type alias"). - String get elementKindName => _elementKindName; - - /// The human-readable description of the kind of element being renamed (such - /// as "class" or "function type alias"). - set elementKindName(String value) { - assert(value != null); - _elementKindName = value; - } + String elementKindName; /// The old name of the element before the refactoring. - String get oldName => _oldName; + String oldName; - /// The old name of the element before the refactoring. - set oldName(String value) { - assert(value != null); - _oldName = value; - } - - RenameFeedback( - int offset, int length, String elementKindName, String oldName) { - this.offset = offset; - this.length = length; - this.elementKindName = elementKindName; - this.oldName = oldName; - } + RenameFeedback(this.offset, this.length, this.elementKindName, this.oldName); factory RenameFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -17657,8 +14052,8 @@ class RenameFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['elementKindName'] = elementKindName; @@ -17699,23 +14094,13 @@ class RenameFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class RenameOptions extends RefactoringOptions { - String _newName; - /// The name that the element should have after the refactoring. - String get newName => _newName; + String newName; - /// The name that the element should have after the refactoring. - set newName(String value) { - assert(value != null); - _newName = value; - } - - RenameOptions(String newName) { - this.newName = newName; - } + RenameOptions(this.newName); factory RenameOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String newName; @@ -17738,8 +14123,8 @@ class RenameOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['newName'] = newName; return result; } @@ -17773,48 +14158,20 @@ class RenameOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class RequestError implements HasToJson { - RequestErrorCode _code; - - String _message; - - String _stackTrace; - /// A code that uniquely identifies the error that occurred. - RequestErrorCode get code => _code; - - /// A code that uniquely identifies the error that occurred. - set code(RequestErrorCode value) { - assert(value != null); - _code = value; - } + RequestErrorCode code; /// A short description of the error. - String get message => _message; - - /// A short description of the error. - set message(String value) { - assert(value != null); - _message = value; - } + String message; /// The stack trace associated with processing the request, used for /// debugging the server. - String get stackTrace => _stackTrace; + String? stackTrace; - /// The stack trace associated with processing the request, used for - /// debugging the server. - set stackTrace(String value) { - _stackTrace = value; - } - - RequestError(RequestErrorCode code, String message, {String stackTrace}) { - this.code = code; - this.message = message; - this.stackTrace = stackTrace; - } + RequestError(this.code, this.message, {this.stackTrace}); factory RequestError.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { RequestErrorCode code; @@ -17831,7 +14188,7 @@ class RequestError implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'message'); } - String stackTrace; + String? stackTrace; if (json.containsKey('stackTrace')) { stackTrace = jsonDecoder.decodeString( jsonPath + '.stackTrace', json['stackTrace']); @@ -17843,10 +14200,11 @@ class RequestError implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['code'] = code.toJson(); result['message'] = message; + var stackTrace = this.stackTrace; if (stackTrace != null) { result['stackTrace'] = stackTrace; } @@ -18216,7 +14574,7 @@ class RequestErrorCode implements Enum { } factory RequestErrorCode.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RequestErrorCode(json); @@ -18243,51 +14601,21 @@ class RequestErrorCode implements Enum { /// /// Clients may not extend, implement or mix-in this class. class RuntimeCompletionExpression implements HasToJson { - int _offset; - - int _length; - - RuntimeCompletionExpressionType _type; - /// The offset of the expression in the code for completion. - int get offset => _offset; - - /// The offset of the expression in the code for completion. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the expression in the code for completion. - int get length => _length; - - /// The length of the expression in the code for completion. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// When the expression is sent from the server to the client, the type is /// omitted. The client should fill the type when it sends the request to the /// server again. - RuntimeCompletionExpressionType get type => _type; + RuntimeCompletionExpressionType? type; - /// When the expression is sent from the server to the client, the type is - /// omitted. The client should fill the type when it sends the request to the - /// server again. - set type(RuntimeCompletionExpressionType value) { - _type = value; - } - - RuntimeCompletionExpression(int offset, int length, - {RuntimeCompletionExpressionType type}) { - this.offset = offset; - this.length = length; - this.type = type; - } + RuntimeCompletionExpression(this.offset, this.length, {this.type}); factory RuntimeCompletionExpression.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -18302,7 +14630,7 @@ class RuntimeCompletionExpression implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'length'); } - RuntimeCompletionExpressionType type; + RuntimeCompletionExpressionType? type; if (json.containsKey('type')) { type = RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath + '.type', json['type']); @@ -18314,10 +14642,11 @@ class RuntimeCompletionExpression implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; + var type = this.type; if (type != null) { result['type'] = type.toJson(); } @@ -18361,116 +14690,49 @@ class RuntimeCompletionExpression implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class RuntimeCompletionExpressionType implements HasToJson { - String _libraryPath; - - RuntimeCompletionExpressionTypeKind _kind; - - String _name; - - List _typeArguments; - - RuntimeCompletionExpressionType _returnType; - - List _parameterTypes; - - List _parameterNames; - /// The path of the library that has this type. Omitted if the type is not /// declared in any library, e.g. "dynamic", or "void". - String get libraryPath => _libraryPath; - - /// The path of the library that has this type. Omitted if the type is not - /// declared in any library, e.g. "dynamic", or "void". - set libraryPath(String value) { - _libraryPath = value; - } + String? libraryPath; /// The kind of the type. - RuntimeCompletionExpressionTypeKind get kind => _kind; - - /// The kind of the type. - set kind(RuntimeCompletionExpressionTypeKind value) { - assert(value != null); - _kind = value; - } + RuntimeCompletionExpressionTypeKind kind; /// The name of the type. Omitted if the type does not have a name, e.g. an /// inline function type. - String get name => _name; - - /// The name of the type. Omitted if the type does not have a name, e.g. an - /// inline function type. - set name(String value) { - _name = value; - } + String? name; /// The type arguments of the type. Omitted if the type does not have type /// parameters. - List get typeArguments => _typeArguments; - - /// The type arguments of the type. Omitted if the type does not have type - /// parameters. - set typeArguments(List value) { - _typeArguments = value; - } + List? typeArguments; /// If the type is a function type, the return type of the function. Omitted /// if the type is not a function type. - RuntimeCompletionExpressionType get returnType => _returnType; - - /// If the type is a function type, the return type of the function. Omitted - /// if the type is not a function type. - set returnType(RuntimeCompletionExpressionType value) { - _returnType = value; - } + RuntimeCompletionExpressionType? returnType; /// If the type is a function type, the types of the function parameters of /// all kinds - required, optional positional, and optional named. Omitted if /// the type is not a function type. - List get parameterTypes => _parameterTypes; - - /// If the type is a function type, the types of the function parameters of - /// all kinds - required, optional positional, and optional named. Omitted if - /// the type is not a function type. - set parameterTypes(List value) { - _parameterTypes = value; - } + List? parameterTypes; /// If the type is a function type, the names of the function parameters of /// all kinds - required, optional positional, and optional named. The names /// of positional parameters are empty strings. Omitted if the type is not a /// function type. - List get parameterNames => _parameterNames; + List? parameterNames; - /// If the type is a function type, the names of the function parameters of - /// all kinds - required, optional positional, and optional named. The names - /// of positional parameters are empty strings. Omitted if the type is not a - /// function type. - set parameterNames(List value) { - _parameterNames = value; - } - - RuntimeCompletionExpressionType(RuntimeCompletionExpressionTypeKind kind, - {String libraryPath, - String name, - List typeArguments, - RuntimeCompletionExpressionType returnType, - List parameterTypes, - List parameterNames}) { - this.libraryPath = libraryPath; - this.kind = kind; - this.name = name; - this.typeArguments = typeArguments; - this.returnType = returnType; - this.parameterTypes = parameterTypes; - this.parameterNames = parameterNames; - } + RuntimeCompletionExpressionType(this.kind, + {this.libraryPath, + this.name, + this.typeArguments, + this.returnType, + this.parameterTypes, + this.parameterNames}); factory RuntimeCompletionExpressionType.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String libraryPath; + String? libraryPath; if (json.containsKey('libraryPath')) { libraryPath = jsonDecoder.decodeString( jsonPath + '.libraryPath', json['libraryPath']); @@ -18482,34 +14744,34 @@ class RuntimeCompletionExpressionType implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'kind'); } - String name; + String? name; if (json.containsKey('name')) { name = jsonDecoder.decodeString(jsonPath + '.name', json['name']); } - List typeArguments; + List? typeArguments; if (json.containsKey('typeArguments')) { typeArguments = jsonDecoder.decodeList( jsonPath + '.typeArguments', json['typeArguments'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath, json)); } - RuntimeCompletionExpressionType returnType; + RuntimeCompletionExpressionType? returnType; if (json.containsKey('returnType')) { returnType = RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath + '.returnType', json['returnType']); } - List parameterTypes; + List? parameterTypes; if (json.containsKey('parameterTypes')) { parameterTypes = jsonDecoder.decodeList( jsonPath + '.parameterTypes', json['parameterTypes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath, json)); } - List parameterNames; + List? parameterNames; if (json.containsKey('parameterNames')) { parameterNames = jsonDecoder.decodeList(jsonPath + '.parameterNames', json['parameterNames'], jsonDecoder.decodeString); @@ -18528,28 +14790,34 @@ class RuntimeCompletionExpressionType implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var libraryPath = this.libraryPath; if (libraryPath != null) { result['libraryPath'] = libraryPath; } result['kind'] = kind.toJson(); + var name = this.name; if (name != null) { result['name'] = name; } + var typeArguments = this.typeArguments; if (typeArguments != null) { result['typeArguments'] = typeArguments .map((RuntimeCompletionExpressionType value) => value.toJson()) .toList(); } + var returnType = this.returnType; if (returnType != null) { result['returnType'] = returnType.toJson(); } + var parameterTypes = this.parameterTypes; if (parameterTypes != null) { result['parameterTypes'] = parameterTypes .map((RuntimeCompletionExpressionType value) => value.toJson()) .toList(); } + var parameterNames = this.parameterNames; if (parameterNames != null) { result['parameterNames'] = parameterNames; } @@ -18639,7 +14907,7 @@ class RuntimeCompletionExpressionTypeKind implements Enum { } factory RuntimeCompletionExpressionTypeKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RuntimeCompletionExpressionTypeKind(json); @@ -18666,39 +14934,18 @@ class RuntimeCompletionExpressionTypeKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class RuntimeCompletionVariable implements HasToJson { - String _name; - - RuntimeCompletionExpressionType _type; - /// The name of the variable. The name "this" has a special meaning and is /// used as an implicit target for runtime completion, and in explicit "this" /// references. - String get name => _name; - - /// The name of the variable. The name "this" has a special meaning and is - /// used as an implicit target for runtime completion, and in explicit "this" - /// references. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The type of the variable. - RuntimeCompletionExpressionType get type => _type; + RuntimeCompletionExpressionType type; - /// The type of the variable. - set type(RuntimeCompletionExpressionType value) { - assert(value != null); - _type = value; - } - - RuntimeCompletionVariable(String name, RuntimeCompletionExpressionType type) { - this.name = name; - this.type = type; - } + RuntimeCompletionVariable(this.name, this.type); factory RuntimeCompletionVariable.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -18721,8 +14968,8 @@ class RuntimeCompletionVariable implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['type'] = type.toJson(); return result; @@ -18758,52 +15005,22 @@ class RuntimeCompletionVariable implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class SearchFindElementReferencesParams implements RequestParams { - String _file; - - int _offset; - - bool _includePotential; - /// The file containing the declaration of or reference to the element used /// to define the search. - String get file => _file; - - /// The file containing the declaration of or reference to the element used - /// to define the search. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset within the file of the declaration of or reference to the /// element. - int get offset => _offset; - - /// The offset within the file of the declaration of or reference to the - /// element. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// True if potential matches are to be included in the results. - bool get includePotential => _includePotential; - - /// True if potential matches are to be included in the results. - set includePotential(bool value) { - assert(value != null); - _includePotential = value; - } + bool includePotential; SearchFindElementReferencesParams( - String file, int offset, bool includePotential) { - this.file = file; - this.offset = offset; - this.includePotential = includePotential; - } + this.file, this.offset, this.includePotential); factory SearchFindElementReferencesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -18838,8 +15055,8 @@ class SearchFindElementReferencesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['includePotential'] = includePotential; @@ -18883,52 +15100,29 @@ class SearchFindElementReferencesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindElementReferencesResult implements ResponseResult { - String _id; - - Element _element; - /// The identifier used to associate results with this search request. /// /// If no element was found at the given location, this field will be absent, /// and no results will be reported via the search.results notification. - String get id => _id; - - /// The identifier used to associate results with this search request. - /// - /// If no element was found at the given location, this field will be absent, - /// and no results will be reported via the search.results notification. - set id(String value) { - _id = value; - } + String? id; /// The element referenced or defined at the given offset and whose /// references will be returned in the search results. /// /// If no element was found at the given location, this field will be absent. - Element get element => _element; + Element? element; - /// The element referenced or defined at the given offset and whose - /// references will be returned in the search results. - /// - /// If no element was found at the given location, this field will be absent. - set element(Element value) { - _element = value; - } - - SearchFindElementReferencesResult({String id, Element element}) { - this.id = id; - this.element = element; - } + SearchFindElementReferencesResult({this.id, this.element}); factory SearchFindElementReferencesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String id; + String? id; if (json.containsKey('id')) { id = jsonDecoder.decodeString(jsonPath + '.id', json['id']); } - Element element; + Element? element; if (json.containsKey('element')) { element = Element.fromJson( jsonDecoder, jsonPath + '.element', json['element']); @@ -18948,11 +15142,13 @@ class SearchFindElementReferencesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var id = this.id; if (id != null) { result['id'] = id; } + var element = this.element; if (element != null) { result['element'] = element.toJson(); } @@ -18992,23 +15188,13 @@ class SearchFindElementReferencesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberDeclarationsParams implements RequestParams { - String _name; - /// The name of the declarations to be found. - String get name => _name; + String name; - /// The name of the declarations to be found. - set name(String value) { - assert(value != null); - _name = value; - } - - SearchFindMemberDeclarationsParams(String name) { - this.name = name; - } + SearchFindMemberDeclarationsParams(this.name); factory SearchFindMemberDeclarationsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -19030,8 +15216,8 @@ class SearchFindMemberDeclarationsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; return result; } @@ -19068,23 +15254,13 @@ class SearchFindMemberDeclarationsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberDeclarationsResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this search request. - String get id => _id; + String id; - /// The identifier used to associate results with this search request. - set id(String value) { - assert(value != null); - _id = value; - } - - SearchFindMemberDeclarationsResult(String id) { - this.id = id; - } + SearchFindMemberDeclarationsResult(this.id); factory SearchFindMemberDeclarationsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -19108,8 +15284,8 @@ class SearchFindMemberDeclarationsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -19146,23 +15322,13 @@ class SearchFindMemberDeclarationsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberReferencesParams implements RequestParams { - String _name; - /// The name of the references to be found. - String get name => _name; + String name; - /// The name of the references to be found. - set name(String value) { - assert(value != null); - _name = value; - } - - SearchFindMemberReferencesParams(String name) { - this.name = name; - } + SearchFindMemberReferencesParams(this.name); factory SearchFindMemberReferencesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -19184,8 +15350,8 @@ class SearchFindMemberReferencesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; return result; } @@ -19222,23 +15388,13 @@ class SearchFindMemberReferencesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberReferencesResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this search request. - String get id => _id; + String id; - /// The identifier used to associate results with this search request. - set id(String value) { - assert(value != null); - _id = value; - } - - SearchFindMemberReferencesResult(String id) { - this.id = id; - } + SearchFindMemberReferencesResult(this.id); factory SearchFindMemberReferencesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -19262,8 +15418,8 @@ class SearchFindMemberReferencesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -19300,25 +15456,14 @@ class SearchFindMemberReferencesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchFindTopLevelDeclarationsParams implements RequestParams { - String _pattern; - /// The regular expression used to match the names of the declarations to be /// found. - String get pattern => _pattern; + String pattern; - /// The regular expression used to match the names of the declarations to be - /// found. - set pattern(String value) { - assert(value != null); - _pattern = value; - } - - SearchFindTopLevelDeclarationsParams(String pattern) { - this.pattern = pattern; - } + SearchFindTopLevelDeclarationsParams(this.pattern); factory SearchFindTopLevelDeclarationsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String pattern; @@ -19341,8 +15486,8 @@ class SearchFindTopLevelDeclarationsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['pattern'] = pattern; return result; } @@ -19379,23 +15524,13 @@ class SearchFindTopLevelDeclarationsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindTopLevelDeclarationsResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this search request. - String get id => _id; + String id; - /// The identifier used to associate results with this search request. - set id(String value) { - assert(value != null); - _id = value; - } - - SearchFindTopLevelDeclarationsResult(String id) { - this.id = id; - } + SearchFindTopLevelDeclarationsResult(this.id); factory SearchFindTopLevelDeclarationsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -19419,8 +15554,8 @@ class SearchFindTopLevelDeclarationsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -19459,63 +15594,35 @@ class SearchFindTopLevelDeclarationsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchGetElementDeclarationsParams implements RequestParams { - String _file; - - String _pattern; - - int _maxResults; - /// If this field is provided, return only declarations in this file. If this /// field is missing, return declarations in all files. - String get file => _file; - - /// If this field is provided, return only declarations in this file. If this - /// field is missing, return declarations in all files. - set file(String value) { - _file = value; - } + String? file; /// The regular expression used to match the names of declarations. If this /// field is missing, return all declarations. - String get pattern => _pattern; - - /// The regular expression used to match the names of declarations. If this - /// field is missing, return all declarations. - set pattern(String value) { - _pattern = value; - } + String? pattern; /// The maximum number of declarations to return. If this field is missing, /// return all matching declarations. - int get maxResults => _maxResults; - - /// The maximum number of declarations to return. If this field is missing, - /// return all matching declarations. - set maxResults(int value) { - _maxResults = value; - } + int? maxResults; SearchGetElementDeclarationsParams( - {String file, String pattern, int maxResults}) { - this.file = file; - this.pattern = pattern; - this.maxResults = maxResults; - } + {this.file, this.pattern, this.maxResults}); factory SearchGetElementDeclarationsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String file; + String? file; if (json.containsKey('file')) { file = jsonDecoder.decodeString(jsonPath + '.file', json['file']); } - String pattern; + String? pattern; if (json.containsKey('pattern')) { pattern = jsonDecoder.decodeString(jsonPath + '.pattern', json['pattern']); } - int maxResults; + int? maxResults; if (json.containsKey('maxResults')) { maxResults = jsonDecoder.decodeInt(jsonPath + '.maxResults', json['maxResults']); @@ -19534,14 +15641,17 @@ class SearchGetElementDeclarationsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var file = this.file; if (file != null) { result['file'] = file; } + var pattern = this.pattern; if (pattern != null) { result['pattern'] = pattern; } + var maxResults = this.maxResults; if (maxResults != null) { result['maxResults'] = maxResults; } @@ -19585,36 +15695,16 @@ class SearchGetElementDeclarationsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchGetElementDeclarationsResult implements ResponseResult { - List _declarations; - - List _files; - /// The list of declarations. - List get declarations => _declarations; - - /// The list of declarations. - set declarations(List value) { - assert(value != null); - _declarations = value; - } + List declarations; /// The list of the paths of files with declarations. - List get files => _files; + List files; - /// The list of the paths of files with declarations. - set files(List value) { - assert(value != null); - _files = value; - } - - SearchGetElementDeclarationsResult( - List declarations, List files) { - this.declarations = declarations; - this.files = files; - } + SearchGetElementDeclarationsResult(this.declarations, this.files); factory SearchGetElementDeclarationsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List declarations; @@ -19622,7 +15712,7 @@ class SearchGetElementDeclarationsResult implements ResponseResult { declarations = jsonDecoder.decodeList( jsonPath + '.declarations', json['declarations'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ElementDeclaration.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'declarations'); @@ -19649,8 +15739,8 @@ class SearchGetElementDeclarationsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['declarations'] = declarations.map((ElementDeclaration value) => value.toJson()).toList(); result['files'] = files; @@ -19694,50 +15784,21 @@ class SearchGetElementDeclarationsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchGetTypeHierarchyParams implements RequestParams { - String _file; - - int _offset; - - bool _superOnly; - /// The file containing the declaration or reference to the type for which a /// hierarchy is being requested. - String get file => _file; - - /// The file containing the declaration or reference to the type for which a - /// hierarchy is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the name of the type within the file. - int get offset => _offset; - - /// The offset of the name of the type within the file. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// True if the client is only requesting superclasses and interfaces /// hierarchy. - bool get superOnly => _superOnly; + bool? superOnly; - /// True if the client is only requesting superclasses and interfaces - /// hierarchy. - set superOnly(bool value) { - _superOnly = value; - } - - SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) { - this.file = file; - this.offset = offset; - this.superOnly = superOnly; - } + SearchGetTypeHierarchyParams(this.file, this.offset, {this.superOnly}); factory SearchGetTypeHierarchyParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -19752,7 +15813,7 @@ class SearchGetTypeHierarchyParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'offset'); } - bool superOnly; + bool? superOnly; if (json.containsKey('superOnly')) { superOnly = jsonDecoder.decodeBool(jsonPath + '.superOnly', json['superOnly']); @@ -19770,10 +15831,11 @@ class SearchGetTypeHierarchyParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; + var superOnly = this.superOnly; if (superOnly != null) { result['superOnly'] = superOnly; } @@ -19816,8 +15878,6 @@ class SearchGetTypeHierarchyParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchGetTypeHierarchyResult implements ResponseResult { - List _hierarchyItems; - /// A list of the types in the requested hierarchy. The first element of the /// list is the item representing the type for which the hierarchy was /// requested. The index of other elements of the list is unspecified, but @@ -19827,35 +15887,20 @@ class SearchGetTypeHierarchyResult implements ResponseResult { /// This field will be absent if the code at the given file and offset does /// not represent a type, or if the file has not been sufficiently analyzed /// to allow a type hierarchy to be produced. - List get hierarchyItems => _hierarchyItems; + List? hierarchyItems; - /// A list of the types in the requested hierarchy. The first element of the - /// list is the item representing the type for which the hierarchy was - /// requested. The index of other elements of the list is unspecified, but - /// correspond to the integers used to reference supertype and subtype items - /// within the items. - /// - /// This field will be absent if the code at the given file and offset does - /// not represent a type, or if the file has not been sufficiently analyzed - /// to allow a type hierarchy to be produced. - set hierarchyItems(List value) { - _hierarchyItems = value; - } - - SearchGetTypeHierarchyResult({List hierarchyItems}) { - this.hierarchyItems = hierarchyItems; - } + SearchGetTypeHierarchyResult({this.hierarchyItems}); factory SearchGetTypeHierarchyResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List hierarchyItems; + List? hierarchyItems; if (json.containsKey('hierarchyItems')) { hierarchyItems = jsonDecoder.decodeList( jsonPath + '.hierarchyItems', json['hierarchyItems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json)); } return SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); @@ -19873,8 +15918,9 @@ class SearchGetTypeHierarchyResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var hierarchyItems = this.hierarchyItems; if (hierarchyItems != null) { result['hierarchyItems'] = hierarchyItems .map((TypeHierarchyItem value) => value.toJson()) @@ -19919,70 +15965,27 @@ class SearchGetTypeHierarchyResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchResult implements HasToJson { - Location _location; - - SearchResultKind _kind; - - bool _isPotential; - - List _path; - /// The location of the code that matched the search criteria. - Location get location => _location; - - /// The location of the code that matched the search criteria. - set location(Location value) { - assert(value != null); - _location = value; - } + Location location; /// The kind of element that was found or the kind of reference that was /// found. - SearchResultKind get kind => _kind; - - /// The kind of element that was found or the kind of reference that was - /// found. - set kind(SearchResultKind value) { - assert(value != null); - _kind = value; - } + SearchResultKind kind; /// True if the result is a potential match but cannot be confirmed to be a /// match. For example, if all references to a method m defined in some class /// were requested, and a reference to a method m from an unknown class were /// found, it would be marked as being a potential match. - bool get isPotential => _isPotential; - - /// True if the result is a potential match but cannot be confirmed to be a - /// match. For example, if all references to a method m defined in some class - /// were requested, and a reference to a method m from an unknown class were - /// found, it would be marked as being a potential match. - set isPotential(bool value) { - assert(value != null); - _isPotential = value; - } + bool isPotential; /// The elements that contain the result, starting with the most immediately /// enclosing ancestor and ending with the library. - List get path => _path; + List path; - /// The elements that contain the result, starting with the most immediately - /// enclosing ancestor and ending with the library. - set path(List value) { - assert(value != null); - _path = value; - } - - SearchResult(Location location, SearchResultKind kind, bool isPotential, - List path) { - this.location = location; - this.kind = kind; - this.isPotential = isPotential; - this.path = path; - } + SearchResult(this.location, this.kind, this.isPotential, this.path); factory SearchResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Location location; @@ -20011,7 +16014,7 @@ class SearchResult implements HasToJson { path = jsonDecoder.decodeList( jsonPath + '.path', json['path'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Element.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'path'); @@ -20023,8 +16026,8 @@ class SearchResult implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['location'] = location.toJson(); result['kind'] = kind.toJson(); result['isPotential'] = isPotential; @@ -20130,7 +16133,7 @@ class SearchResultKind implements Enum { } factory SearchResultKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return SearchResultKind(json); @@ -20157,49 +16160,20 @@ class SearchResultKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class SearchResultsParams implements HasToJson { - String _id; - - List _results; - - bool _isLast; - /// The id associated with the search. - String get id => _id; - - /// The id associated with the search. - set id(String value) { - assert(value != null); - _id = value; - } + String id; /// The search results being reported. - List get results => _results; - - /// The search results being reported. - set results(List value) { - assert(value != null); - _results = value; - } + List results; /// True if this is that last set of results that will be returned for the /// indicated search. - bool get isLast => _isLast; + bool isLast; - /// True if this is that last set of results that will be returned for the - /// indicated search. - set isLast(bool value) { - assert(value != null); - _isLast = value; - } - - SearchResultsParams(String id, List results, bool isLast) { - this.id = id; - this.results = results; - this.isLast = isLast; - } + SearchResultsParams(this.id, this.results, this.isLast); factory SearchResultsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -20213,7 +16187,7 @@ class SearchResultsParams implements HasToJson { results = jsonDecoder.decodeList( jsonPath + '.results', json['results'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SearchResult.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'results'); @@ -20236,8 +16210,8 @@ class SearchResultsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['results'] = results.map((SearchResult value) => value.toJson()).toList(); @@ -20282,35 +16256,16 @@ class SearchResultsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ServerConnectedParams implements HasToJson { - String _version; - - int _pid; - /// The version number of the analysis server. - String get version => _version; - - /// The version number of the analysis server. - set version(String value) { - assert(value != null); - _version = value; - } + String version; /// The process id of the analysis server process. - int get pid => _pid; + int pid; - /// The process id of the analysis server process. - set pid(int value) { - assert(value != null); - _pid = value; - } - - ServerConnectedParams(String version, int pid) { - this.version = version; - this.pid = pid; - } + ServerConnectedParams(this.version, this.pid); factory ServerConnectedParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String version; @@ -20338,8 +16293,8 @@ class ServerConnectedParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['version'] = version; result['pid'] = pid; return result; @@ -20379,51 +16334,21 @@ class ServerConnectedParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ServerErrorParams implements HasToJson { - bool _isFatal; - - String _message; - - String _stackTrace; - /// True if the error is a fatal error, meaning that the server will shutdown /// automatically after sending this notification. - bool get isFatal => _isFatal; - - /// True if the error is a fatal error, meaning that the server will shutdown - /// automatically after sending this notification. - set isFatal(bool value) { - assert(value != null); - _isFatal = value; - } + bool isFatal; /// The error message indicating what kind of error was encountered. - String get message => _message; - - /// The error message indicating what kind of error was encountered. - set message(String value) { - assert(value != null); - _message = value; - } + String message; /// The stack trace associated with the generation of the error, used for /// debugging the server. - String get stackTrace => _stackTrace; + String stackTrace; - /// The stack trace associated with the generation of the error, used for - /// debugging the server. - set stackTrace(String value) { - assert(value != null); - _stackTrace = value; - } - - ServerErrorParams(bool isFatal, String message, String stackTrace) { - this.isFatal = isFatal; - this.message = message; - this.stackTrace = stackTrace; - } + ServerErrorParams(this.isFatal, this.message, this.stackTrace); factory ServerErrorParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool isFatal; @@ -20459,8 +16384,8 @@ class ServerErrorParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['isFatal'] = isFatal; result['message'] = message; result['stackTrace'] = stackTrace; @@ -20499,7 +16424,7 @@ class ServerErrorParams implements HasToJson { /// Clients may not extend, implement or mix-in this class. class ServerGetVersionParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -20528,23 +16453,13 @@ class ServerGetVersionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ServerGetVersionResult implements ResponseResult { - String _version; - /// The version number of the analysis server. - String get version => _version; + String version; - /// The version number of the analysis server. - set version(String value) { - assert(value != null); - _version = value; - } - - ServerGetVersionResult(String version) { - this.version = version; - } + ServerGetVersionResult(this.version); factory ServerGetVersionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String version; @@ -20568,8 +16483,8 @@ class ServerGetVersionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['version'] = version; return result; } @@ -20608,53 +16523,22 @@ class ServerGetVersionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ServerLogEntry implements HasToJson { - int _time; - - ServerLogEntryKind _kind; - - String _data; - /// The time (milliseconds since epoch) at which the server created this log /// entry. - int get time => _time; - - /// The time (milliseconds since epoch) at which the server created this log - /// entry. - set time(int value) { - assert(value != null); - _time = value; - } + int time; /// The kind of the entry, used to determine how to interpret the "data" /// field. - ServerLogEntryKind get kind => _kind; - - /// The kind of the entry, used to determine how to interpret the "data" - /// field. - set kind(ServerLogEntryKind value) { - assert(value != null); - _kind = value; - } + ServerLogEntryKind kind; /// The payload of the entry, the actual format is determined by the "kind" /// field. - String get data => _data; + String data; - /// The payload of the entry, the actual format is determined by the "kind" - /// field. - set data(String value) { - assert(value != null); - _data = value; - } - - ServerLogEntry(int time, ServerLogEntryKind kind, String data) { - this.time = time; - this.kind = kind; - this.data = data; - } + ServerLogEntry(this.time, this.kind, this.data); factory ServerLogEntry.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int time; @@ -20683,8 +16567,8 @@ class ServerLogEntry implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['time'] = time; result['kind'] = kind.toJson(); result['data'] = data; @@ -20782,7 +16666,7 @@ class ServerLogEntryKind implements Enum { } factory ServerLogEntryKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ServerLogEntryKind(json); @@ -20807,21 +16691,12 @@ class ServerLogEntryKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ServerLogParams implements HasToJson { - ServerLogEntry _entry; + ServerLogEntry entry; - ServerLogEntry get entry => _entry; - - set entry(ServerLogEntry value) { - assert(value != null); - _entry = value; - } - - ServerLogParams(ServerLogEntry entry) { - this.entry = entry; - } + ServerLogParams(this.entry); factory ServerLogParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ServerLogEntry entry; @@ -20843,8 +16718,8 @@ class ServerLogParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['entry'] = entry.toJson(); return result; } @@ -20904,7 +16779,7 @@ class ServerService implements Enum { } factory ServerService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ServerService(json); @@ -20929,23 +16804,13 @@ class ServerService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ServerSetSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - ServerSetSubscriptionsParams(List subscriptions) { - this.subscriptions = subscriptions; - } + ServerSetSubscriptionsParams(this.subscriptions); factory ServerSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -20953,7 +16818,7 @@ class ServerSetSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ServerService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -20971,8 +16836,8 @@ class ServerSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions.map((ServerService value) => value.toJson()).toList(); return result; @@ -21008,7 +16873,7 @@ class ServerSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ServerSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -21034,7 +16899,7 @@ class ServerSetSubscriptionsResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class ServerShutdownParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -21060,7 +16925,7 @@ class ServerShutdownParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ServerShutdownResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -21090,51 +16955,29 @@ class ServerShutdownResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ServerStatusParams implements HasToJson { - AnalysisStatus _analysis; - - PubStatus _pub; - /// The current status of analysis, including whether analysis is being /// performed and if so what is being analyzed. - AnalysisStatus get analysis => _analysis; - - /// The current status of analysis, including whether analysis is being - /// performed and if so what is being analyzed. - set analysis(AnalysisStatus value) { - _analysis = value; - } + AnalysisStatus? analysis; /// The current status of pub execution, indicating whether we are currently /// running pub. /// /// Note: this status type is deprecated, and is no longer sent by the /// server. - PubStatus get pub => _pub; + PubStatus? pub; - /// The current status of pub execution, indicating whether we are currently - /// running pub. - /// - /// Note: this status type is deprecated, and is no longer sent by the - /// server. - set pub(PubStatus value) { - _pub = value; - } - - ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) { - this.analysis = analysis; - this.pub = pub; - } + ServerStatusParams({this.analysis, this.pub}); factory ServerStatusParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - AnalysisStatus analysis; + AnalysisStatus? analysis; if (json.containsKey('analysis')) { analysis = AnalysisStatus.fromJson( jsonDecoder, jsonPath + '.analysis', json['analysis']); } - PubStatus pub; + PubStatus? pub; if (json.containsKey('pub')) { pub = PubStatus.fromJson(jsonDecoder, jsonPath + '.pub', json['pub']); } @@ -21150,11 +16993,13 @@ class ServerStatusParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var analysis = this.analysis; if (analysis != null) { result['analysis'] = analysis.toJson(); } + var pub = this.pub; if (pub != null) { result['pub'] = pub.toJson(); } @@ -21199,134 +17044,52 @@ class ServerStatusParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class TypeHierarchyItem implements HasToJson { - Element _classElement; - - String _displayName; - - Element _memberElement; - - int _superclass; - - List _interfaces; - - List _mixins; - - List _subclasses; - /// The class element represented by this item. - Element get classElement => _classElement; - - /// The class element represented by this item. - set classElement(Element value) { - assert(value != null); - _classElement = value; - } + Element classElement; /// The name to be displayed for the class. This field will be omitted if the /// display name is the same as the name of the element. The display name is /// different if there is additional type information to be displayed, such /// as type arguments. - String get displayName => _displayName; - - /// The name to be displayed for the class. This field will be omitted if the - /// display name is the same as the name of the element. The display name is - /// different if there is additional type information to be displayed, such - /// as type arguments. - set displayName(String value) { - _displayName = value; - } + String? displayName; /// The member in the class corresponding to the member on which the /// hierarchy was requested. This field will be omitted if the hierarchy was /// not requested for a member or if the class does not have a corresponding /// member. - Element get memberElement => _memberElement; - - /// The member in the class corresponding to the member on which the - /// hierarchy was requested. This field will be omitted if the hierarchy was - /// not requested for a member or if the class does not have a corresponding - /// member. - set memberElement(Element value) { - _memberElement = value; - } + Element? memberElement; /// The index of the item representing the superclass of this class. This /// field will be omitted if this item represents the class Object. - int get superclass => _superclass; - - /// The index of the item representing the superclass of this class. This - /// field will be omitted if this item represents the class Object. - set superclass(int value) { - _superclass = value; - } + int? superclass; /// The indexes of the items representing the interfaces implemented by this /// class. The list will be empty if there are no implemented interfaces. - List get interfaces => _interfaces; - - /// The indexes of the items representing the interfaces implemented by this - /// class. The list will be empty if there are no implemented interfaces. - set interfaces(List value) { - assert(value != null); - _interfaces = value; - } + List interfaces; /// The indexes of the items representing the mixins referenced by this /// class. The list will be empty if there are no classes mixed in to this /// class. - List get mixins => _mixins; - - /// The indexes of the items representing the mixins referenced by this - /// class. The list will be empty if there are no classes mixed in to this - /// class. - set mixins(List value) { - assert(value != null); - _mixins = value; - } + List mixins; /// The indexes of the items representing the subtypes of this class. The /// list will be empty if there are no subtypes or if this item represents a /// supertype of the pivot type. - List get subclasses => _subclasses; + List subclasses; - /// The indexes of the items representing the subtypes of this class. The - /// list will be empty if there are no subtypes or if this item represents a - /// supertype of the pivot type. - set subclasses(List value) { - assert(value != null); - _subclasses = value; - } - - TypeHierarchyItem(Element classElement, - {String displayName, - Element memberElement, - int superclass, - List interfaces, - List mixins, - List subclasses}) { - this.classElement = classElement; - this.displayName = displayName; - this.memberElement = memberElement; - this.superclass = superclass; - if (interfaces == null) { - this.interfaces = []; - } else { - this.interfaces = interfaces; - } - if (mixins == null) { - this.mixins = []; - } else { - this.mixins = mixins; - } - if (subclasses == null) { - this.subclasses = []; - } else { - this.subclasses = subclasses; - } - } + TypeHierarchyItem(this.classElement, + {this.displayName, + this.memberElement, + this.superclass, + List? interfaces, + List? mixins, + List? subclasses}) + : interfaces = interfaces ?? [], + mixins = mixins ?? [], + subclasses = subclasses ?? []; factory TypeHierarchyItem.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Element classElement; @@ -21336,17 +17099,17 @@ class TypeHierarchyItem implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'classElement'); } - String displayName; + String? displayName; if (json.containsKey('displayName')) { displayName = jsonDecoder.decodeString( jsonPath + '.displayName', json['displayName']); } - Element memberElement; + Element? memberElement; if (json.containsKey('memberElement')) { memberElement = Element.fromJson( jsonDecoder, jsonPath + '.memberElement', json['memberElement']); } - int superclass; + int? superclass; if (json.containsKey('superclass')) { superclass = jsonDecoder.decodeInt(jsonPath + '.superclass', json['superclass']); @@ -21385,15 +17148,18 @@ class TypeHierarchyItem implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['classElement'] = classElement.toJson(); + var displayName = this.displayName; if (displayName != null) { result['displayName'] = displayName; } + var memberElement = this.memberElement; if (memberElement != null) { result['memberElement'] = memberElement.toJson(); } + var superclass = this.superclass; if (superclass != null) { result['superclass'] = superclass; } diff --git a/pkg/analysis_server/lib/src/protocol/protocol_internal.dart b/pkg/analysis_server/lib/src/protocol/protocol_internal.dart index 1b4f60eb78b..e84109e9447 100644 --- a/pkg/analysis_server/lib/src/protocol/protocol_internal.dart +++ b/pkg/analysis_server/lib/src/protocol/protocol_internal.dart @@ -2,8 +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. -// @dart = 2.9 - import 'dart:collection'; import 'dart:convert' hide JsonDecoder; @@ -31,8 +29,8 @@ String applySequenceOfEdits(String code, Iterable edits) { /// Compare the lists [listA] and [listB], using [itemEqual] to compare /// list elements. -bool listEqual( - List listA, List listB, bool Function(T1 a, T2 b) itemEqual) { +bool listEqual( + List? listA, List? listB, bool Function(T a, T b) itemEqual) { if (listA == null) { return listB == null; } @@ -53,7 +51,7 @@ bool listEqual( /// Compare the maps [mapA] and [mapB], using [valueEqual] to compare map /// values. bool mapEqual( - Map mapA, Map mapB, bool Function(V a, V b) valueEqual) { + Map? mapA, Map? mapB, bool Function(V a, V b) valueEqual) { if (mapA == null) { return mapB == null; } @@ -63,11 +61,11 @@ bool mapEqual( if (mapA.length != mapB.length) { return false; } - for (var key in mapA.keys) { - if (!mapB.containsKey(key)) { - return false; - } - if (!valueEqual(mapA[key], mapB[key])) { + for (var entryA in mapA.entries) { + var key = entryA.key; + var valueA = entryA.value; + var valueB = mapB[key]; + if (valueB == null || !valueEqual(valueA, valueB)) { return false; } } @@ -77,7 +75,7 @@ bool mapEqual( /// Translate the input [map], applying [keyCallback] to all its keys, and /// [valueCallback] to all its values. Map mapMap(Map map, - {KR Function(KP key) keyCallback, VR Function(VP value) valueCallback}) { + {KR Function(KP key)? keyCallback, VR Function(VP value)? valueCallback}) { Map result = HashMap(); map.forEach((key, value) { KR resultKey; @@ -98,8 +96,8 @@ Map mapMap(Map map, } /// Create a [RefactoringFeedback] corresponding the given [kind]. -RefactoringFeedback refactoringFeedbackFromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json, Map feedbackJson) { +RefactoringFeedback? refactoringFeedbackFromJson( + JsonDecoder jsonDecoder, String jsonPath, Object? json, Map feedbackJson) { var kind = jsonDecoder.refactoringKind; if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) { return ExtractLocalVariableFeedback.fromJson(jsonDecoder, jsonPath, json); @@ -123,8 +121,8 @@ RefactoringFeedback refactoringFeedbackFromJson( } /// Create a [RefactoringOptions] corresponding the given [kind]. -RefactoringOptions refactoringOptionsFromJson(JsonDecoder jsonDecoder, - String jsonPath, Object json, RefactoringKind kind) { +RefactoringOptions? refactoringOptionsFromJson(JsonDecoder jsonDecoder, + String jsonPath, Object? json, RefactoringKind kind) { if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) { return ExtractLocalVariableOptions.fromJson(jsonDecoder, jsonPath, json); } @@ -162,13 +160,13 @@ class RequestDecoder extends JsonDecoder { RequestDecoder(this._request); @override - RefactoringKind get refactoringKind { + RefactoringKind? get refactoringKind { // Refactoring feedback objects should never appear in requests. return null; } @override - dynamic mismatch(String jsonPath, String expected, [Object actual]) { + Object mismatch(String jsonPath, String expected, [Object? actual]) { var buffer = StringBuffer(); buffer.write('Expected to be '); buffer.write(expected); @@ -182,7 +180,7 @@ class RequestDecoder extends JsonDecoder { } @override - dynamic missingKey(String jsonPath, String key) { + Object missingKey(String jsonPath, String key) { return RequestFailure(Response.invalidParameter( _request, jsonPath, 'Expected to contain key ${json.encode(key)}')); } @@ -198,12 +196,12 @@ abstract class RequestParams implements HasToJson { /// used only for testing. Errors are reported using bare [Exception] objects. class ResponseDecoder extends JsonDecoder { @override - final RefactoringKind refactoringKind; + final RefactoringKind? refactoringKind; ResponseDecoder(this.refactoringKind); @override - dynamic mismatch(String jsonPath, String expected, [Object actual]) { + Object mismatch(String jsonPath, String expected, [Object? actual]) { var buffer = StringBuffer(); buffer.write('Expected '); buffer.write(expected); @@ -218,7 +216,7 @@ class ResponseDecoder extends JsonDecoder { } @override - dynamic missingKey(String jsonPath, String key) { + Object missingKey(String jsonPath, String key) { return Exception('Missing key $key at $jsonPath'); } } diff --git a/pkg/analysis_server/test/constants.dart b/pkg/analysis_server/test/constants.dart index 274bdb57686..8c6d8488d6e 100644 --- a/pkg/analysis_server/test/constants.dart +++ b/pkg/analysis_server/test/constants.dart @@ -2,8 +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. -// @dart = 2.9 - const String CODE = 'code'; const String COMPLETION_RESULTS = 'completion.results'; const String CONTEXT_MESSAGES = 'contextMessages'; diff --git a/pkg/analysis_server/test/integration/support/integration_test_methods.dart b/pkg/analysis_server/test/integration/support/integration_test_methods.dart index 5a1688c24cb..4437c04d5b0 100644 --- a/pkg/analysis_server/test/integration/support/integration_test_methods.dart +++ b/pkg/analysis_server/test/integration/support/integration_test_methods.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - /// Convenience methods for running integration tests. import 'dart:async'; @@ -81,10 +79,10 @@ abstract class IntegrationTestMixin { /// pid: int /// /// The process id of the analysis server process. - Stream onServerConnected; + late Stream onServerConnected; /// Stream controller for [onServerConnected]. - StreamController _onServerConnected; + late StreamController _onServerConnected; /// Reports that an unexpected error has occurred while executing the server. /// This notification is not used for problems with specific requests (which @@ -109,20 +107,20 @@ abstract class IntegrationTestMixin { /// /// The stack trace associated with the generation of the error, used for /// debugging the server. - Stream onServerError; + late Stream onServerError; /// Stream controller for [onServerError]. - StreamController _onServerError; + late StreamController _onServerError; /// The stream of entries describing events happened in the server. /// /// Parameters /// /// entry: ServerLogEntry - Stream onServerLog; + late Stream onServerLog; /// Stream controller for [onServerLog]. - StreamController _onServerLog; + late StreamController _onServerLog; /// Reports the current status of the server. Parameters are omitted if there /// has been no change in the status represented by that parameter. @@ -145,10 +143,10 @@ abstract class IntegrationTestMixin { /// /// Note: this status type is deprecated, and is no longer sent by the /// server. - Stream onServerStatus; + late Stream onServerStatus; /// Stream controller for [onServerStatus]. - StreamController _onServerStatus; + late StreamController _onServerStatus; /// Return the errors associated with the given file. If the errors for the /// given file have not yet been computed, or the most recently computed @@ -492,7 +490,7 @@ abstract class IntegrationTestMixin { /// that the normal pubspec.yaml mechanism should always be used. Future sendAnalysisSetAnalysisRoots( List included, List excluded, - {Map packageRoots}) async { + {Map? packageRoots}) async { var params = AnalysisSetAnalysisRootsParams(included, excluded, packageRoots: packageRoots) .toJson(); @@ -646,10 +644,10 @@ abstract class IntegrationTestMixin { /// directories: List /// /// A list of the paths of the files that are being analyzed. - Stream onAnalysisAnalyzedFiles; + late Stream onAnalysisAnalyzedFiles; /// Stream controller for [onAnalysisAnalyzedFiles]. - StreamController _onAnalysisAnalyzedFiles; + late StreamController _onAnalysisAnalyzedFiles; /// Reports closing labels relevant to a given file. /// @@ -672,10 +670,10 @@ abstract class IntegrationTestMixin { /// constructor/method calls and List arguments that span multiple lines. /// Note that the ranges that are returned can overlap each other because /// they may be associated with constructs that can be nested. - Stream onAnalysisClosingLabels; + late Stream onAnalysisClosingLabels; /// Stream controller for [onAnalysisClosingLabels]. - StreamController _onAnalysisClosingLabels; + late StreamController _onAnalysisClosingLabels; /// Reports the errors associated with a given file. The set of errors /// included in the notification is always a complete list that supersedes @@ -690,10 +688,10 @@ abstract class IntegrationTestMixin { /// errors: List /// /// The errors contained in the file. - Stream onAnalysisErrors; + late Stream onAnalysisErrors; /// Stream controller for [onAnalysisErrors]. - StreamController _onAnalysisErrors; + late StreamController _onAnalysisErrors; /// Reports that any analysis results that were previously associated with /// the given files should be considered to be invalid because those files @@ -713,10 +711,10 @@ abstract class IntegrationTestMixin { /// files: List /// /// The files that are no longer being analyzed. - Stream onAnalysisFlushResults; + late Stream onAnalysisFlushResults; /// Stream controller for [onAnalysisFlushResults]. - StreamController _onAnalysisFlushResults; + late StreamController _onAnalysisFlushResults; /// Reports the folding regions associated with a given file. Folding regions /// can be nested, but will not be overlapping. Nesting occurs when a @@ -736,10 +734,10 @@ abstract class IntegrationTestMixin { /// regions: List /// /// The folding regions contained in the file. - Stream onAnalysisFolding; + late Stream onAnalysisFolding; /// Stream controller for [onAnalysisFolding]. - StreamController _onAnalysisFolding; + late StreamController _onAnalysisFolding; /// Reports the highlight regions associated with a given file. /// @@ -760,10 +758,10 @@ abstract class IntegrationTestMixin { /// some range. Note that the highlight regions that are returned can /// overlap other highlight regions if there is more than one meaning /// associated with a particular region. - Stream onAnalysisHighlights; + late Stream onAnalysisHighlights; /// Stream controller for [onAnalysisHighlights]. - StreamController _onAnalysisHighlights; + late StreamController _onAnalysisHighlights; /// Reports the classes that are implemented or extended and class members /// that are implemented or overridden in a file. @@ -785,10 +783,10 @@ abstract class IntegrationTestMixin { /// members: List /// /// The member defined in the file that are implemented or overridden. - Stream onAnalysisImplemented; + late Stream onAnalysisImplemented; /// Stream controller for [onAnalysisImplemented]. - StreamController _onAnalysisImplemented; + late StreamController _onAnalysisImplemented; /// Reports that the navigation information associated with a region of a /// single file has become invalid and should be re-requested. @@ -816,10 +814,10 @@ abstract class IntegrationTestMixin { /// The delta to be applied to the offsets in information that follows the /// invalidated region in order to update it so that it doesn't need to be /// re-requested. - Stream onAnalysisInvalidate; + late Stream onAnalysisInvalidate; /// Stream controller for [onAnalysisInvalidate]. - StreamController _onAnalysisInvalidate; + late StreamController _onAnalysisInvalidate; /// Reports the navigation targets associated with a given file. /// @@ -852,10 +850,10 @@ abstract class IntegrationTestMixin { /// /// The files containing navigation targets referenced in the file. They /// are referenced by NavigationTargets by their index in this array. - Stream onAnalysisNavigation; + late Stream onAnalysisNavigation; /// Stream controller for [onAnalysisNavigation]. - StreamController _onAnalysisNavigation; + late StreamController _onAnalysisNavigation; /// Reports the occurrences of references to elements within a single file. /// @@ -872,10 +870,10 @@ abstract class IntegrationTestMixin { /// occurrences: List /// /// The occurrences of references to elements within the file. - Stream onAnalysisOccurrences; + late Stream onAnalysisOccurrences; /// Stream controller for [onAnalysisOccurrences]. - StreamController _onAnalysisOccurrences; + late StreamController _onAnalysisOccurrences; /// Reports the outline associated with a single file. /// @@ -904,10 +902,10 @@ abstract class IntegrationTestMixin { /// outline: Outline /// /// The outline associated with the file. - Stream onAnalysisOutline; + late Stream onAnalysisOutline; /// Stream controller for [onAnalysisOutline]. - StreamController _onAnalysisOutline; + late StreamController _onAnalysisOutline; /// Reports the overriding members in a file. /// @@ -924,10 +922,10 @@ abstract class IntegrationTestMixin { /// overrides: List /// /// The overrides associated with the file. - Stream onAnalysisOverrides; + late Stream onAnalysisOverrides; /// Stream controller for [onAnalysisOverrides]. - StreamController _onAnalysisOverrides; + late StreamController _onAnalysisOverrides; /// Request that completion suggestions for the given offset in the given /// file be returned. @@ -1117,10 +1115,10 @@ abstract class IntegrationTestMixin { /// /// If an AvailableSuggestion has relevance tags that match more than one /// IncludedSuggestionRelevanceTag, the maximum relevance boost is used. - Stream onCompletionResults; + late Stream onCompletionResults; /// Stream controller for [onCompletionResults]. - StreamController _onCompletionResults; + late StreamController _onCompletionResults; /// Reports the pre-computed, candidate completions from symbols defined in a /// corresponding library. This notification may be sent multiple times. When @@ -1140,10 +1138,11 @@ abstract class IntegrationTestMixin { /// removedLibraries: List (optional) /// /// A list of library ids that no longer apply. - Stream onCompletionAvailableSuggestions; + late Stream + onCompletionAvailableSuggestions; /// Stream controller for [onCompletionAvailableSuggestions]. - StreamController + late StreamController _onCompletionAvailableSuggestions; /// Reports existing imports in a library. This notification may be sent @@ -1159,10 +1158,10 @@ abstract class IntegrationTestMixin { /// imports: ExistingImports /// /// The existing imports in the library. - Stream onCompletionExistingImports; + late Stream onCompletionExistingImports; /// Stream controller for [onCompletionExistingImports]. - StreamController + late StreamController _onCompletionExistingImports; /// Perform a search for references to the element defined or referenced at @@ -1325,7 +1324,7 @@ abstract class IntegrationTestMixin { /// /// The list of the paths of files with declarations. Future sendSearchGetElementDeclarations( - {String file, String pattern, int maxResults}) async { + {String? file, String? pattern, int? maxResults}) async { var params = SearchGetElementDeclarationsParams( file: file, pattern: pattern, maxResults: maxResults) .toJson(); @@ -1369,7 +1368,7 @@ abstract class IntegrationTestMixin { /// to allow a type hierarchy to be produced. Future sendSearchGetTypeHierarchy( String file, int offset, - {bool superOnly}) async { + {bool? superOnly}) async { var params = SearchGetTypeHierarchyParams(file, offset, superOnly: superOnly) .toJson(); @@ -1397,10 +1396,10 @@ abstract class IntegrationTestMixin { /// /// True if this is that last set of results that will be returned for the /// indicated search. - Stream onSearchResults; + late Stream onSearchResults; /// Stream controller for [onSearchResults]. - StreamController _onSearchResults; + late StreamController _onSearchResults; /// Format the contents of a single file. The currently selected region of /// text is passed in so that the selection can be preserved across the @@ -1450,7 +1449,7 @@ abstract class IntegrationTestMixin { /// The length of the selection after formatting the code. Future sendEditFormat( String file, int selectionOffset, int selectionLength, - {int lineLength}) async { + {int? lineLength}) async { var params = EditFormatParams(file, selectionOffset, selectionLength, lineLength: lineLength) .toJson(); @@ -1580,7 +1579,7 @@ abstract class IntegrationTestMixin { /// Details that summarize the fixes associated with the recommended /// changes. Future sendEditBulkFixes(List included, - {bool inTestMode}) async { + {bool? inTestMode}) async { var params = EditBulkFixesParams(included, inTestMode: inTestMode).toJson(); var result = await server.send('edit.bulkFixes', params); var decoder = ResponseDecoder(null); @@ -1681,11 +1680,11 @@ abstract class IntegrationTestMixin { /// proposed changes. There is one URL for each of the included file paths. /// The field is omitted if a preview was not requested. Future sendEditDartfix(List included, - {List includedFixes, - bool includePedanticFixes, - List excludedFixes, - int port, - String outputDir}) async { + {List? includedFixes, + bool? includePedanticFixes, + List? excludedFixes, + int? port, + String? outputDir}) async { var params = EditDartfixParams(included, includedFixes: includedFixes, includePedanticFixes: includePedanticFixes, @@ -1841,7 +1840,7 @@ abstract class IntegrationTestMixin { /// the refactoring. Future sendEditGetRefactoring(RefactoringKind kind, String file, int offset, int length, bool validateOnly, - {RefactoringOptions options}) async { + {RefactoringOptions? options}) async { var params = EditGetRefactoringParams( kind, file, offset, length, validateOnly, options: options) @@ -1975,7 +1974,7 @@ abstract class IntegrationTestMixin { /// that need to be applied. Future sendEditImportElements( String file, List elements, - {int offset}) async { + {int? offset}) async { var params = EditImportElementsParams(file, elements, offset: offset).toJson(); var result = await server.send('edit.importElements', params); @@ -2164,7 +2163,7 @@ abstract class IntegrationTestMixin { String contextFile, int contextOffset, List variables, - {List expressions}) async { + {List? expressions}) async { var params = ExecutionGetSuggestionsParams( code, offset, contextFile, contextOffset, variables, expressions: expressions) @@ -2221,7 +2220,7 @@ abstract class IntegrationTestMixin { /// The URI to which the file path was mapped. This field is omitted if the /// file field was not given in the request. Future sendExecutionMapUri(String id, - {String file, String uri}) async { + {String? file, String? uri}) async { var params = ExecutionMapUriParams(id, file: file, uri: uri).toJson(); var result = await server.send('execution.mapUri', params); var decoder = ResponseDecoder(null); @@ -2273,10 +2272,10 @@ abstract class IntegrationTestMixin { /// /// A list of the Dart files that are referenced by the file. This field is /// omitted if the file is not an HTML file. - Stream onExecutionLaunchData; + late Stream onExecutionLaunchData; /// Stream controller for [onExecutionLaunchData]. - StreamController _onExecutionLaunchData; + late StreamController _onExecutionLaunchData; /// Return server diagnostics. /// @@ -2512,7 +2511,7 @@ abstract class IntegrationTestMixin { /// The change that should be applied. Future sendFlutterSetWidgetPropertyValue( int id, - {FlutterWidgetPropertyValue value}) async { + {FlutterWidgetPropertyValue? value}) async { var params = FlutterSetWidgetPropertyValueParams(id, value: value).toJson(); var result = await server.send('flutter.setWidgetPropertyValue', params); var decoder = ResponseDecoder(null); @@ -2573,10 +2572,10 @@ abstract class IntegrationTestMixin { /// outline: FlutterOutline /// /// The outline associated with the file. - Stream onFlutterOutline; + late Stream onFlutterOutline; /// Stream controller for [onFlutterOutline]. - StreamController _onFlutterOutline; + late StreamController _onFlutterOutline; /// Initialize the fields in InttestMixin, and ensure that notifications will /// be handled. @@ -2762,7 +2761,6 @@ abstract class IntegrationTestMixin { break; default: fail('Unexpected notification: $event'); - break; } } } diff --git a/pkg/analysis_server/test/integration/support/integration_tests.dart b/pkg/analysis_server/test/integration/support/integration_tests.dart index fa6d958f56a..3f768be492b 100644 --- a/pkg/analysis_server/test/integration/support/integration_tests.dart +++ b/pkg/analysis_server/test/integration/support/integration_tests.dart @@ -2,8 +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. -// @dart = 2.9 - import 'dart:async'; import 'dart:collection'; import 'dart:convert'; @@ -42,7 +40,7 @@ Matcher isOneOf(List choiceMatchers) => _OneOf(choiceMatchers); /// Assert that [actual] matches [matcher]. void outOfTestExpect(actual, Matcher matcher, - {String reason, skip, bool verbose = false}) { + {String? reason, skip, bool verbose = false}) { var matchState = {}; try { if (matcher.matches(actual, matchState)) return; @@ -53,7 +51,7 @@ void outOfTestExpect(actual, Matcher matcher, } String _defaultFailFormatter( - actual, Matcher matcher, String reason, Map matchState, bool verbose) { + actual, Matcher matcher, String? reason, Map matchState, bool verbose) { var description = StringDescription(); description.add('Expected: ').addDescriptionOf(matcher).add('\n'); description.add(' Actual: ').addDescriptionOf(actual).add('\n'); @@ -90,7 +88,7 @@ abstract class AbstractAnalysisServerIntegrationTest final Server server = Server(); /// Temporary directory in which source files can be stored. - Directory sourceDirectory; + late Directory sourceDirectory; /// Map from file path to the list of analysis errors which have most recently /// been received for the file. @@ -98,7 +96,7 @@ abstract class AbstractAnalysisServerIntegrationTest HashMap>(); /// The last list of analyzed files received. - List lastAnalyzedFiles; + late List lastAnalyzedFiles; /// True if the teardown process should skip sending a "server.shutdown" /// request (e.g. because the server is known to have already shutdown). @@ -121,12 +119,13 @@ abstract class AbstractAnalysisServerIntegrationTest /// analysis to finish. Future get analysisFinished { var completer = Completer(); - StreamSubscription subscription; + late StreamSubscription subscription; // This will only work if the caller has already subscribed to // SERVER_STATUS (e.g. using sendServerSetSubscriptions(['STATUS'])) outOfTestExpect(_subscribedToServerStatus, isTrue); subscription = onServerStatus.listen((ServerStatusParams params) { - if (params.analysis != null && !params.analysis.isAnalyzing) { + var analysisStatus = params.analysis; + if (analysisStatus != null && !analysisStatus.isAnalyzing) { completer.complete(params); subscription.cancel(); } @@ -140,7 +139,7 @@ abstract class AbstractAnalysisServerIntegrationTest server.debugStdio(); } - List getErrors(String pathname) => + List? getErrors(String pathname) => currentAnalysisErrors[pathname]; /// Read a source file with the given absolute [pathname]. @@ -219,8 +218,8 @@ abstract class AbstractAnalysisServerIntegrationTest /// Start [server]. Future startServer({ - int diagnosticPort, - int servicesPort, + int? diagnosticPort, + int? servicesPort, }) { return server.start( diagnosticPort: diagnosticPort, servicesPort: servicesPort); @@ -259,33 +258,30 @@ class LazyMatcher implements Matcher { /// The matcher returned by [_creator], if it has already been called. /// Otherwise null. - Matcher _wrappedMatcher; + Matcher? _wrappedMatcher; LazyMatcher(this._creator); + /// Create the wrapped matcher object, if it hasn't been created already. + Matcher get _matcher { + return _wrappedMatcher ??= _creator(); + } + @override Description describe(Description description) { - _createMatcher(); - return _wrappedMatcher.describe(description); + return _matcher.describe(description); } @override Description describeMismatch( item, Description mismatchDescription, Map matchState, bool verbose) { - _createMatcher(); - return _wrappedMatcher.describeMismatch( + return _matcher.describeMismatch( item, mismatchDescription, matchState, verbose); } @override bool matches(item, Map matchState) { - _createMatcher(); - return _wrappedMatcher.matches(item, matchState); - } - - /// Create the wrapped matcher object, if it hasn't been created already. - void _createMatcher() { - _wrappedMatcher ??= _creator(); + return _matcher.matches(item, matchState); } } @@ -317,11 +313,11 @@ class MatchesJsonObject extends _RecursiveMatcher { /// Fields that are required to be in the JSON object, and [Matcher]s /// describing their expected types. - final Map requiredFields; + final Map? requiredFields; /// Fields that are optional in the JSON object, and [Matcher]s describing /// their expected types. - final Map optionalFields; + final Map? optionalFields; const MatchesJsonObject(this.description, this.requiredFields, {this.optionalFields}); @@ -336,9 +332,11 @@ class MatchesJsonObject extends _RecursiveMatcher { mismatches.add(simpleDescription('is not a map')); return; } + var requiredFields = this.requiredFields; + var optionalFields = this.optionalFields; if (requiredFields != null) { requiredFields.forEach((String key, Matcher valueMatcher) { - if (!(item as Map).containsKey(key)) { + if (!item.containsKey(key)) { mismatches.add((Description mismatchDescription) => mismatchDescription .add('is missing field ') @@ -354,13 +352,18 @@ class MatchesJsonObject extends _RecursiveMatcher { item.forEach((key, value) { if (requiredFields != null && requiredFields.containsKey(key)) { // Already checked this field - } else if (optionalFields != null && optionalFields.containsKey(key)) { - _checkField(key, value, optionalFields[key], mismatches); - } else { - mismatches.add((Description mismatchDescription) => mismatchDescription - .add('has unexpected field ') - .addDescriptionOf(key)); + return; } + if (optionalFields != null) { + var optionalValue = optionalFields[key]; + if (optionalValue != null) { + _checkField(key, value, optionalValue, mismatches); + return; + } + } + mismatches.add((Description mismatchDescription) => mismatchDescription + .add('has unexpected field ') + .addDescriptionOf(key)); }); } @@ -382,7 +385,7 @@ class MatchesJsonObject extends _RecursiveMatcher { /// facilitate communication to and from the server. class Server { /// Server process object, or null if server hasn't been started yet. - Process _process; + late final Process _process; /// Commands that have been sent to the server but not yet acknowledged, and /// the [Completer] objects which should be completed when acknowledgement is @@ -411,7 +414,7 @@ class Server { /// The [currentElapseTime] at which the last communication was received from /// the server or `null` if no communication has been received. - double lastCommunicationTime; + double? lastCommunicationTime; /// The current elapse time (seconds) since the server was started. double get currentElapseTime => _time.elapsedTicks / _time.frequency; @@ -536,7 +539,7 @@ class Server { /// 'result' field from the response. If the server acknowledges the command /// with an error response, the future will be completed with an error. Future> send( - String method, Map params) { + String method, Map? params) { var id = '${_nextId++}'; var command = {'id': id, 'method': method}; if (params != null) { @@ -554,16 +557,13 @@ class Server { /// with "--observe" and "--pause-isolates-on-exit", allowing the observatory /// to be used. Future start({ - int diagnosticPort, - String instrumentationLogFile, + int? diagnosticPort, + String? instrumentationLogFile, bool profileServer = false, - String sdkPath, - int servicesPort, + String? sdkPath, + int? servicesPort, bool useAnalysisHighlight2 = false, }) async { - if (_process != null) { - throw Exception('Process already started'); - } _time.start(); var dartBinary = Platform.executable; @@ -833,7 +833,7 @@ abstract class _RecursiveMatcher extends Matcher { @override Description describeMismatch( item, Description mismatchDescription, Map matchState, bool verbose) { - var mismatches = matchState['mismatches'] as List; + var mismatches = matchState['mismatches'] as List?; if (mismatches != null) { for (var i = 0; i < mismatches.length; i++) { var mismatch = mismatches[i]; diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart index 2d11af9d4ef..4a8e453ac17 100644 --- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart +++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - /// Matchers for data types defined in the analysis server API. import 'package:test/test.dart'; diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart index e4edae04475..dc5a293f779 100644 --- a/pkg/analysis_server/test/protocol_test.dart +++ b/pkg/analysis_server/test/protocol_test.dart @@ -2,8 +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. -// @dart = 2.9 - import 'dart:convert'; import 'package:analysis_server/protocol/protocol.dart'; @@ -92,34 +90,34 @@ class RequestErrorTest { @reflectiveTest class RequestTest { - void test_fromJson() { + void test_fromString() { var original = Request('one', 'aMethod'); var jsonData = json.encode(original.toJson()); - var request = Request.fromString(jsonData); + var request = Request.fromString(jsonData)!; expect(request.id, equals('one')); expect(request.method, equals('aMethod')); expect(request.clientRequestTime, isNull); } - void test_fromJson_invalidId() { + void test_fromString_invalidId_notString() { var json = '{"id":{"one":"two"},"method":"aMethod","params":{"foo":"bar"}}'; var request = Request.fromString(json); expect(request, isNull); } - void test_fromJson_invalidMethod() { + void test_fromString_invalidMethod_notString() { var json = '{"id":"one","method":{"boo":"aMethod"},"params":{"foo":"bar"}}'; var request = Request.fromString(json); expect(request, isNull); } - void test_fromJson_invalidParams() { + void test_fromString_invalidParams_notMap() { var json = '{"id":"one","method":"aMethod","params":"foobar"}'; var request = Request.fromString(json); expect(request, isNull); } - void test_fromJson_withBadClientTime() { + void test_fromString_withBadClientTime() { var original = Request('one', 'aMethod', null, 347); var map = original.toJson(); // Insert bad value - should be int but client sent string instead @@ -129,19 +127,19 @@ class RequestTest { expect(request, isNull); } - void test_fromJson_withClientTime() { + void test_fromString_withClientTime() { var original = Request('one', 'aMethod', null, 347); var jsonData = json.encode(original.toJson()); - var request = Request.fromString(jsonData); + var request = Request.fromString(jsonData)!; expect(request.id, equals('one')); expect(request.method, equals('aMethod')); expect(request.clientRequestTime, 347); } - void test_fromJson_withParams() { + void test_fromString_withParams() { var original = Request('one', 'aMethod', {'foo': 'bar'}); var jsonData = json.encode(original.toJson()); - var request = Request.fromString(jsonData); + var request = Request.fromString(jsonData)!; expect(request.id, equals('one')); expect(request.method, equals('aMethod')); expect(request.toJson()['params'], equals({'foo': 'bar'})); @@ -199,25 +197,25 @@ class ResponseTest { void test_fromJson() { var original = Response('myId'); - var response = Response.fromJson(original.toJson()); + var response = Response.fromJson(original.toJson())!; expect(response.id, equals('myId')); } void test_fromJson_withError() { var original = Response.invalidRequestFormat(); - var response = Response.fromJson(original.toJson()); + var response = Response.fromJson(original.toJson())!; expect(response.id, equals('')); expect(response.error, isNotNull); - var error = response.error; + var error = response.error!; expect(error.code, equals(RequestErrorCode.INVALID_REQUEST)); expect(error.message, equals('Invalid request')); } void test_fromJson_withResult() { var original = Response('myId', result: {'foo': 'bar'}); - var response = Response.fromJson(original.toJson()); + var response = Response.fromJson(original.toJson())!; expect(response.id, equals('myId')); - var result = response.toJson()['result'] as Map; + var result = response.toJson()['result'] as Map; expect(result.length, equals(1)); expect(result['foo'], equals('bar')); } diff --git a/pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart b/pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart index daf6593ff41..0b80cad7b16 100644 --- a/pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart +++ b/pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart @@ -246,8 +246,9 @@ void main() { '''); var property = await getWidgetProperty('Text(', 'overflow'); + var json = property.toJson().cast(); expect( - property.toJson()['editor']['enumItems'][0]['documentation'], + json['editor']['enumItems'][0]['documentation'], startsWith('Clip the overflowing'), ); diff --git a/pkg/analysis_server/tool/spec/codegen_dart.dart b/pkg/analysis_server/tool/spec/codegen_dart.dart index bc6eeccfa9a..af20098835d 100644 --- a/pkg/analysis_server/tool/spec/codegen_dart.dart +++ b/pkg/analysis_server/tool/spec/codegen_dart.dart @@ -42,4 +42,10 @@ class DartCodegenVisitor extends HierarchicalApiVisitor { throw Exception("Can't convert to a dart type"); } } + + /// Return the Dart type for [field], nullable if the field is optional. + String fieldDartType(TypeObjectField field) { + var typeStr = dartType(field.type); + return field.optional ? '$typeStr?' : typeStr; + } } 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 ab39e33323d..a1ae0ab39df 100644 --- a/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart +++ b/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart @@ -112,8 +112,6 @@ mixin NotificationHandler { void visitApi() { outputHeader(year: '2018'); writeln(); - writeln('// @dart = 2.9'); - writeln(); emitImports(); emitNotificationHandler(); } diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart index 32320825bcf..97af9b0c4d7 100644 --- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart +++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart @@ -259,7 +259,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { /// Emit the toJson() code for an empty class. void emitEmptyToJsonMember() { writeln('@override'); - writeln('Map toJson() => {};'); + writeln('Map toJson() => {};'); } /// Emit a class to encapsulate an enum. @@ -358,7 +358,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { void emitEnumFromJsonConstructor( String className, TypeEnum type, ImpliedType impliedType) { writeln( - 'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {'); + 'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object? json) {'); indent(() { writeln('if (json is String) {'); indent(() { @@ -435,13 +435,6 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { if (emitSpecialStaticMembers(className)) { writeln(); } - for (var field in type.fields) { - if (field.value != null) { - continue; - } - writeln('${dartType(field.type)} _${field.name};'); - writeln(); - } for (var field in type.fields) { if (field.value != null) { continue; @@ -449,19 +442,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { docComment(toHtmlVisitor.collectHtml(() { toHtmlVisitor.translateHtml(field.html); })); - writeln('${dartType(field.type)} get ${field.name} => _${field.name};'); - writeln(); - docComment(toHtmlVisitor.collectHtml(() { - toHtmlVisitor.translateHtml(field.html); - })); - writeln('set ${field.name}(${dartType(field.type)} value) {'); - indent(() { - if (!field.optional) { - writeln('assert(value != null);'); - } - writeln('_${field.name} = value;'); - }); - writeln('}'); + writeln('${fieldDartType(field)} ${field.name};'); writeln(); } emitObjectConstructor(type, className); @@ -505,61 +486,39 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { void emitObjectConstructor(TypeObject type, String className) { var args = []; var optionalArgs = []; - var extraInitCode = []; + var initializers = []; for (var field in type.fields) { if (field.value != null) { continue; } - var arg = '${dartType(field.type)} ${field.name}'; - var setValueFromArg = 'this.${field.name} = ${field.name};'; if (isOptionalConstructorArg(className, field)) { - optionalArgs.add(arg); if (!field.optional) { - // Optional constructor arg, but non-optional field. If no arg is + optionalArgs.add('${dartType(field.type)}? ${field.name}'); + // Optional constructor arg, but non-optional field. If no arg is // given, the constructor should populate with the empty list. var fieldType = field.type; if (fieldType is TypeList) { - extraInitCode.add(() { - writeln('if (${field.name} == null) {'); - indent(() { - writeln( - 'this.${field.name} = <${dartType(fieldType.itemType)}>[];'); - }); - writeln('} else {'); - indent(() { - writeln(setValueFromArg); - }); - writeln('}'); - }); + var defaultValue = '<${dartType(fieldType.itemType)}>[]'; + initializers.add('${field.name} = ${field.name} ?? $defaultValue'); } else { throw Exception("Don't know how to create default field value."); } } else { - extraInitCode.add(() { - writeln(setValueFromArg); - }); + optionalArgs.add('this.${field.name}'); } } else { - args.add(arg); - extraInitCode.add(() { - writeln(setValueFromArg); - }); + args.add('this.${field.name}'); } } if (optionalArgs.isNotEmpty) { args.add('{${optionalArgs.join(', ')}}'); } write('$className(${args.join(', ')})'); - if (extraInitCode.isEmpty) { + if (initializers.isEmpty) { writeln(';'); } else { - writeln(' {'); - indent(() { - for (var callback in extraInitCode) { - callback(); - } - }); - writeln('}'); + writeln(' : ${initializers.join(', ')}'); + writeln(';'); } } @@ -598,8 +557,8 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { String className, TypeObject type, ImpliedType impliedType) { var humanReadableNameString = literalString(impliedType.humanReadableName); if (className == 'RefactoringFeedback') { - writeln('factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, ' - 'String jsonPath, Object json, Map responseJson) {'); + writeln('static RefactoringFeedback? fromJson(JsonDecoder jsonDecoder, ' + 'String jsonPath, Object? json, Map responseJson) {'); indent(() { writeln('return refactoringFeedbackFromJson(jsonDecoder, jsonPath, ' 'json, responseJson);'); @@ -608,8 +567,8 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { return; } if (className == 'RefactoringOptions') { - writeln('factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, ' - 'String jsonPath, Object json, RefactoringKind kind) {'); + writeln('static RefactoringOptions? fromJson(JsonDecoder jsonDecoder, ' + 'String jsonPath, Object? json, RefactoringKind kind) {'); indent(() { writeln('return refactoringOptionsFromJson(jsonDecoder, jsonPath, ' 'json, kind);'); @@ -618,7 +577,7 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { return; } writeln( - 'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {'); + 'factory $className.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object? json) {'); indent(() { writeln('json ??= {};'); writeln('if (json is Map) {'); @@ -629,12 +588,13 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { var fieldNameString = literalString(field.name); var fieldAccessor = 'json[$fieldNameString]'; var jsonPath = 'jsonPath + ${literalString('.${field.name}')}'; - if (field.value != null) { - var valueString = literalString(field.value); + var fieldValue = field.value; + if (fieldValue is String) { + var valueString = literalString(fieldValue); writeln('if ($fieldAccessor != $valueString) {'); indent(() { writeln( - "throw jsonDecoder.mismatch(jsonPath, 'equal ${field.value}', json);"); + "throw jsonDecoder.mismatch(jsonPath, 'equal $fieldValue', json);"); }); writeln('}'); continue; @@ -644,11 +604,11 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { } else { args.add(field.name); } - var fieldType = field.type; - var fieldDartType = dartType(fieldType); - writeln('$fieldDartType ${field.name};'); + var typeStr = fieldDartType(field); + writeln('$typeStr ${field.name};'); writeln('if (json.containsKey($fieldNameString)) {'); indent(() { + var fieldType = field.type; var fromJson = fromJsonCode(fieldType).asSnippet(jsonPath, fieldAccessor); writeln('${field.name} = $fromJson;'); @@ -852,19 +812,23 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { /// Emit the toJson() code for an object class. void emitToJsonMember(TypeObject type) { writeln('@override'); - writeln('Map toJson() {'); + writeln('Map toJson() {'); indent(() { - writeln('var result = {};'); + writeln('var result = {};'); for (var field in type.fields) { var fieldNameString = literalString(field.name); - if (field.value != null) { - writeln('result[$fieldNameString] = ${literalString(field.value)};'); + var fieldValue = field.value; + if (fieldValue is String) { + var valueString = literalString(fieldValue); + writeln('result[$fieldNameString] = $valueString;'); continue; } var fieldToJson = toJsonCode(field.type).asSnippet(field.name); var populateField = 'result[$fieldNameString] = $fieldToJson;'; if (field.optional) { - writeln('if (${field.name} != null) {'); + var name = field.name; + writeln('var $name = this.$name;'); + writeln('if ($name != null) {'); indent(() { writeln(populateField); }); @@ -1122,8 +1086,6 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { void visitApi() { outputHeader(year: '2017'); writeln(); - writeln('// @dart = 2.9'); - writeln(); emitImports(); emitClasses(getClassesToEmit()); } @@ -1177,7 +1139,7 @@ class FromJsonSnippet extends FromJsonCode { @override String get asClosure => - '(String jsonPath, Object json) => ${callback('jsonPath', 'json')}'; + '(String jsonPath, Object? json) => ${callback('jsonPath', 'json')}'; @override bool get isIdentity => false; diff --git a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart index 56d4405ba7a..1ed8a776679 100644 --- a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart +++ b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart @@ -49,7 +49,7 @@ class CodegenInttestMethodsVisitor extends DartCodegenVisitor /// Generate a function argument for the given parameter field. String formatArgument(TypeObjectField field) => - '${dartType(field.type)} ${field.name}'; + '${fieldDartType(field)} ${field.name}'; /// Figure out the appropriate Dart type for data having the given API /// protocol [type]. @@ -86,8 +86,6 @@ class CodegenInttestMethodsVisitor extends DartCodegenVisitor void visitApi() { outputHeader(year: '2017'); writeln(); - writeln('// @dart = 2.9'); - writeln(); writeln('/// Convenience methods for running integration tests.'); writeln("import 'dart:async';"); writeln(); @@ -134,7 +132,6 @@ class CodegenInttestMethodsVisitor extends DartCodegenVisitor writeln('default:'); indent(() { writeln("fail('Unexpected notification: \$event');"); - writeln('break;'); }); }); writeln('}'); @@ -156,12 +153,12 @@ class CodegenInttestMethodsVisitor extends DartCodegenVisitor toHtmlVisitor.translateHtml(notification.html); toHtmlVisitor.describePayload(notification.params, 'Parameters'); })); - writeln('Stream<$className> $streamName;'); + writeln('late Stream<$className> $streamName;'); writeln(); docComment(toHtmlVisitor.collectHtml(() { toHtmlVisitor.write('Stream controller for [$streamName].'); })); - writeln('StreamController<$className> _$streamName;'); + writeln('late StreamController<$className> _$streamName;'); fieldInitializationCode.add(collectCode(() { writeln('_$streamName = StreamController<$className>(sync: true);'); writeln('$streamName = _$streamName.stream.asBroadcastStream();'); diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart index 9d7afb02faa..1a55c6e1696 100644 --- a/pkg/analysis_server/tool/spec/codegen_matchers.dart +++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart @@ -91,8 +91,6 @@ class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator { void visitApi() { outputHeader(year: '2017'); writeln(); - writeln('// @dart = 2.9'); - writeln(); writeln('/// Matchers for data types defined in the analysis server API.'); writeln("import 'package:test/test.dart';"); writeln(); diff --git a/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart b/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart index 023562b6c2b..a81d141b275 100644 --- a/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart +++ b/pkg/analysis_server/tool/spec/codegen_protocol_constants.dart @@ -90,8 +90,6 @@ class CodegenVisitor extends DartCodegenVisitor with CodeGenerator { void visitApi() { outputHeader(year: '2017'); writeln(); - writeln('// @dart = 2.9'); - writeln(); generateConstants(); } } diff --git a/pkg/analysis_server_client/lib/handler/notification_handler.dart b/pkg/analysis_server_client/lib/handler/notification_handler.dart index c91a78ced77..2d8715a87b5 100644 --- a/pkg/analysis_server_client/lib/handler/notification_handler.dart +++ b/pkg/analysis_server_client/lib/handler/notification_handler.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - import 'package:analysis_server_client/protocol.dart'; /// [NotificationHandler] processes analysis server notifications diff --git a/pkg/analysis_server_client/lib/protocol.dart b/pkg/analysis_server_client/lib/protocol.dart index 3879201471a..7a1059b49c1 100644 --- a/pkg/analysis_server_client/lib/protocol.dart +++ b/pkg/analysis_server_client/lib/protocol.dart @@ -2,8 +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. -// @dart = 2.9 - export 'package:analysis_server_client/src/protocol/protocol_base.dart'; export 'package:analysis_server_client/src/protocol/protocol_common.dart'; export 'package:analysis_server_client/src/protocol/protocol_constants.dart'; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart index b855045454e..139d71c0e7a 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_base.dart @@ -2,8 +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. -// @dart = 2.9 - /// Support for client code that needs to interact with the requests, responses /// and notifications that are part of the analysis server's wire protocol. import 'dart:convert' hide JsonDecoder; @@ -36,7 +34,7 @@ class Notification { /// A table mapping the names of notification parameters to their values, or /// `null` if there are no notification parameters. - final Map params; + final Map? params; /// Initialize a newly created [Notification] to have the given [event] name. /// If [params] is provided, it will be used as the params; otherwise no @@ -54,6 +52,7 @@ class Notification { Map toJson() { var jsonObject = {}; jsonObject[EVENT] = event; + var params = this.params; if (params != null) { jsonObject[PARAMS] = params; } @@ -85,84 +84,18 @@ class Request { final String method; /// A table mapping the names of request parameters to their values. - final Map params; + final Map params; /// The time (milliseconds since epoch) at which the client made the request /// or `null` if this information is not provided by the client. - final int clientRequestTime; + final int? clientRequestTime; /// 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(this.id, this.method, - [Map params, this.clientRequestTime]) - : params = params ?? {}; - - /// Return a request parsed from the given json, or `null` if the [data] is - /// not a valid json representation of a request. The [data] is expected to - /// have the following format: - /// - /// { - /// 'clientRequestTime': millisecondsSinceEpoch - /// 'id': String, - /// 'method': methodName, - /// 'params': { - /// paramter_name: value - /// } - /// } - /// - /// where both the parameters and clientRequestTime are optional. - /// - /// The parameters can contain any number of name/value pairs. The - /// clientRequestTime must be an int representing the time at which the client - /// issued the request (milliseconds since epoch). - factory Request.fromJson(Map result) { - var id = result[Request.ID]; - var method = result[Request.METHOD]; - if (id is! String || method is! String) { - return null; - } - var time = result[Request.CLIENT_REQUEST_TIME]; - if (time != null && time is! int) { - return null; - } - var params = result[Request.PARAMS]; - if (params is Map || params == null) { - return Request(id, method, params as Map, time); - } else { - return null; - } - } - - /// Return a request parsed from the given [data], or `null` if the [data] is - /// not a valid json representation of a request. The [data] is expected to - /// have the following format: - /// - /// { - /// 'clientRequestTime': millisecondsSinceEpoch - /// 'id': String, - /// 'method': methodName, - /// 'params': { - /// paramter_name: value - /// } - /// } - /// - /// where both the parameters and clientRequestTime are optional. - /// - /// The parameters can contain any number of name/value pairs. The - /// clientRequestTime must be an int representing the time at which the client - /// issued the request (milliseconds since epoch). - factory Request.fromString(String data) { - try { - var result = json.decode(data); - if (result is Map) { - return Request.fromJson(result as Map); - } - return null; - } catch (exception) { - return null; - } - } + [Map? params, this.clientRequestTime]) + : params = params ?? {}; @override int get hashCode { @@ -187,13 +120,14 @@ class Request { if (params.isNotEmpty) { jsonObject[PARAMS] = params; } + var clientRequestTime = this.clientRequestTime; if (clientRequestTime != null) { jsonObject[CLIENT_REQUEST_TIME] = clientRequestTime; } return jsonObject; } - bool _equalLists(List first, List second) { + bool _equalLists(List? first, List? second) { if (first == null) { return second == null; } @@ -212,7 +146,7 @@ class Request { return true; } - bool _equalMaps(Map first, Map second) { + bool _equalMaps(Map? first, Map? second) { if (first == null) { return second == null; } @@ -233,7 +167,7 @@ class Request { return true; } - bool _equalObjects(Object first, Object second) { + bool _equalObjects(Object? first, Object? second) { if (first == null) { return second == null; } @@ -254,6 +188,72 @@ class Request { } return first == second; } + + /// Return a request parsed from the given json, or `null` if the [data] is + /// not a valid json representation of a request. The [data] is expected to + /// have the following format: + /// + /// { + /// 'clientRequestTime': millisecondsSinceEpoch + /// 'id': String, + /// 'method': methodName, + /// 'params': { + /// paramter_name: value + /// } + /// } + /// + /// where both the parameters and clientRequestTime are optional. + /// + /// The parameters can contain any number of name/value pairs. The + /// clientRequestTime must be an int representing the time at which the client + /// issued the request (milliseconds since epoch). + static Request? fromJson(Map result) { + var id = result[Request.ID]; + var method = result[Request.METHOD]; + if (id is! String || method is! String) { + return null; + } + var time = result[Request.CLIENT_REQUEST_TIME]; + if (time is! int?) { + return null; + } + var params = result[Request.PARAMS]; + if (params is Map?) { + return Request(id, method, params, time); + } else { + return null; + } + } + + /// Return a request parsed from the given [data], or `null` if the [data] is + /// not a valid json representation of a request. The [data] is expected to + /// have the following format: + /// + /// { + /// 'clientRequestTime': millisecondsSinceEpoch + /// 'id': String, + /// 'method': methodName, + /// 'params': { + /// paramter_name: value + /// } + /// } + /// + /// where both the parameters and clientRequestTime are optional. + /// + /// The parameters can contain any number of name/value pairs. The + /// clientRequestTime must be an int representing the time at which the client + /// issued the request (milliseconds since epoch). + static Request? fromString(String data) { + try { + var result = json.decode(data); + if (result is Map) { + return Request.fromJson(result); + } + return null; + } catch (exception) { + return null; + } + } } /// An exception that occurred during the handling of a request that requires @@ -303,17 +303,17 @@ class Response { /// The error that was caused by attempting to handle the request, or `null` if /// there was no error. - final RequestError error; + final RequestError? error; /// A table mapping the names of result fields to their values. Should be /// `null` if there is no result to send. - Map result; + Map? result; /// Initialize a newly created instance to represent a response to a request - /// with the given [id]. If [_result] is provided, it will be used as the + /// 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, {Map result, this.error}) : result = result; + Response(this.id, {this.result, this.error}); /// Create and return the `DEBUG_PORT_COULD_NOT_BE_OPENED` error response. Response.debugPortCouldNotBeOpened(Request request, dynamic error) @@ -342,30 +342,6 @@ class Response { error: RequestError(RequestErrorCode.FORMAT_WITH_ERRORS, 'Error during `edit.format`: source contains syntax errors.')); - /// Initialize a newly created instance based on the given JSON data. - factory Response.fromJson(Map json) { - try { - Object id = json[Response.ID]; - if (id is! String) { - return null; - } - Object error = json[Response.ERROR]; - RequestError decodedError; - if (error is Map) { - decodedError = - RequestError.fromJson(ResponseDecoder(null), '.error', error); - } - Object result = json[Response.RESULT]; - Map decodedResult; - if (result is Map) { - decodedResult = result as Map; - } - return Response(id, error: decodedError, result: decodedResult); - } catch (exception) { - return null; - } - } - /// Initialize a newly created instance to represent the /// GET_ERRORS_INVALID_FILE error condition. Response.getErrorsInvalidFile(Request request) @@ -528,12 +504,41 @@ class Response { Map toJson() { var jsonObject = {}; jsonObject[ID] = id; + var error = this.error; if (error != null) { jsonObject[ERROR] = error.toJson(); } + var result = this.result; if (result != null) { jsonObject[RESULT] = result; } return jsonObject; } + + /// Initialize a newly created instance based on the given JSON data. + static Response? fromJson(Map json) { + try { + var id = json[Response.ID]; + if (id is! String) { + return null; + } + + RequestError? decodedError; + var error = json[Response.ERROR]; + if (error is Map) { + decodedError = + RequestError.fromJson(ResponseDecoder(null), '.error', error); + } + + Map? decodedResult; + var result = json[Response.RESULT]; + if (result is Map) { + decodedResult = result; + } + + return Response(id, error: decodedError, result: decodedResult); + } catch (exception) { + return null; + } + } } diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart index 213f857bf9f..c700088b901 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - import 'dart:convert' hide JsonDecoder; import 'package:analysis_server_client/src/protocol/protocol_util.dart'; @@ -23,14 +21,13 @@ import 'package:analysis_server_client/src/protocol/protocol_internal.dart'; /// /// Clients may not extend, implement or mix-in this class. class AddContentOverlay implements HasToJson { - String _content; + late String _content; /// The new content of the file. String get content => _content; /// The new content of the file. set content(String value) { - assert(value != null); _content = value; } @@ -39,7 +36,7 @@ class AddContentOverlay implements HasToJson { } factory AddContentOverlay.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { if (json['type'] != 'add') { @@ -59,8 +56,8 @@ class AddContentOverlay implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['type'] = 'add'; result['content'] = content; return result; @@ -102,30 +99,29 @@ class AddContentOverlay implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisError implements HasToJson { - AnalysisErrorSeverity _severity; + late AnalysisErrorSeverity _severity; - AnalysisErrorType _type; + late AnalysisErrorType _type; - Location _location; + late Location _location; - String _message; + late String _message; - String _correction; + String? _correction; - String _code; + late String _code; - String _url; + String? _url; - List _contextMessages; + List? _contextMessages; - bool _hasFix; + bool? _hasFix; /// The severity of the error. AnalysisErrorSeverity get severity => _severity; /// The severity of the error. set severity(AnalysisErrorSeverity value) { - assert(value != null); _severity = value; } @@ -134,7 +130,6 @@ class AnalysisError implements HasToJson { /// The type of the error. set type(AnalysisErrorType value) { - assert(value != null); _type = value; } @@ -143,7 +138,6 @@ class AnalysisError implements HasToJson { /// The location associated with the error. set location(Location value) { - assert(value != null); _location = value; } @@ -154,19 +148,18 @@ class AnalysisError implements HasToJson { /// The message to be displayed for this error. The message should indicate /// what is wrong with the code and why it is wrong. set message(String value) { - assert(value != null); _message = value; } /// The correction message to be displayed for this error. The correction /// message should indicate how the user can fix the error. The field is /// omitted if there is no correction message associated with the error code. - String get correction => _correction; + String? get correction => _correction; /// The correction message to be displayed for this error. The correction /// message should indicate how the user can fix the error. The field is /// omitted if there is no correction message associated with the error code. - set correction(String value) { + set correction(String? value) { _correction = value; } @@ -175,25 +168,24 @@ class AnalysisError implements HasToJson { /// The name, as a string, of the error code associated with this error. set code(String value) { - assert(value != null); _code = value; } /// The URL of a page containing documentation associated with this error. - String get url => _url; + String? get url => _url; /// The URL of a page containing documentation associated with this error. - set url(String value) { + set url(String? value) { _url = value; } /// Additional messages associated with this diagnostic that provide context /// to help the user understand the diagnostic. - List get contextMessages => _contextMessages; + List? get contextMessages => _contextMessages; /// Additional messages associated with this diagnostic that provide context /// to help the user understand the diagnostic. - set contextMessages(List value) { + set contextMessages(List? value) { _contextMessages = value; } @@ -206,7 +198,7 @@ class AnalysisError implements HasToJson { /// negatives, no false positives should be returned. If a client sees this /// flag set they can proceed with the confidence that there are in fact /// associated fixes. - bool get hasFix => _hasFix; + bool? get hasFix => _hasFix; /// A hint to indicate to interested clients that this error has an /// associated fix (or fixes). The absence of this field implies there are @@ -217,16 +209,16 @@ class AnalysisError implements HasToJson { /// negatives, no false positives should be returned. If a client sees this /// flag set they can proceed with the confidence that there are in fact /// associated fixes. - set hasFix(bool value) { + set hasFix(bool? value) { _hasFix = value; } AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, String code, - {String correction, - String url, - List contextMessages, - bool hasFix}) { + {String? correction, + String? url, + List? contextMessages, + bool? hasFix}) { this.severity = severity; this.type = type; this.location = location; @@ -239,7 +231,7 @@ class AnalysisError implements HasToJson { } factory AnalysisError.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { AnalysisErrorSeverity severity; @@ -270,7 +262,7 @@ class AnalysisError implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'message'); } - String correction; + String? correction; if (json.containsKey('correction')) { correction = jsonDecoder.decodeString( jsonPath + '.correction', json['correction']); @@ -281,19 +273,19 @@ class AnalysisError implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'code'); } - String url; + String? url; if (json.containsKey('url')) { url = jsonDecoder.decodeString(jsonPath + '.url', json['url']); } - List contextMessages; + List? contextMessages; if (json.containsKey('contextMessages')) { contextMessages = jsonDecoder.decodeList( jsonPath + '.contextMessages', json['contextMessages'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DiagnosticMessage.fromJson(jsonDecoder, jsonPath, json)); } - bool hasFix; + bool? hasFix; if (json.containsKey('hasFix')) { hasFix = jsonDecoder.decodeBool(jsonPath + '.hasFix', json['hasFix']); } @@ -308,24 +300,28 @@ class AnalysisError implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['severity'] = severity.toJson(); result['type'] = type.toJson(); result['location'] = location.toJson(); result['message'] = message; + var correction = this.correction; if (correction != null) { result['correction'] = correction; } result['code'] = code; + var url = this.url; if (url != null) { result['url'] = url; } + var contextMessages = this.contextMessages; if (contextMessages != null) { result['contextMessages'] = contextMessages .map((DiagnosticMessage value) => value.toJson()) .toList(); } + var hasFix = this.hasFix; if (hasFix != null) { result['hasFix'] = hasFix; } @@ -410,7 +406,7 @@ class AnalysisErrorSeverity implements Enum { } factory AnalysisErrorSeverity.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return AnalysisErrorSeverity(json); @@ -503,7 +499,7 @@ class AnalysisErrorType implements Enum { } factory AnalysisErrorType.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return AnalysisErrorType(json); @@ -529,14 +525,13 @@ class AnalysisErrorType implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ChangeContentOverlay implements HasToJson { - List _edits; + late List _edits; /// The edits to be applied to the file. List get edits => _edits; /// The edits to be applied to the file. set edits(List value) { - assert(value != null); _edits = value; } @@ -545,7 +540,7 @@ class ChangeContentOverlay implements HasToJson { } factory ChangeContentOverlay.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { if (json['type'] != 'change') { @@ -556,7 +551,7 @@ class ChangeContentOverlay implements HasToJson { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -568,8 +563,8 @@ class ChangeContentOverlay implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['type'] = 'change'; result['edits'] = edits.map((SourceEdit value) => value.toJson()).toList(); return result; @@ -626,58 +621,57 @@ class ChangeContentOverlay implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionSuggestion implements HasToJson { - CompletionSuggestionKind _kind; + late CompletionSuggestionKind _kind; - int _relevance; + late int _relevance; - String _completion; + late String _completion; - String _displayText; + String? _displayText; - int _replacementOffset; + int? _replacementOffset; - int _replacementLength; + int? _replacementLength; - int _selectionOffset; + late int _selectionOffset; - int _selectionLength; + late int _selectionLength; - bool _isDeprecated; + late bool _isDeprecated; - bool _isPotential; + late bool _isPotential; - String _docSummary; + String? _docSummary; - String _docComplete; + String? _docComplete; - String _declaringType; + String? _declaringType; - String _defaultArgumentListString; + String? _defaultArgumentListString; - List _defaultArgumentListTextRanges; + List? _defaultArgumentListTextRanges; - Element _element; + Element? _element; - String _returnType; + String? _returnType; - List _parameterNames; + List? _parameterNames; - List _parameterTypes; + List? _parameterTypes; - int _requiredParameterCount; + int? _requiredParameterCount; - bool _hasNamedParameters; + bool? _hasNamedParameters; - String _parameterName; + String? _parameterName; - String _parameterType; + String? _parameterType; /// The kind of element being suggested. CompletionSuggestionKind get kind => _kind; /// The kind of element being suggested. set kind(CompletionSuggestionKind value) { - assert(value != null); _kind = value; } @@ -688,7 +682,6 @@ class CompletionSuggestion implements HasToJson { /// The relevance of this completion suggestion where a higher number /// indicates a higher relevance. set relevance(int value) { - assert(value != null); _relevance = value; } @@ -703,19 +696,18 @@ class CompletionSuggestion implements HasToJson { /// additionally insert a template for the parameters. The information /// required in order to do so is contained in other fields. set completion(String value) { - assert(value != null); _completion = value; } /// Text to be displayed in, for example, a completion pop-up. This field is /// only defined if the displayed text should be different than the /// completion. Otherwise it is omitted. - String get displayText => _displayText; + String? get displayText => _displayText; /// Text to be displayed in, for example, a completion pop-up. This field is /// only defined if the displayed text should be different than the /// completion. Otherwise it is omitted. - set displayText(String value) { + set displayText(String? value) { _displayText = value; } @@ -724,14 +716,14 @@ class CompletionSuggestion implements HasToJson { /// completion results. This value may be provided independently of /// replacementLength (for example if only one differs from the completion /// result value). - int get replacementOffset => _replacementOffset; + int? get replacementOffset => _replacementOffset; /// The offset of the start of the text to be replaced. If supplied, this /// should be used in preference to the offset provided on the containing /// completion results. This value may be provided independently of /// replacementLength (for example if only one differs from the completion /// result value). - set replacementOffset(int value) { + set replacementOffset(int? value) { _replacementOffset = value; } @@ -739,13 +731,13 @@ class CompletionSuggestion implements HasToJson { /// in preference to the offset provided on the containing completion /// results. This value may be provided independently of replacementOffset /// (for example if only one differs from the completion result value). - int get replacementLength => _replacementLength; + int? get replacementLength => _replacementLength; /// The length of the text to be replaced. If supplied, this should be used /// in preference to the offset provided on the containing completion /// results. This value may be provided independently of replacementOffset /// (for example if only one differs from the completion result value). - set replacementLength(int value) { + set replacementLength(int? value) { _replacementLength = value; } @@ -756,7 +748,6 @@ class CompletionSuggestion implements HasToJson { /// The offset, relative to the beginning of the completion, of where the /// selection should be placed after insertion. set selectionOffset(int value) { - assert(value != null); _selectionOffset = value; } @@ -765,7 +756,6 @@ class CompletionSuggestion implements HasToJson { /// The number of characters that should be selected after insertion. set selectionLength(int value) { - assert(value != null); _selectionLength = value; } @@ -774,7 +764,6 @@ class CompletionSuggestion implements HasToJson { /// True if the suggested element is deprecated. set isDeprecated(bool value) { - assert(value != null); _isDeprecated = value; } @@ -785,49 +774,48 @@ class CompletionSuggestion implements HasToJson { /// True if the element is not known to be valid for the target. This happens /// if the type of the target is dynamic. set isPotential(bool value) { - assert(value != null); _isPotential = value; } /// An abbreviated version of the Dartdoc associated with the element being /// suggested. This field is omitted if there is no Dartdoc associated with /// the element. - String get docSummary => _docSummary; + String? get docSummary => _docSummary; /// An abbreviated version of the Dartdoc associated with the element being /// suggested. This field is omitted if there is no Dartdoc associated with /// the element. - set docSummary(String value) { + set docSummary(String? value) { _docSummary = value; } /// The Dartdoc associated with the element being suggested. This field is /// omitted if there is no Dartdoc associated with the element. - String get docComplete => _docComplete; + String? get docComplete => _docComplete; /// The Dartdoc associated with the element being suggested. This field is /// omitted if there is no Dartdoc associated with the element. - set docComplete(String value) { + set docComplete(String? value) { _docComplete = value; } /// The class that declares the element being suggested. This field is /// omitted if the suggested element is not a member of a class. - String get declaringType => _declaringType; + String? get declaringType => _declaringType; /// The class that declares the element being suggested. This field is /// omitted if the suggested element is not a member of a class. - set declaringType(String value) { + set declaringType(String? value) { _declaringType = value; } /// A default String for use in generating argument list source contents on /// the client side. - String get defaultArgumentListString => _defaultArgumentListString; + String? get defaultArgumentListString => _defaultArgumentListString; /// A default String for use in generating argument list source contents on /// the client side. - set defaultArgumentListString(String value) { + set defaultArgumentListString(String? value) { _defaultArgumentListString = value; } @@ -837,7 +825,8 @@ class CompletionSuggestion implements HasToJson { /// y', the corresponding text range [0, 1, 3, 1], indicates two text ranges /// of length 1, starting at offsets 0 and 3. Clients can use these ranges to /// treat the 'x' and 'y' values specially for linked edits. - List get defaultArgumentListTextRanges => _defaultArgumentListTextRanges; + List? get defaultArgumentListTextRanges => + _defaultArgumentListTextRanges; /// Pairs of offsets and lengths describing 'defaultArgumentListString' text /// ranges suitable for use by clients to set up linked edits of default @@ -845,91 +834,91 @@ class CompletionSuggestion implements HasToJson { /// y', the corresponding text range [0, 1, 3, 1], indicates two text ranges /// of length 1, starting at offsets 0 and 3. Clients can use these ranges to /// treat the 'x' and 'y' values specially for linked edits. - set defaultArgumentListTextRanges(List value) { + set defaultArgumentListTextRanges(List? value) { _defaultArgumentListTextRanges = value; } /// Information about the element reference being suggested. - Element get element => _element; + Element? get element => _element; /// Information about the element reference being suggested. - set element(Element value) { + set element(Element? value) { _element = value; } /// The return type of the getter, function or method or the type of the /// field being suggested. This field is omitted if the suggested element is /// not a getter, function or method. - String get returnType => _returnType; + String? get returnType => _returnType; /// The return type of the getter, function or method or the type of the /// field being suggested. This field is omitted if the suggested element is /// not a getter, function or method. - set returnType(String value) { + set returnType(String? value) { _returnType = value; } /// The names of the parameters of the function or method being suggested. /// This field is omitted if the suggested element is not a setter, function /// or method. - List get parameterNames => _parameterNames; + List? get parameterNames => _parameterNames; /// The names of the parameters of the function or method being suggested. /// This field is omitted if the suggested element is not a setter, function /// or method. - set parameterNames(List value) { + set parameterNames(List? value) { _parameterNames = value; } /// The types of the parameters of the function or method being suggested. /// This field is omitted if the parameterNames field is omitted. - List get parameterTypes => _parameterTypes; + List? get parameterTypes => _parameterTypes; /// The types of the parameters of the function or method being suggested. /// This field is omitted if the parameterNames field is omitted. - set parameterTypes(List value) { + set parameterTypes(List? value) { _parameterTypes = value; } /// The number of required parameters for the function or method being /// suggested. This field is omitted if the parameterNames field is omitted. - int get requiredParameterCount => _requiredParameterCount; + int? get requiredParameterCount => _requiredParameterCount; /// The number of required parameters for the function or method being /// suggested. This field is omitted if the parameterNames field is omitted. - set requiredParameterCount(int value) { + set requiredParameterCount(int? value) { _requiredParameterCount = value; } /// True if the function or method being suggested has at least one named /// parameter. This field is omitted if the parameterNames field is omitted. - bool get hasNamedParameters => _hasNamedParameters; + bool? get hasNamedParameters => _hasNamedParameters; /// True if the function or method being suggested has at least one named /// parameter. This field is omitted if the parameterNames field is omitted. - set hasNamedParameters(bool value) { + set hasNamedParameters(bool? value) { _hasNamedParameters = value; } /// The name of the optional parameter being suggested. This field is omitted /// if the suggestion is not the addition of an optional argument within an /// argument list. - String get parameterName => _parameterName; + String? get parameterName => _parameterName; /// The name of the optional parameter being suggested. This field is omitted /// if the suggestion is not the addition of an optional argument within an /// argument list. - set parameterName(String value) { + set parameterName(String? value) { _parameterName = value; } /// The type of the options parameter being suggested. This field is omitted /// if the parameterName field is omitted. - String get parameterType => _parameterType; + String? get parameterType => _parameterType; /// The type of the options parameter being suggested. This field is omitted /// if the parameterName field is omitted. - set parameterType(String value) { + set parameterType(String? value) { _parameterType = value; } @@ -941,22 +930,22 @@ class CompletionSuggestion implements HasToJson { int selectionLength, bool isDeprecated, bool isPotential, - {String displayText, - int replacementOffset, - int replacementLength, - String docSummary, - String docComplete, - String declaringType, - String defaultArgumentListString, - List defaultArgumentListTextRanges, - Element element, - String returnType, - List parameterNames, - List parameterTypes, - int requiredParameterCount, - bool hasNamedParameters, - String parameterName, - String parameterType}) { + {String? displayText, + int? replacementOffset, + int? replacementLength, + String? docSummary, + String? docComplete, + String? declaringType, + String? defaultArgumentListString, + List? defaultArgumentListTextRanges, + Element? element, + String? returnType, + List? parameterNames, + List? parameterTypes, + int? requiredParameterCount, + bool? hasNamedParameters, + String? parameterName, + String? parameterType}) { this.kind = kind; this.relevance = relevance; this.completion = completion; @@ -983,7 +972,7 @@ class CompletionSuggestion implements HasToJson { } factory CompletionSuggestion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { CompletionSuggestionKind kind; @@ -1007,17 +996,17 @@ class CompletionSuggestion implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'completion'); } - String displayText; + String? displayText; if (json.containsKey('displayText')) { displayText = jsonDecoder.decodeString( jsonPath + '.displayText', json['displayText']); } - int replacementOffset; + int? replacementOffset; if (json.containsKey('replacementOffset')) { replacementOffset = jsonDecoder.decodeInt( jsonPath + '.replacementOffset', json['replacementOffset']); } - int replacementLength; + int? replacementLength; if (json.containsKey('replacementLength')) { replacementLength = jsonDecoder.decodeInt( jsonPath + '.replacementLength', json['replacementLength']); @@ -1050,71 +1039,71 @@ class CompletionSuggestion implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'isPotential'); } - String docSummary; + String? docSummary; if (json.containsKey('docSummary')) { docSummary = jsonDecoder.decodeString( jsonPath + '.docSummary', json['docSummary']); } - String docComplete; + String? docComplete; if (json.containsKey('docComplete')) { docComplete = jsonDecoder.decodeString( jsonPath + '.docComplete', json['docComplete']); } - String declaringType; + String? declaringType; if (json.containsKey('declaringType')) { declaringType = jsonDecoder.decodeString( jsonPath + '.declaringType', json['declaringType']); } - String defaultArgumentListString; + String? defaultArgumentListString; if (json.containsKey('defaultArgumentListString')) { defaultArgumentListString = jsonDecoder.decodeString( jsonPath + '.defaultArgumentListString', json['defaultArgumentListString']); } - List defaultArgumentListTextRanges; + List? defaultArgumentListTextRanges; if (json.containsKey('defaultArgumentListTextRanges')) { defaultArgumentListTextRanges = jsonDecoder.decodeList( jsonPath + '.defaultArgumentListTextRanges', json['defaultArgumentListTextRanges'], jsonDecoder.decodeInt); } - Element element; + Element? element; if (json.containsKey('element')) { element = Element.fromJson( jsonDecoder, jsonPath + '.element', json['element']); } - String returnType; + String? returnType; if (json.containsKey('returnType')) { returnType = jsonDecoder.decodeString( jsonPath + '.returnType', json['returnType']); } - List parameterNames; + List? parameterNames; if (json.containsKey('parameterNames')) { parameterNames = jsonDecoder.decodeList(jsonPath + '.parameterNames', json['parameterNames'], jsonDecoder.decodeString); } - List parameterTypes; + List? parameterTypes; if (json.containsKey('parameterTypes')) { parameterTypes = jsonDecoder.decodeList(jsonPath + '.parameterTypes', json['parameterTypes'], jsonDecoder.decodeString); } - int requiredParameterCount; + int? requiredParameterCount; if (json.containsKey('requiredParameterCount')) { requiredParameterCount = jsonDecoder.decodeInt( jsonPath + '.requiredParameterCount', json['requiredParameterCount']); } - bool hasNamedParameters; + bool? hasNamedParameters; if (json.containsKey('hasNamedParameters')) { hasNamedParameters = jsonDecoder.decodeBool( jsonPath + '.hasNamedParameters', json['hasNamedParameters']); } - String parameterName; + String? parameterName; if (json.containsKey('parameterName')) { parameterName = jsonDecoder.decodeString( jsonPath + '.parameterName', json['parameterName']); } - String parameterType; + String? parameterType; if (json.containsKey('parameterType')) { parameterType = jsonDecoder.decodeString( jsonPath + '.parameterType', json['parameterType']); @@ -1143,17 +1132,20 @@ class CompletionSuggestion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['relevance'] = relevance; result['completion'] = completion; + var displayText = this.displayText; if (displayText != null) { result['displayText'] = displayText; } + var replacementOffset = this.replacementOffset; if (replacementOffset != null) { result['replacementOffset'] = replacementOffset; } + var replacementLength = this.replacementLength; if (replacementLength != null) { result['replacementLength'] = replacementLength; } @@ -1161,42 +1153,55 @@ class CompletionSuggestion implements HasToJson { result['selectionLength'] = selectionLength; result['isDeprecated'] = isDeprecated; result['isPotential'] = isPotential; + var docSummary = this.docSummary; if (docSummary != null) { result['docSummary'] = docSummary; } + var docComplete = this.docComplete; if (docComplete != null) { result['docComplete'] = docComplete; } + var declaringType = this.declaringType; if (declaringType != null) { result['declaringType'] = declaringType; } + var defaultArgumentListString = this.defaultArgumentListString; if (defaultArgumentListString != null) { result['defaultArgumentListString'] = defaultArgumentListString; } + var defaultArgumentListTextRanges = this.defaultArgumentListTextRanges; if (defaultArgumentListTextRanges != null) { result['defaultArgumentListTextRanges'] = defaultArgumentListTextRanges; } + var element = this.element; if (element != null) { result['element'] = element.toJson(); } + var returnType = this.returnType; if (returnType != null) { result['returnType'] = returnType; } + var parameterNames = this.parameterNames; if (parameterNames != null) { result['parameterNames'] = parameterNames; } + var parameterTypes = this.parameterTypes; if (parameterTypes != null) { result['parameterTypes'] = parameterTypes; } + var requiredParameterCount = this.requiredParameterCount; if (requiredParameterCount != null) { result['requiredParameterCount'] = requiredParameterCount; } + var hasNamedParameters = this.hasNamedParameters; if (hasNamedParameters != null) { result['hasNamedParameters'] = hasNamedParameters; } + var parameterName = this.parameterName; if (parameterName != null) { result['parameterName'] = parameterName; } + var parameterType = this.parameterType; if (parameterType != null) { result['parameterType'] = parameterType; } @@ -1382,7 +1387,7 @@ class CompletionSuggestionKind implements Enum { } factory CompletionSuggestionKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return CompletionSuggestionKind(json); @@ -1408,16 +1413,15 @@ class CompletionSuggestionKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class DiagnosticMessage implements HasToJson { - String _message; + late String _message; - Location _location; + late Location _location; /// The message to be displayed to the user. String get message => _message; /// The message to be displayed to the user. set message(String value) { - assert(value != null); _message = value; } @@ -1428,7 +1432,6 @@ class DiagnosticMessage implements HasToJson { /// The location associated with or referenced by the message. Clients should /// provide the ability to navigate to the location. set location(Location value) { - assert(value != null); _location = value; } @@ -1438,7 +1441,7 @@ class DiagnosticMessage implements HasToJson { } factory DiagnosticMessage.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String message; @@ -1462,8 +1465,8 @@ class DiagnosticMessage implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['message'] = message; result['location'] = location.toJson(); return result; @@ -1528,28 +1531,27 @@ class Element implements HasToJson { return flags; } - ElementKind _kind; + late ElementKind _kind; - String _name; + late String _name; - Location _location; + Location? _location; - int _flags; + late int _flags; - String _parameters; + String? _parameters; - String _returnType; + String? _returnType; - String _typeParameters; + String? _typeParameters; - String _aliasedType; + String? _aliasedType; /// The kind of the element. ElementKind get kind => _kind; /// The kind of the element. set kind(ElementKind value) { - assert(value != null); _kind = value; } @@ -1560,15 +1562,14 @@ class Element implements HasToJson { /// The name of the element. This is typically used as the label in the /// outline. set name(String value) { - assert(value != null); _name = value; } /// The location of the name in the declaration of the element. - Location get location => _location; + Location? get location => _location; /// The location of the name in the declaration of the element. - set location(Location value) { + set location(Location? value) { _location = value; } @@ -1593,7 +1594,6 @@ class Element implements HasToJson { /// - 0x10 - set if the element is private /// - 0x20 - set if the element is deprecated set flags(int value) { - assert(value != null); _flags = value; } @@ -1601,54 +1601,54 @@ class Element implements HasToJson { /// function this field will not be defined. If the element doesn't have /// parameters (e.g. getter), this field will not be defined. If the element /// has zero parameters, this field will have a value of "()". - String get parameters => _parameters; + String? get parameters => _parameters; /// The parameter list for the element. If the element is not a method or /// function this field will not be defined. If the element doesn't have /// parameters (e.g. getter), this field will not be defined. If the element /// has zero parameters, this field will have a value of "()". - set parameters(String value) { + set parameters(String? value) { _parameters = value; } /// The return type of the element. If the element is not a method or /// function this field will not be defined. If the element does not have a /// declared return type, this field will contain an empty string. - String get returnType => _returnType; + String? get returnType => _returnType; /// The return type of the element. If the element is not a method or /// function this field will not be defined. If the element does not have a /// declared return type, this field will contain an empty string. - set returnType(String value) { + set returnType(String? value) { _returnType = value; } /// The type parameter list for the element. If the element doesn't have type /// parameters, this field will not be defined. - String get typeParameters => _typeParameters; + String? get typeParameters => _typeParameters; /// The type parameter list for the element. If the element doesn't have type /// parameters, this field will not be defined. - set typeParameters(String value) { + set typeParameters(String? value) { _typeParameters = value; } /// If the element is a type alias, this field is the aliased type. Otherwise /// this field will not be defined. - String get aliasedType => _aliasedType; + String? get aliasedType => _aliasedType; /// If the element is a type alias, this field is the aliased type. Otherwise /// this field will not be defined. - set aliasedType(String value) { + set aliasedType(String? value) { _aliasedType = value; } Element(ElementKind kind, String name, int flags, - {Location location, - String parameters, - String returnType, - String typeParameters, - String aliasedType}) { + {Location? location, + String? parameters, + String? returnType, + String? typeParameters, + String? aliasedType}) { this.kind = kind; this.name = name; this.location = location; @@ -1660,7 +1660,7 @@ class Element implements HasToJson { } factory Element.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ElementKind kind; @@ -1676,7 +1676,7 @@ class Element implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - Location location; + Location? location; if (json.containsKey('location')) { location = Location.fromJson( jsonDecoder, jsonPath + '.location', json['location']); @@ -1687,22 +1687,22 @@ class Element implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'flags'); } - String parameters; + String? parameters; if (json.containsKey('parameters')) { parameters = jsonDecoder.decodeString( jsonPath + '.parameters', json['parameters']); } - String returnType; + String? returnType; if (json.containsKey('returnType')) { returnType = jsonDecoder.decodeString( jsonPath + '.returnType', json['returnType']); } - String typeParameters; + String? typeParameters; if (json.containsKey('typeParameters')) { typeParameters = jsonDecoder.decodeString( jsonPath + '.typeParameters', json['typeParameters']); } - String aliasedType; + String? aliasedType; if (json.containsKey('aliasedType')) { aliasedType = jsonDecoder.decodeString( jsonPath + '.aliasedType', json['aliasedType']); @@ -1726,23 +1726,28 @@ class Element implements HasToJson { bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0; @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['name'] = name; + var location = this.location; if (location != null) { result['location'] = location.toJson(); } result['flags'] = flags; + var parameters = this.parameters; if (parameters != null) { result['parameters'] = parameters; } + var returnType = this.returnType; if (returnType != null) { result['returnType'] = returnType; } + var typeParameters = this.typeParameters; if (typeParameters != null) { result['typeParameters'] = typeParameters; } + var aliasedType = this.aliasedType; if (aliasedType != null) { result['aliasedType'] = aliasedType; } @@ -1977,7 +1982,7 @@ class ElementKind implements Enum { } factory ElementKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ElementKind(json); @@ -2078,7 +2083,7 @@ class FoldingKind implements Enum { } factory FoldingKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FoldingKind(json); @@ -2105,18 +2110,17 @@ class FoldingKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FoldingRegion implements HasToJson { - FoldingKind _kind; + late FoldingKind _kind; - int _offset; + late int _offset; - int _length; + late int _length; /// The kind of the region. FoldingKind get kind => _kind; /// The kind of the region. set kind(FoldingKind value) { - assert(value != null); _kind = value; } @@ -2125,7 +2129,6 @@ class FoldingRegion implements HasToJson { /// The offset of the region to be folded. set offset(int value) { - assert(value != null); _offset = value; } @@ -2134,7 +2137,6 @@ class FoldingRegion implements HasToJson { /// The length of the region to be folded. set length(int value) { - assert(value != null); _length = value; } @@ -2145,7 +2147,7 @@ class FoldingRegion implements HasToJson { } factory FoldingRegion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { FoldingKind kind; @@ -2174,8 +2176,8 @@ class FoldingRegion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['offset'] = offset; result['length'] = length; @@ -2215,18 +2217,17 @@ class FoldingRegion implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class HighlightRegion implements HasToJson { - HighlightRegionType _type; + late HighlightRegionType _type; - int _offset; + late int _offset; - int _length; + late int _length; /// The type of highlight associated with the region. HighlightRegionType get type => _type; /// The type of highlight associated with the region. set type(HighlightRegionType value) { - assert(value != null); _type = value; } @@ -2235,7 +2236,6 @@ class HighlightRegion implements HasToJson { /// The offset of the region to be highlighted. set offset(int value) { - assert(value != null); _offset = value; } @@ -2244,7 +2244,6 @@ class HighlightRegion implements HasToJson { /// The length of the region to be highlighted. set length(int value) { - assert(value != null); _length = value; } @@ -2255,7 +2254,7 @@ class HighlightRegion implements HasToJson { } factory HighlightRegion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { HighlightRegionType type; @@ -2284,8 +2283,8 @@ class HighlightRegion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['type'] = type.toJson(); result['offset'] = offset; result['length'] = length; @@ -2862,7 +2861,7 @@ class HighlightRegionType implements Enum { } factory HighlightRegionType.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return HighlightRegionType(json); @@ -2891,38 +2890,37 @@ class HighlightRegionType implements Enum { /// /// Clients may not extend, implement or mix-in this class. class KytheEntry implements HasToJson { - KytheVName _source; + late KytheVName _source; - String _kind; + String? _kind; - KytheVName _target; + KytheVName? _target; - String _fact; + late String _fact; - List _value; + List? _value; /// The ticket of the source node. KytheVName get source => _source; /// The ticket of the source node. set source(KytheVName value) { - assert(value != null); _source = value; } /// An edge label. The schema defines which labels are meaningful. - String get kind => _kind; + String? get kind => _kind; /// An edge label. The schema defines which labels are meaningful. - set kind(String value) { + set kind(String? value) { _kind = value; } /// The ticket of the target node. - KytheVName get target => _target; + KytheVName? get target => _target; /// The ticket of the target node. - set target(KytheVName value) { + set target(KytheVName? value) { _target = value; } @@ -2931,20 +2929,19 @@ class KytheEntry implements HasToJson { /// A fact label. The schema defines which fact labels are meaningful. set fact(String value) { - assert(value != null); _fact = value; } /// The String value of the fact. - List get value => _value; + List? get value => _value; /// The String value of the fact. - set value(List value) { + set value(List? value) { _value = value; } KytheEntry(KytheVName source, String fact, - {String kind, KytheVName target, List value}) { + {String? kind, KytheVName? target, List? value}) { this.source = source; this.kind = kind; this.target = target; @@ -2953,7 +2950,7 @@ class KytheEntry implements HasToJson { } factory KytheEntry.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { KytheVName source; @@ -2963,11 +2960,11 @@ class KytheEntry implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'source'); } - String kind; + String? kind; if (json.containsKey('kind')) { kind = jsonDecoder.decodeString(jsonPath + '.kind', json['kind']); } - KytheVName target; + KytheVName? target; if (json.containsKey('target')) { target = KytheVName.fromJson( jsonDecoder, jsonPath + '.target', json['target']); @@ -2978,7 +2975,7 @@ class KytheEntry implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'fact'); } - List value; + List? value; if (json.containsKey('value')) { value = jsonDecoder.decodeList( jsonPath + '.value', json['value'], jsonDecoder.decodeInt); @@ -2990,16 +2987,19 @@ class KytheEntry implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['source'] = source.toJson(); + var kind = this.kind; if (kind != null) { result['kind'] = kind; } + var target = this.target; if (target != null) { result['target'] = target.toJson(); } result['fact'] = fact; + var value = this.value; if (value != null) { result['value'] = value; } @@ -3045,22 +3045,21 @@ class KytheEntry implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class KytheVName implements HasToJson { - String _signature; + late String _signature; - String _corpus; + late String _corpus; - String _root; + late String _root; - String _path; + late String _path; - String _language; + late String _language; /// An opaque signature generated by the analyzer. String get signature => _signature; /// An opaque signature generated by the analyzer. set signature(String value) { - assert(value != null); _signature = value; } @@ -3073,7 +3072,6 @@ class KytheVName implements HasToJson { /// is a collection of related files, such as the contents of a given source /// repository. set corpus(String value) { - assert(value != null); _corpus = value; } @@ -3086,7 +3084,6 @@ class KytheVName implements HasToJson { /// identifier, denoting a distinct subset of the corpus. This may also be /// used to designate virtual collections like generated files. set root(String value) { - assert(value != null); _root = value; } @@ -3097,7 +3094,6 @@ class KytheVName implements HasToJson { /// A path-structured label describing the “location” of the named object /// relative to the corpus and the root. set path(String value) { - assert(value != null); _path = value; } @@ -3106,7 +3102,6 @@ class KytheVName implements HasToJson { /// The language this name belongs to. set language(String value) { - assert(value != null); _language = value; } @@ -3120,7 +3115,7 @@ class KytheVName implements HasToJson { } factory KytheVName.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String signature; @@ -3162,8 +3157,8 @@ class KytheVName implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['signature'] = signature; result['corpus'] = corpus; result['root'] = root; @@ -3209,18 +3204,17 @@ class KytheVName implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class LinkedEditGroup implements HasToJson { - List _positions; + late List _positions; - int _length; + late int _length; - List _suggestions; + late List _suggestions; /// The positions of the regions that should be edited simultaneously. List get positions => _positions; /// The positions of the regions that should be edited simultaneously. set positions(List value) { - assert(value != null); _positions = value; } @@ -3229,7 +3223,6 @@ class LinkedEditGroup implements HasToJson { /// The length of the regions that should be edited simultaneously. set length(int value) { - assert(value != null); _length = value; } @@ -3240,7 +3233,6 @@ class LinkedEditGroup implements HasToJson { /// Pre-computed suggestions for what every region might want to be changed /// to. set suggestions(List value) { - assert(value != null); _suggestions = value; } @@ -3252,7 +3244,7 @@ class LinkedEditGroup implements HasToJson { } factory LinkedEditGroup.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List positions; @@ -3260,7 +3252,7 @@ class LinkedEditGroup implements HasToJson { positions = jsonDecoder.decodeList( jsonPath + '.positions', json['positions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Position.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'positions'); @@ -3276,7 +3268,7 @@ class LinkedEditGroup implements HasToJson { suggestions = jsonDecoder.decodeList( jsonPath + '.suggestions', json['suggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'suggestions'); @@ -3291,8 +3283,8 @@ class LinkedEditGroup implements HasToJson { LinkedEditGroup.empty() : this([], 0, []); @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['positions'] = positions.map((Position value) => value.toJson()).toList(); result['length'] = length; @@ -3347,16 +3339,15 @@ class LinkedEditGroup implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class LinkedEditSuggestion implements HasToJson { - String _value; + late String _value; - LinkedEditSuggestionKind _kind; + late LinkedEditSuggestionKind _kind; /// The value that could be used to replace all of the linked edit regions. String get value => _value; /// The value that could be used to replace all of the linked edit regions. set value(String value) { - assert(value != null); _value = value; } @@ -3365,7 +3356,6 @@ class LinkedEditSuggestion implements HasToJson { /// The kind of value being proposed. set kind(LinkedEditSuggestionKind value) { - assert(value != null); _kind = value; } @@ -3375,7 +3365,7 @@ class LinkedEditSuggestion implements HasToJson { } factory LinkedEditSuggestion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String value; @@ -3398,8 +3388,8 @@ class LinkedEditSuggestion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['value'] = value; result['kind'] = kind.toJson(); return result; @@ -3472,7 +3462,7 @@ class LinkedEditSuggestionKind implements Enum { } factory LinkedEditSuggestionKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return LinkedEditSuggestionKind(json); @@ -3503,26 +3493,25 @@ class LinkedEditSuggestionKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class Location implements HasToJson { - String _file; + late String _file; - int _offset; + late int _offset; - int _length; + late int _length; - int _startLine; + late int _startLine; - int _startColumn; + late int _startColumn; - int _endLine; + late int _endLine; - int _endColumn; + late int _endColumn; /// The file containing the range. String get file => _file; /// The file containing the range. set file(String value) { - assert(value != null); _file = value; } @@ -3531,7 +3520,6 @@ class Location implements HasToJson { /// The offset of the range. set offset(int value) { - assert(value != null); _offset = value; } @@ -3540,7 +3528,6 @@ class Location implements HasToJson { /// The length of the range. set length(int value) { - assert(value != null); _length = value; } @@ -3551,7 +3538,6 @@ class Location implements HasToJson { /// The one-based index of the line containing the first character of the /// range. set startLine(int value) { - assert(value != null); _startLine = value; } @@ -3562,7 +3548,6 @@ class Location implements HasToJson { /// The one-based index of the column containing the first character of the /// range. set startColumn(int value) { - assert(value != null); _startColumn = value; } @@ -3573,7 +3558,6 @@ class Location implements HasToJson { /// The one-based index of the line containing the character immediately /// following the range. set endLine(int value) { - assert(value != null); _endLine = value; } @@ -3584,7 +3568,6 @@ class Location implements HasToJson { /// The one-based index of the column containing the character immediately /// following the range. set endColumn(int value) { - assert(value != null); _endColumn = value; } @@ -3600,7 +3583,7 @@ class Location implements HasToJson { } factory Location.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -3656,8 +3639,8 @@ class Location implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -3709,18 +3692,17 @@ class Location implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class NavigationRegion implements HasToJson { - int _offset; + late int _offset; - int _length; + late int _length; - List _targets; + late List _targets; /// The offset of the region from which the user can navigate. int get offset => _offset; /// The offset of the region from which the user can navigate. set offset(int value) { - assert(value != null); _offset = value; } @@ -3729,7 +3711,6 @@ class NavigationRegion implements HasToJson { /// The length of the region from which the user can navigate. set length(int value) { - assert(value != null); _length = value; } @@ -3742,7 +3723,6 @@ class NavigationRegion implements HasToJson { /// which the given region is bound. By opening the target, clients can /// implement one form of navigation. This list cannot be empty. set targets(List value) { - assert(value != null); _targets = value; } @@ -3753,7 +3733,7 @@ class NavigationRegion implements HasToJson { } factory NavigationRegion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -3782,8 +3762,8 @@ class NavigationRegion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['targets'] = targets; @@ -3828,28 +3808,27 @@ class NavigationRegion implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class NavigationTarget implements HasToJson { - ElementKind _kind; + late ElementKind _kind; - int _fileIndex; + late int _fileIndex; - int _offset; + late int _offset; - int _length; + late int _length; - int _startLine; + late int _startLine; - int _startColumn; + late int _startColumn; - int _codeOffset; + int? _codeOffset; - int _codeLength; + int? _codeLength; /// The kind of the element. ElementKind get kind => _kind; /// The kind of the element. set kind(ElementKind value) { - assert(value != null); _kind = value; } @@ -3860,7 +3839,6 @@ class NavigationTarget implements HasToJson { /// The index of the file (in the enclosing navigation response) to navigate /// to. set fileIndex(int value) { - assert(value != null); _fileIndex = value; } @@ -3869,7 +3847,6 @@ class NavigationTarget implements HasToJson { /// The offset of the name of the target to which the user can navigate. set offset(int value) { - assert(value != null); _offset = value; } @@ -3878,7 +3855,6 @@ class NavigationTarget implements HasToJson { /// The length of the name of the target to which the user can navigate. set length(int value) { - assert(value != null); _length = value; } @@ -3889,7 +3865,6 @@ class NavigationTarget implements HasToJson { /// The one-based index of the line containing the first character of the /// name of the target. set startLine(int value) { - assert(value != null); _startLine = value; } @@ -3900,29 +3875,28 @@ class NavigationTarget implements HasToJson { /// The one-based index of the column containing the first character of the /// name of the target. set startColumn(int value) { - assert(value != null); _startColumn = value; } /// The offset of the target code to which the user can navigate. - int get codeOffset => _codeOffset; + int? get codeOffset => _codeOffset; /// The offset of the target code to which the user can navigate. - set codeOffset(int value) { + set codeOffset(int? value) { _codeOffset = value; } /// The length of the target code to which the user can navigate. - int get codeLength => _codeLength; + int? get codeLength => _codeLength; /// The length of the target code to which the user can navigate. - set codeLength(int value) { + set codeLength(int? value) { _codeLength = value; } NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, int startLine, int startColumn, - {int codeOffset, int codeLength}) { + {int? codeOffset, int? codeLength}) { this.kind = kind; this.fileIndex = fileIndex; this.offset = offset; @@ -3934,7 +3908,7 @@ class NavigationTarget implements HasToJson { } factory NavigationTarget.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ElementKind kind; @@ -3977,12 +3951,12 @@ class NavigationTarget implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'startColumn'); } - int codeOffset; + int? codeOffset; if (json.containsKey('codeOffset')) { codeOffset = jsonDecoder.decodeInt(jsonPath + '.codeOffset', json['codeOffset']); } - int codeLength; + int? codeLength; if (json.containsKey('codeLength')) { codeLength = jsonDecoder.decodeInt(jsonPath + '.codeLength', json['codeLength']); @@ -3996,17 +3970,19 @@ class NavigationTarget implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['fileIndex'] = fileIndex; result['offset'] = offset; result['length'] = length; result['startLine'] = startLine; result['startColumn'] = startColumn; + var codeOffset = this.codeOffset; if (codeOffset != null) { result['codeOffset'] = codeOffset; } + var codeLength = this.codeLength; if (codeLength != null) { result['codeLength'] = codeLength; } @@ -4056,18 +4032,17 @@ class NavigationTarget implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class Occurrences implements HasToJson { - Element _element; + late Element _element; - List _offsets; + late List _offsets; - int _length; + late int _length; /// The element that was referenced. Element get element => _element; /// The element that was referenced. set element(Element value) { - assert(value != null); _element = value; } @@ -4076,7 +4051,6 @@ class Occurrences implements HasToJson { /// The offsets of the name of the referenced element within the file. set offsets(List value) { - assert(value != null); _offsets = value; } @@ -4085,7 +4059,6 @@ class Occurrences implements HasToJson { /// The length of the name of the referenced element. set length(int value) { - assert(value != null); _length = value; } @@ -4096,7 +4069,7 @@ class Occurrences implements HasToJson { } factory Occurrences.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Element element; @@ -4126,8 +4099,8 @@ class Occurrences implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['element'] = element.toJson(); result['offsets'] = offsets; result['length'] = length; @@ -4170,24 +4143,23 @@ class Occurrences implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class Outline implements HasToJson { - Element _element; + late Element _element; - int _offset; + late int _offset; - int _length; + late int _length; - int _codeOffset; + late int _codeOffset; - int _codeLength; + late int _codeLength; - List _children; + List? _children; /// A description of the element represented by this node. Element get element => _element; /// A description of the element represented by this node. set element(Element value) { - assert(value != null); _element = value; } @@ -4202,7 +4174,6 @@ class Outline implements HasToJson { /// element. It can be used, for example, to map locations in the file back /// to an outline. set offset(int value) { - assert(value != null); _offset = value; } @@ -4211,7 +4182,6 @@ class Outline implements HasToJson { /// The length of the element. set length(int value) { - assert(value != null); _length = value; } @@ -4222,7 +4192,6 @@ class Outline implements HasToJson { /// The offset of the first character of the element code, which is neither /// documentation, nor annotation. set codeOffset(int value) { - assert(value != null); _codeOffset = value; } @@ -4231,23 +4200,22 @@ class Outline implements HasToJson { /// The length of the element code. set codeLength(int value) { - assert(value != null); _codeLength = value; } /// The children of the node. The field will be omitted if the node has no /// children. Children are sorted by offset. - List get children => _children; + List? get children => _children; /// The children of the node. The field will be omitted if the node has no /// children. Children are sorted by offset. - set children(List value) { + set children(List? value) { _children = value; } Outline( Element element, int offset, int length, int codeOffset, int codeLength, - {List children}) { + {List? children}) { this.element = element; this.offset = offset; this.length = length; @@ -4257,7 +4225,7 @@ class Outline implements HasToJson { } factory Outline.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Element element; @@ -4293,12 +4261,12 @@ class Outline implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'codeLength'); } - List children; + List? children; if (json.containsKey('children')) { children = jsonDecoder.decodeList( jsonPath + '.children', json['children'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Outline.fromJson(jsonDecoder, jsonPath, json)); } return Outline(element, offset, length, codeOffset, codeLength, @@ -4309,13 +4277,14 @@ class Outline implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['element'] = element.toJson(); result['offset'] = offset; result['length'] = length; result['codeOffset'] = codeOffset; result['codeLength'] = codeLength; + var children = this.children; if (children != null) { result['children'] = children.map((Outline value) => value.toJson()).toList(); @@ -4363,20 +4332,19 @@ class Outline implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ParameterInfo implements HasToJson { - ParameterKind _kind; + late ParameterKind _kind; - String _name; + late String _name; - String _type; + late String _type; - String _defaultValue; + String? _defaultValue; /// The kind of the parameter. ParameterKind get kind => _kind; /// The kind of the parameter. set kind(ParameterKind value) { - assert(value != null); _kind = value; } @@ -4385,7 +4353,6 @@ class ParameterInfo implements HasToJson { /// The name of the parameter. set name(String value) { - assert(value != null); _name = value; } @@ -4394,22 +4361,21 @@ class ParameterInfo implements HasToJson { /// The type of the parameter. set type(String value) { - assert(value != null); _type = value; } /// The default value for this parameter. This value will be omitted if the /// parameter does not have a default value. - String get defaultValue => _defaultValue; + String? get defaultValue => _defaultValue; /// The default value for this parameter. This value will be omitted if the /// parameter does not have a default value. - set defaultValue(String value) { + set defaultValue(String? value) { _defaultValue = value; } ParameterInfo(ParameterKind kind, String name, String type, - {String defaultValue}) { + {String? defaultValue}) { this.kind = kind; this.name = name; this.type = type; @@ -4417,7 +4383,7 @@ class ParameterInfo implements HasToJson { } factory ParameterInfo.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ParameterKind kind; @@ -4439,7 +4405,7 @@ class ParameterInfo implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'type'); } - String defaultValue; + String? defaultValue; if (json.containsKey('defaultValue')) { defaultValue = jsonDecoder.decodeString( jsonPath + '.defaultValue', json['defaultValue']); @@ -4451,11 +4417,12 @@ class ParameterInfo implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['name'] = name; result['type'] = type; + var defaultValue = this.defaultValue; if (defaultValue != null) { result['defaultValue'] = defaultValue; } @@ -4540,7 +4507,7 @@ class ParameterKind implements Enum { } factory ParameterKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ParameterKind(json); @@ -4566,16 +4533,15 @@ class ParameterKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class Position implements HasToJson { - String _file; + late String _file; - int _offset; + late int _offset; /// The file containing the position. String get file => _file; /// The file containing the position. set file(String value) { - assert(value != null); _file = value; } @@ -4584,7 +4550,6 @@ class Position implements HasToJson { /// The offset of the position. set offset(int value) { - assert(value != null); _offset = value; } @@ -4594,7 +4559,7 @@ class Position implements HasToJson { } factory Position.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -4616,8 +4581,8 @@ class Position implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -4727,7 +4692,7 @@ class RefactoringKind implements Enum { } factory RefactoringKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RefactoringKind(json); @@ -4756,23 +4721,23 @@ class RefactoringKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class RefactoringMethodParameter implements HasToJson { - String _id; + String? _id; - RefactoringMethodParameterKind _kind; + late RefactoringMethodParameterKind _kind; - String _type; + late String _type; - String _name; + late String _name; - String _parameters; + String? _parameters; /// The unique identifier of the parameter. Clients may omit this field for /// the parameters they want to add. - String get id => _id; + String? get id => _id; /// The unique identifier of the parameter. Clients may omit this field for /// the parameters they want to add. - set id(String value) { + set id(String? value) { _id = value; } @@ -4781,7 +4746,6 @@ class RefactoringMethodParameter implements HasToJson { /// The kind of the parameter. set kind(RefactoringMethodParameterKind value) { - assert(value != null); _kind = value; } @@ -4792,7 +4756,6 @@ class RefactoringMethodParameter implements HasToJson { /// The type that should be given to the parameter, or the return type of the /// parameter's function type. set type(String value) { - assert(value != null); _type = value; } @@ -4801,25 +4764,24 @@ class RefactoringMethodParameter implements HasToJson { /// The name that should be given to the parameter. set name(String value) { - assert(value != null); _name = value; } /// The parameter list of the parameter's function type. If the parameter is /// not of a function type, this field will not be defined. If the function /// type has zero parameters, this field will have a value of '()'. - String get parameters => _parameters; + String? get parameters => _parameters; /// The parameter list of the parameter's function type. If the parameter is /// not of a function type, this field will not be defined. If the function /// type has zero parameters, this field will have a value of '()'. - set parameters(String value) { + set parameters(String? value) { _parameters = value; } RefactoringMethodParameter( RefactoringMethodParameterKind kind, String type, String name, - {String id, String parameters}) { + {String? id, String? parameters}) { this.id = id; this.kind = kind; this.type = type; @@ -4828,10 +4790,10 @@ class RefactoringMethodParameter implements HasToJson { } factory RefactoringMethodParameter.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String id; + String? id; if (json.containsKey('id')) { id = jsonDecoder.decodeString(jsonPath + '.id', json['id']); } @@ -4854,7 +4816,7 @@ class RefactoringMethodParameter implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - String parameters; + String? parameters; if (json.containsKey('parameters')) { parameters = jsonDecoder.decodeString( jsonPath + '.parameters', json['parameters']); @@ -4867,14 +4829,16 @@ class RefactoringMethodParameter implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var id = this.id; if (id != null) { result['id'] = id; } result['kind'] = kind.toJson(); result['type'] = type; result['name'] = name; + var parameters = this.parameters; if (parameters != null) { result['parameters'] = parameters; } @@ -4949,7 +4913,7 @@ class RefactoringMethodParameterKind implements Enum { } factory RefactoringMethodParameterKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RefactoringMethodParameterKind(json); @@ -4977,18 +4941,17 @@ class RefactoringMethodParameterKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class RefactoringProblem implements HasToJson { - RefactoringProblemSeverity _severity; + late RefactoringProblemSeverity _severity; - String _message; + late String _message; - Location _location; + Location? _location; /// The severity of the problem being represented. RefactoringProblemSeverity get severity => _severity; /// The severity of the problem being represented. set severity(RefactoringProblemSeverity value) { - assert(value != null); _severity = value; } @@ -4997,31 +4960,30 @@ class RefactoringProblem implements HasToJson { /// A human-readable description of the problem being represented. set message(String value) { - assert(value != null); _message = value; } /// The location of the problem being represented. This field is omitted /// unless there is a specific location associated with the problem (such as /// a location where an element being renamed will be shadowed). - Location get location => _location; + Location? get location => _location; /// The location of the problem being represented. This field is omitted /// unless there is a specific location associated with the problem (such as /// a location where an element being renamed will be shadowed). - set location(Location value) { + set location(Location? value) { _location = value; } RefactoringProblem(RefactoringProblemSeverity severity, String message, - {Location location}) { + {Location? location}) { this.severity = severity; this.message = message; this.location = location; } factory RefactoringProblem.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { RefactoringProblemSeverity severity; @@ -5038,7 +5000,7 @@ class RefactoringProblem implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'message'); } - Location location; + Location? location; if (json.containsKey('location')) { location = Location.fromJson( jsonDecoder, jsonPath + '.location', json['location']); @@ -5050,10 +5012,11 @@ class RefactoringProblem implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['severity'] = severity.toJson(); result['message'] = message; + var location = this.location; if (location != null) { result['location'] = location.toJson(); } @@ -5147,7 +5110,7 @@ class RefactoringProblemSeverity implements Enum { } factory RefactoringProblemSeverity.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RefactoringProblemSeverity(json); @@ -5159,8 +5122,8 @@ class RefactoringProblemSeverity implements Enum { } /// Returns the [RefactoringProblemSeverity] with the maximal severity. - static RefactoringProblemSeverity max( - RefactoringProblemSeverity a, RefactoringProblemSeverity b) => + static RefactoringProblemSeverity? max( + RefactoringProblemSeverity? a, RefactoringProblemSeverity? b) => maxRefactoringProblemSeverity(a, b); @override @@ -5180,7 +5143,7 @@ class RemoveContentOverlay implements HasToJson { RemoveContentOverlay(); factory RemoveContentOverlay.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { if (json['type'] != 'remove') { @@ -5193,8 +5156,8 @@ class RemoveContentOverlay implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['type'] = 'remove'; return result; } @@ -5230,22 +5193,21 @@ class RemoveContentOverlay implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class SourceChange implements HasToJson { - String _message; + late String _message; - List _edits; + late List _edits; - List _linkedEditGroups; + late List _linkedEditGroups; - Position _selection; + Position? _selection; - String _id; + String? _id; /// A human-readable description of the change to be applied. String get message => _message; /// A human-readable description of the change to be applied. set message(String value) { - assert(value != null); _message = value; } @@ -5254,7 +5216,6 @@ class SourceChange implements HasToJson { /// A list of the edits used to effect the change, grouped by file. set edits(List value) { - assert(value != null); _edits = value; } @@ -5265,33 +5226,32 @@ class SourceChange implements HasToJson { /// A list of the linked editing groups used to customize the changes that /// were made. set linkedEditGroups(List value) { - assert(value != null); _linkedEditGroups = value; } /// The position that should be selected after the edits have been applied. - Position get selection => _selection; + Position? get selection => _selection; /// The position that should be selected after the edits have been applied. - set selection(Position value) { + set selection(Position? value) { _selection = value; } /// The optional identifier of the change kind. The identifier remains stable /// even if the message changes, or is parameterized. - String get id => _id; + String? get id => _id; /// The optional identifier of the change kind. The identifier remains stable /// even if the message changes, or is parameterized. - set id(String value) { + set id(String? value) { _id = value; } SourceChange(String message, - {List edits, - List linkedEditGroups, - Position selection, - String id}) { + {List? edits, + List? linkedEditGroups, + Position? selection, + String? id}) { this.message = message; if (edits == null) { this.edits = []; @@ -5308,7 +5268,7 @@ class SourceChange implements HasToJson { } factory SourceChange.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String message; @@ -5323,7 +5283,7 @@ class SourceChange implements HasToJson { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -5333,17 +5293,17 @@ class SourceChange implements HasToJson { linkedEditGroups = jsonDecoder.decodeList( jsonPath + '.linkedEditGroups', json['linkedEditGroups'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'linkedEditGroups'); } - Position selection; + Position? selection; if (json.containsKey('selection')) { selection = Position.fromJson( jsonDecoder, jsonPath + '.selection', json['selection']); } - String id; + String? id; if (json.containsKey('id')) { id = jsonDecoder.decodeString(jsonPath + '.id', json['id']); } @@ -5358,17 +5318,19 @@ class SourceChange implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['message'] = message; result['edits'] = edits.map((SourceFileEdit value) => value.toJson()).toList(); result['linkedEditGroups'] = linkedEditGroups .map((LinkedEditGroup value) => value.toJson()) .toList(); + var selection = this.selection; if (selection != null) { result['selection'] = selection.toJson(); } + var id = this.id; if (id != null) { result['id'] = id; } @@ -5390,7 +5352,7 @@ class SourceChange implements HasToJson { } /// Returns the [FileEdit] for the given [file], maybe `null`. - SourceFileEdit getFileEdit(String file) => getChangeFileEdit(this, file); + SourceFileEdit? getFileEdit(String file) => getChangeFileEdit(this, file); @override String toString() => json.encode(toJson()); @@ -5437,20 +5399,19 @@ class SourceEdit implements HasToJson { static String applySequence(String code, Iterable edits) => applySequenceOfEdits(code, edits); - int _offset; + late int _offset; - int _length; + late int _length; - String _replacement; + late String _replacement; - String _id; + String? _id; /// The offset of the region to be modified. int get offset => _offset; /// The offset of the region to be modified. set offset(int value) { - assert(value != null); _offset = value; } @@ -5459,7 +5420,6 @@ class SourceEdit implements HasToJson { /// The length of the region to be modified. set length(int value) { - assert(value != null); _length = value; } @@ -5468,7 +5428,6 @@ class SourceEdit implements HasToJson { /// The code that is to replace the specified region in the original code. set replacement(String value) { - assert(value != null); _replacement = value; } @@ -5480,7 +5439,7 @@ class SourceEdit implements HasToJson { /// be appropriate (referred to as potential edits). Such edits will have an /// id so that they can be referenced. Edits in the same response that do not /// need to be referenced will not have an id. - String get id => _id; + String? get id => _id; /// An identifier that uniquely identifies this source edit from other edits /// in the same response. This field is omitted unless a containing structure @@ -5490,11 +5449,11 @@ class SourceEdit implements HasToJson { /// be appropriate (referred to as potential edits). Such edits will have an /// id so that they can be referenced. Edits in the same response that do not /// need to be referenced will not have an id. - set id(String value) { + set id(String? value) { _id = value; } - SourceEdit(int offset, int length, String replacement, {String id}) { + SourceEdit(int offset, int length, String replacement, {String? id}) { this.offset = offset; this.length = length; this.replacement = replacement; @@ -5502,7 +5461,7 @@ class SourceEdit implements HasToJson { } factory SourceEdit.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -5524,7 +5483,7 @@ class SourceEdit implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'replacement'); } - String id; + String? id; if (json.containsKey('id')) { id = jsonDecoder.decodeString(jsonPath + '.id', json['id']); } @@ -5538,11 +5497,12 @@ class SourceEdit implements HasToJson { int get end => offset + length; @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['replacement'] = replacement; + var id = this.id; if (id != null) { result['id'] = id; } @@ -5587,18 +5547,17 @@ class SourceEdit implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class SourceFileEdit implements HasToJson { - String _file; + late String _file; - int _fileStamp; + late int _fileStamp; - List _edits; + late List _edits; /// The file containing the code to be modified. String get file => _file; /// The file containing the code to be modified. set file(String value) { - assert(value != null); _file = value; } @@ -5615,7 +5574,6 @@ class SourceFileEdit implements HasToJson { /// make sure that the file was not changed since then, so it is safe to /// apply the change. set fileStamp(int value) { - assert(value != null); _fileStamp = value; } @@ -5624,11 +5582,10 @@ class SourceFileEdit implements HasToJson { /// A list of the edits used to effect the change. set edits(List value) { - assert(value != null); _edits = value; } - SourceFileEdit(String file, int fileStamp, {List edits}) { + SourceFileEdit(String file, int fileStamp, {List? edits}) { this.file = file; this.fileStamp = fileStamp; if (edits == null) { @@ -5639,7 +5596,7 @@ class SourceFileEdit implements HasToJson { } factory SourceFileEdit.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5660,7 +5617,7 @@ class SourceFileEdit implements HasToJson { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -5672,8 +5629,8 @@ class SourceFileEdit implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['fileStamp'] = fileStamp; result['edits'] = edits.map((SourceEdit value) => value.toJson()).toList(); diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart index 654d974086d..6772e9dc901 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - const String PROTOCOL_VERSION = '1.32.5'; const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles'; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart index 5b5a5ef14c7..68e4a9b1029 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart @@ -6,8 +6,6 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". -// @dart = 2.9 - import 'dart:convert' hide JsonDecoder; import 'package:analysis_server_client/src/protocol/protocol_base.dart'; @@ -23,23 +21,13 @@ import 'package:analysis_server_client/src/protocol/protocol_util.dart'; /// /// Clients may not extend, implement or mix-in this class. class AnalysisAnalyzedFilesParams implements HasToJson { - List _directories; - /// A list of the paths of the files that are being analyzed. - List get directories => _directories; + List directories; - /// A list of the paths of the files that are being analyzed. - set directories(List value) { - assert(value != null); - _directories = value; - } - - AnalysisAnalyzedFilesParams(List directories) { - this.directories = directories; - } + AnalysisAnalyzedFilesParams(this.directories); factory AnalysisAnalyzedFilesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List directories; @@ -63,8 +51,8 @@ class AnalysisAnalyzedFilesParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['directories'] = directories; return result; } @@ -102,18 +90,8 @@ class AnalysisAnalyzedFilesParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisClosingLabelsParams implements HasToJson { - String _file; - - List _labels; - /// The file the closing labels relate to. - String get file => _file; - - /// The file the closing labels relate to. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// Closing labels relevant to the file. Each item represents a useful label /// associated with some range with may be useful to display to the user @@ -122,27 +100,12 @@ class AnalysisClosingLabelsParams implements HasToJson { /// and List arguments that span multiple lines. Note that the ranges that /// are returned can overlap each other because they may be associated with /// constructs that can be nested. - List get labels => _labels; + List labels; - /// Closing labels relevant to the file. Each item represents a useful label - /// associated with some range with may be useful to display to the user - /// within the editor at the end of the range to indicate what construct is - /// closed at that location. Closing labels include constructor/method calls - /// and List arguments that span multiple lines. Note that the ranges that - /// are returned can overlap each other because they may be associated with - /// constructs that can be nested. - set labels(List value) { - assert(value != null); - _labels = value; - } - - AnalysisClosingLabelsParams(String file, List labels) { - this.file = file; - this.labels = labels; - } + AnalysisClosingLabelsParams(this.file, this.labels); factory AnalysisClosingLabelsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -156,7 +119,7 @@ class AnalysisClosingLabelsParams implements HasToJson { labels = jsonDecoder.decodeList( jsonPath + '.labels', json['labels'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ClosingLabel.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'labels'); @@ -175,8 +138,8 @@ class AnalysisClosingLabelsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['labels'] = labels.map((ClosingLabel value) => value.toJson()).toList(); @@ -218,39 +181,17 @@ class AnalysisClosingLabelsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisErrorFixes implements HasToJson { - AnalysisError _error; - - List _fixes; - /// The error with which the fixes are associated. - AnalysisError get error => _error; - - /// The error with which the fixes are associated. - set error(AnalysisError value) { - assert(value != null); - _error = value; - } + AnalysisError error; /// The fixes associated with the error. - List get fixes => _fixes; + List fixes; - /// The fixes associated with the error. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - AnalysisErrorFixes(AnalysisError error, {List fixes}) { - this.error = error; - if (fixes == null) { - this.fixes = []; - } else { - this.fixes = fixes; - } - } + AnalysisErrorFixes(this.error, {List? fixes}) + : fixes = fixes ?? []; factory AnalysisErrorFixes.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { AnalysisError error; @@ -265,7 +206,7 @@ class AnalysisErrorFixes implements HasToJson { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceChange.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -277,8 +218,8 @@ class AnalysisErrorFixes implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['error'] = error.toJson(); result['fixes'] = fixes.map((SourceChange value) => value.toJson()).toList(); @@ -316,35 +257,16 @@ class AnalysisErrorFixes implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisErrorsParams implements HasToJson { - String _file; - - List _errors; - /// The file containing the errors. - String get file => _file; - - /// The file containing the errors. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The errors contained in the file. - List get errors => _errors; + List errors; - /// The errors contained in the file. - set errors(List value) { - assert(value != null); - _errors = value; - } - - AnalysisErrorsParams(String file, List errors) { - this.file = file; - this.errors = errors; - } + AnalysisErrorsParams(this.file, this.errors); factory AnalysisErrorsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -358,7 +280,7 @@ class AnalysisErrorsParams implements HasToJson { errors = jsonDecoder.decodeList( jsonPath + '.errors', json['errors'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AnalysisError.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'errors'); @@ -375,8 +297,8 @@ class AnalysisErrorsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['errors'] = errors.map((AnalysisError value) => value.toJson()).toList(); @@ -417,23 +339,13 @@ class AnalysisErrorsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisFlushResultsParams implements HasToJson { - List _files; - /// The files that are no longer being analyzed. - List get files => _files; + List files; - /// The files that are no longer being analyzed. - set files(List value) { - assert(value != null); - _files = value; - } - - AnalysisFlushResultsParams(List files) { - this.files = files; - } + AnalysisFlushResultsParams(this.files); factory AnalysisFlushResultsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List files; @@ -457,8 +369,8 @@ class AnalysisFlushResultsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = files; return result; } @@ -495,35 +407,16 @@ class AnalysisFlushResultsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisFoldingParams implements HasToJson { - String _file; - - List _regions; - /// The file containing the folding regions. - String get file => _file; - - /// The file containing the folding regions. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The folding regions contained in the file. - List get regions => _regions; + List regions; - /// The folding regions contained in the file. - set regions(List value) { - assert(value != null); - _regions = value; - } - - AnalysisFoldingParams(String file, List regions) { - this.file = file; - this.regions = regions; - } + AnalysisFoldingParams(this.file, this.regions); factory AnalysisFoldingParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -537,7 +430,7 @@ class AnalysisFoldingParams implements HasToJson { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FoldingRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -554,8 +447,8 @@ class AnalysisFoldingParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['regions'] = regions.map((FoldingRegion value) => value.toJson()).toList(); @@ -596,23 +489,13 @@ class AnalysisFoldingParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetErrorsParams implements RequestParams { - String _file; - /// The file for which errors are being requested. - String get file => _file; + String file; - /// The file for which errors are being requested. - set file(String value) { - assert(value != null); - _file = value; - } - - AnalysisGetErrorsParams(String file) { - this.file = file; - } + AnalysisGetErrorsParams(this.file); factory AnalysisGetErrorsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -633,8 +516,8 @@ class AnalysisGetErrorsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -671,23 +554,13 @@ class AnalysisGetErrorsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetErrorsResult implements ResponseResult { - List _errors; - /// The errors associated with the file. - List get errors => _errors; + List errors; - /// The errors associated with the file. - set errors(List value) { - assert(value != null); - _errors = value; - } - - AnalysisGetErrorsResult(List errors) { - this.errors = errors; - } + AnalysisGetErrorsResult(this.errors); factory AnalysisGetErrorsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List errors; @@ -695,7 +568,7 @@ class AnalysisGetErrorsResult implements ResponseResult { errors = jsonDecoder.decodeList( jsonPath + '.errors', json['errors'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AnalysisError.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'errors'); @@ -714,8 +587,8 @@ class AnalysisGetErrorsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['errors'] = errors.map((AnalysisError value) => value.toJson()).toList(); return result; @@ -755,35 +628,16 @@ class AnalysisGetErrorsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetHoverParams implements RequestParams { - String _file; - - int _offset; - /// The file in which hover information is being requested. - String get file => _file; - - /// The file in which hover information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset for which hover information is being requested. - int get offset => _offset; + int offset; - /// The offset for which hover information is being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } - - AnalysisGetHoverParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + AnalysisGetHoverParams(this.file, this.offset); factory AnalysisGetHoverParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -810,8 +664,8 @@ class AnalysisGetHoverParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -850,31 +704,17 @@ class AnalysisGetHoverParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetHoverResult implements ResponseResult { - List _hovers; - /// The hover information associated with the location. The list will be /// empty if no information could be determined for the location. The list /// can contain multiple items if the file is being analyzed in multiple /// contexts in conflicting ways (such as a part that is included in multiple /// libraries). - List get hovers => _hovers; + List hovers; - /// The hover information associated with the location. The list will be - /// empty if no information could be determined for the location. The list - /// can contain multiple items if the file is being analyzed in multiple - /// contexts in conflicting ways (such as a part that is included in multiple - /// libraries). - set hovers(List value) { - assert(value != null); - _hovers = value; - } - - AnalysisGetHoverResult(List hovers) { - this.hovers = hovers; - } + AnalysisGetHoverResult(this.hovers); factory AnalysisGetHoverResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List hovers; @@ -882,7 +722,7 @@ class AnalysisGetHoverResult implements ResponseResult { hovers = jsonDecoder.decodeList( jsonPath + '.hovers', json['hovers'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => HoverInformation.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'hovers'); @@ -901,8 +741,8 @@ class AnalysisGetHoverResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['hovers'] = hovers.map((HoverInformation value) => value.toJson()).toList(); return result; @@ -943,47 +783,19 @@ class AnalysisGetHoverResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetImportedElementsParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file in which import information is being requested. - String get file => _file; - - /// The file in which import information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the region for which import information is being requested. - int get offset => _offset; - - /// The offset of the region for which import information is being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the region for which import information is being requested. - int get length => _length; + int length; - /// The length of the region for which import information is being requested. - set length(int value) { - assert(value != null); - _length = value; - } - - AnalysisGetImportedElementsParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + AnalysisGetImportedElementsParams(this.file, this.offset, this.length); factory AnalysisGetImportedElementsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1017,8 +829,8 @@ class AnalysisGetImportedElementsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -1061,25 +873,14 @@ class AnalysisGetImportedElementsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetImportedElementsResult implements ResponseResult { - List _elements; - /// The information about the elements that are referenced in the specified /// region of the specified file that come from imported libraries. - List get elements => _elements; + List elements; - /// The information about the elements that are referenced in the specified - /// region of the specified file that come from imported libraries. - set elements(List value) { - assert(value != null); - _elements = value; - } - - AnalysisGetImportedElementsResult(List elements) { - this.elements = elements; - } + AnalysisGetImportedElementsResult(this.elements); factory AnalysisGetImportedElementsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List elements; @@ -1087,7 +888,7 @@ class AnalysisGetImportedElementsResult implements ResponseResult { elements = jsonDecoder.decodeList( jsonPath + '.elements', json['elements'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImportedElements.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'elements'); @@ -1107,8 +908,8 @@ class AnalysisGetImportedElementsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['elements'] = elements.map((ImportedElements value) => value.toJson()).toList(); return result; @@ -1144,7 +945,7 @@ class AnalysisGetImportedElementsResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class AnalysisGetLibraryDependenciesParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -1174,42 +975,19 @@ class AnalysisGetLibraryDependenciesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetLibraryDependenciesResult implements ResponseResult { - List _libraries; - - Map>> _packageMap; - /// A list of the paths of library elements referenced by files in existing /// analysis roots. - List get libraries => _libraries; - - /// A list of the paths of library elements referenced by files in existing - /// analysis roots. - set libraries(List value) { - assert(value != null); - _libraries = value; - } + List libraries; /// A mapping from context source roots to package maps which map package /// names to source directories for use in client-side package URI /// resolution. - Map>> get packageMap => _packageMap; + Map>> packageMap; - /// A mapping from context source roots to package maps which map package - /// names to source directories for use in client-side package URI - /// resolution. - set packageMap(Map>> value) { - assert(value != null); - _packageMap = value; - } - - AnalysisGetLibraryDependenciesResult(List libraries, - Map>> packageMap) { - this.libraries = libraries; - this.packageMap = packageMap; - } + AnalysisGetLibraryDependenciesResult(this.libraries, this.packageMap); factory AnalysisGetLibraryDependenciesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List libraries; @@ -1223,9 +1001,9 @@ class AnalysisGetLibraryDependenciesResult implements ResponseResult { if (json.containsKey('packageMap')) { packageMap = jsonDecoder.decodeMap( jsonPath + '.packageMap', json['packageMap'], - valueDecoder: (String jsonPath, Object json) => + valueDecoder: (String jsonPath, Object? json) => jsonDecoder.decodeMap(jsonPath, json, - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString))); } else { throw jsonDecoder.mismatch(jsonPath, 'packageMap'); @@ -1245,8 +1023,8 @@ class AnalysisGetLibraryDependenciesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['libraries'] = libraries; result['packageMap'] = packageMap; return result; @@ -1297,51 +1075,21 @@ class AnalysisGetLibraryDependenciesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetNavigationParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file in which navigation information is being requested. - String get file => _file; - - /// The file in which navigation information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the region for which navigation information is being /// requested. - int get offset => _offset; - - /// The offset of the region for which navigation information is being - /// requested. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the region for which navigation information is being /// requested. - int get length => _length; + int length; - /// The length of the region for which navigation information is being - /// requested. - set length(int value) { - assert(value != null); - _length = value; - } - - AnalysisGetNavigationParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + AnalysisGetNavigationParams(this.file, this.offset, this.length); factory AnalysisGetNavigationParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1375,8 +1123,8 @@ class AnalysisGetNavigationParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -1421,52 +1169,21 @@ class AnalysisGetNavigationParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetNavigationResult implements ResponseResult { - List _files; - - List _targets; - - List _regions; - /// A list of the paths of files that are referenced by the navigation /// targets. - List get files => _files; - - /// A list of the paths of files that are referenced by the navigation - /// targets. - set files(List value) { - assert(value != null); - _files = value; - } + List files; /// A list of the navigation targets that are referenced by the navigation /// regions. - List get targets => _targets; - - /// A list of the navigation targets that are referenced by the navigation - /// regions. - set targets(List value) { - assert(value != null); - _targets = value; - } + List targets; /// A list of the navigation regions within the requested region of the file. - List get regions => _regions; + List regions; - /// A list of the navigation regions within the requested region of the file. - set regions(List value) { - assert(value != null); - _regions = value; - } - - AnalysisGetNavigationResult(List files, - List targets, List regions) { - this.files = files; - this.targets = targets; - this.regions = regions; - } + AnalysisGetNavigationResult(this.files, this.targets, this.regions); factory AnalysisGetNavigationResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List files; @@ -1481,7 +1198,7 @@ class AnalysisGetNavigationResult implements ResponseResult { targets = jsonDecoder.decodeList( jsonPath + '.targets', json['targets'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationTarget.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'targets'); @@ -1491,7 +1208,7 @@ class AnalysisGetNavigationResult implements ResponseResult { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -1511,8 +1228,8 @@ class AnalysisGetNavigationResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = files; result['targets'] = targets.map((NavigationTarget value) => value.toJson()).toList(); @@ -1559,23 +1276,13 @@ class AnalysisGetNavigationResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetReachableSourcesParams implements RequestParams { - String _file; - /// The file for which reachable source information is being requested. - String get file => _file; + String file; - /// The file for which reachable source information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } - - AnalysisGetReachableSourcesParams(String file) { - this.file = file; - } + AnalysisGetReachableSourcesParams(this.file); factory AnalysisGetReachableSourcesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1597,8 +1304,8 @@ class AnalysisGetReachableSourcesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -1635,8 +1342,6 @@ class AnalysisGetReachableSourcesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetReachableSourcesResult implements ResponseResult { - Map> _sources; - /// A mapping from source URIs to directly reachable source URIs. For /// example, a file "foo.dart" that imports "bar.dart" would have the /// corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If @@ -1644,32 +1349,18 @@ class AnalysisGetReachableSourcesResult implements ResponseResult { /// the URI "file:///bar.dart" to them. To check if a specific URI is /// reachable from a given file, clients can check for its presence in the /// resulting key set. - Map> get sources => _sources; + Map> sources; - /// A mapping from source URIs to directly reachable source URIs. For - /// example, a file "foo.dart" that imports "bar.dart" would have the - /// corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If - /// "bar.dart" has further imports (or exports) there will be a mapping from - /// the URI "file:///bar.dart" to them. To check if a specific URI is - /// reachable from a given file, clients can check for its presence in the - /// resulting key set. - set sources(Map> value) { - assert(value != null); - _sources = value; - } - - AnalysisGetReachableSourcesResult(Map> sources) { - this.sources = sources; - } + AnalysisGetReachableSourcesResult(this.sources); factory AnalysisGetReachableSourcesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map> sources; if (json.containsKey('sources')) { sources = jsonDecoder.decodeMap(jsonPath + '.sources', json['sources'], - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString)); } else { throw jsonDecoder.mismatch(jsonPath, 'sources'); @@ -1689,8 +1380,8 @@ class AnalysisGetReachableSourcesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['sources'] = sources; return result; } @@ -1732,35 +1423,16 @@ class AnalysisGetReachableSourcesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetSignatureParams implements RequestParams { - String _file; - - int _offset; - /// The file in which signature information is being requested. - String get file => _file; - - /// The file in which signature information is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The location for which signature information is being requested. - int get offset => _offset; + int offset; - /// The location for which signature information is being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } - - AnalysisGetSignatureParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + AnalysisGetSignatureParams(this.file, this.offset); factory AnalysisGetSignatureParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -1788,8 +1460,8 @@ class AnalysisGetSignatureParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -1830,57 +1502,24 @@ class AnalysisGetSignatureParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalysisGetSignatureResult implements ResponseResult { - String _name; - - List _parameters; - - String _dartdoc; - /// The name of the function being invoked at the given offset. - String get name => _name; - - /// The name of the function being invoked at the given offset. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// A list of information about each of the parameters of the function being /// invoked. - List get parameters => _parameters; - - /// A list of information about each of the parameters of the function being - /// invoked. - set parameters(List value) { - assert(value != null); - _parameters = value; - } + List parameters; /// The dartdoc associated with the function being invoked. Other than the /// removal of the comment delimiters, including leading asterisks in the /// case of a block comment, the dartdoc is unprocessed markdown. This data /// is omitted if there is no referenced element, or if the element has no /// dartdoc. - String get dartdoc => _dartdoc; + String? dartdoc; - /// The dartdoc associated with the function being invoked. Other than the - /// removal of the comment delimiters, including leading asterisks in the - /// case of a block comment, the dartdoc is unprocessed markdown. This data - /// is omitted if there is no referenced element, or if the element has no - /// dartdoc. - set dartdoc(String value) { - _dartdoc = value; - } - - AnalysisGetSignatureResult(String name, List parameters, - {String dartdoc}) { - this.name = name; - this.parameters = parameters; - this.dartdoc = dartdoc; - } + AnalysisGetSignatureResult(this.name, this.parameters, {this.dartdoc}); factory AnalysisGetSignatureResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -1894,12 +1533,12 @@ class AnalysisGetSignatureResult implements ResponseResult { parameters = jsonDecoder.decodeList( jsonPath + '.parameters', json['parameters'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ParameterInfo.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'parameters'); } - String dartdoc; + String? dartdoc; if (json.containsKey('dartdoc')) { dartdoc = jsonDecoder.decodeString(jsonPath + '.dartdoc', json['dartdoc']); @@ -1919,11 +1558,12 @@ class AnalysisGetSignatureResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['parameters'] = parameters.map((ParameterInfo value) => value.toJson()).toList(); + var dartdoc = this.dartdoc; if (dartdoc != null) { result['dartdoc'] = dartdoc; } @@ -1968,43 +1608,20 @@ class AnalysisGetSignatureResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisHighlightsParams implements HasToJson { - String _file; - - List _regions; - /// The file containing the highlight regions. - String get file => _file; - - /// The file containing the highlight regions. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The highlight regions contained in the file. Each highlight region /// represents a particular syntactic or semantic meaning associated with /// some range. Note that the highlight regions that are returned can overlap /// other highlight regions if there is more than one meaning associated with /// a particular region. - List get regions => _regions; + List regions; - /// The highlight regions contained in the file. Each highlight region - /// represents a particular syntactic or semantic meaning associated with - /// some range. Note that the highlight regions that are returned can overlap - /// other highlight regions if there is more than one meaning associated with - /// a particular region. - set regions(List value) { - assert(value != null); - _regions = value; - } - - AnalysisHighlightsParams(String file, List regions) { - this.file = file; - this.regions = regions; - } + AnalysisHighlightsParams(this.file, this.regions); factory AnalysisHighlightsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2018,7 +1635,7 @@ class AnalysisHighlightsParams implements HasToJson { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => HighlightRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -2035,8 +1652,8 @@ class AnalysisHighlightsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['regions'] = regions.map((HighlightRegion value) => value.toJson()).toList(); @@ -2079,48 +1696,19 @@ class AnalysisHighlightsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisImplementedParams implements HasToJson { - String _file; - - List _classes; - - List _members; - /// The file with which the implementations are associated. - String get file => _file; - - /// The file with which the implementations are associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The classes defined in the file that are implemented or extended. - List get classes => _classes; - - /// The classes defined in the file that are implemented or extended. - set classes(List value) { - assert(value != null); - _classes = value; - } + List classes; /// The member defined in the file that are implemented or overridden. - List get members => _members; + List members; - /// The member defined in the file that are implemented or overridden. - set members(List value) { - assert(value != null); - _members = value; - } - - AnalysisImplementedParams(String file, List classes, - List members) { - this.file = file; - this.classes = classes; - this.members = members; - } + AnalysisImplementedParams(this.file, this.classes, this.members); factory AnalysisImplementedParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2134,7 +1722,7 @@ class AnalysisImplementedParams implements HasToJson { classes = jsonDecoder.decodeList( jsonPath + '.classes', json['classes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImplementedClass.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'classes'); @@ -2144,7 +1732,7 @@ class AnalysisImplementedParams implements HasToJson { members = jsonDecoder.decodeList( jsonPath + '.members', json['members'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImplementedMember.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'members'); @@ -2162,8 +1750,8 @@ class AnalysisImplementedParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['classes'] = classes.map((ImplementedClass value) => value.toJson()).toList(); @@ -2212,63 +1800,24 @@ class AnalysisImplementedParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisInvalidateParams implements HasToJson { - String _file; - - int _offset; - - int _length; - - int _delta; - /// The file whose information has been invalidated. - String get file => _file; - - /// The file whose information has been invalidated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the invalidated region. - int get offset => _offset; - - /// The offset of the invalidated region. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the invalidated region. - int get length => _length; - - /// The length of the invalidated region. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The delta to be applied to the offsets in information that follows the /// invalidated region in order to update it so that it doesn't need to be /// re-requested. - int get delta => _delta; + int delta; - /// The delta to be applied to the offsets in information that follows the - /// invalidated region in order to update it so that it doesn't need to be - /// re-requested. - set delta(int value) { - assert(value != null); - _delta = value; - } - - AnalysisInvalidateParams(String file, int offset, int length, int delta) { - this.file = file; - this.offset = offset; - this.length = length; - this.delta = delta; - } + AnalysisInvalidateParams(this.file, this.offset, this.length, this.delta); factory AnalysisInvalidateParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2307,8 +1856,8 @@ class AnalysisInvalidateParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -2356,22 +1905,8 @@ class AnalysisInvalidateParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisNavigationParams implements HasToJson { - String _file; - - List _regions; - - List _targets; - - List _files; - /// The file containing the navigation regions. - String get file => _file; - - /// The file containing the navigation regions. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The navigation regions contained in the file. The regions are sorted by /// their offsets. Each navigation region represents a list of targets @@ -2380,52 +1915,20 @@ class AnalysisNavigationParams implements HasToJson { /// multiple libraries or in Dart code that is compiled against multiple /// versions of a package. Note that the navigation regions that are returned /// do not overlap other navigation regions. - List get regions => _regions; - - /// The navigation regions contained in the file. The regions are sorted by - /// their offsets. Each navigation region represents a list of targets - /// associated with some range. The lists will usually contain a single - /// target, but can contain more in the case of a part that is included in - /// multiple libraries or in Dart code that is compiled against multiple - /// versions of a package. Note that the navigation regions that are returned - /// do not overlap other navigation regions. - set regions(List value) { - assert(value != null); - _regions = value; - } + List regions; /// The navigation targets referenced in the file. They are referenced by /// NavigationRegions by their index in this array. - List get targets => _targets; - - /// The navigation targets referenced in the file. They are referenced by - /// NavigationRegions by their index in this array. - set targets(List value) { - assert(value != null); - _targets = value; - } + List targets; /// The files containing navigation targets referenced in the file. They are /// referenced by NavigationTargets by their index in this array. - List get files => _files; + List files; - /// The files containing navigation targets referenced in the file. They are - /// referenced by NavigationTargets by their index in this array. - set files(List value) { - assert(value != null); - _files = value; - } - - AnalysisNavigationParams(String file, List regions, - List targets, List files) { - this.file = file; - this.regions = regions; - this.targets = targets; - this.files = files; - } + AnalysisNavigationParams(this.file, this.regions, this.targets, this.files); factory AnalysisNavigationParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2439,7 +1942,7 @@ class AnalysisNavigationParams implements HasToJson { regions = jsonDecoder.decodeList( jsonPath + '.regions', json['regions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationRegion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'regions'); @@ -2449,7 +1952,7 @@ class AnalysisNavigationParams implements HasToJson { targets = jsonDecoder.decodeList( jsonPath + '.targets', json['targets'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => NavigationTarget.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'targets'); @@ -2473,8 +1976,8 @@ class AnalysisNavigationParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['regions'] = regions.map((NavigationRegion value) => value.toJson()).toList(); @@ -2524,35 +2027,16 @@ class AnalysisNavigationParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOccurrencesParams implements HasToJson { - String _file; - - List _occurrences; - /// The file in which the references occur. - String get file => _file; - - /// The file in which the references occur. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The occurrences of references to elements within the file. - List get occurrences => _occurrences; + List occurrences; - /// The occurrences of references to elements within the file. - set occurrences(List value) { - assert(value != null); - _occurrences = value; - } - - AnalysisOccurrencesParams(String file, List occurrences) { - this.file = file; - this.occurrences = occurrences; - } + AnalysisOccurrencesParams(this.file, this.occurrences); factory AnalysisOccurrencesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2566,7 +2050,7 @@ class AnalysisOccurrencesParams implements HasToJson { occurrences = jsonDecoder.decodeList( jsonPath + '.occurrences', json['occurrences'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Occurrences.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'occurrences'); @@ -2584,8 +2068,8 @@ class AnalysisOccurrencesParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['occurrences'] = occurrences.map((Occurrences value) => value.toJson()).toList(); @@ -2633,176 +2117,96 @@ class AnalysisOccurrencesParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOptions implements HasToJson { - bool _enableAsync; - - bool _enableDeferredLoading; - - bool _enableEnums; - - bool _enableNullAwareOperators; - - bool _enableSuperMixins; - - bool _generateDart2jsHints; - - bool _generateHints; - - bool _generateLints; - /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed async /// feature. - bool get enableAsync => _enableAsync; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed async - /// feature. - set enableAsync(bool value) { - _enableAsync = value; - } + bool? enableAsync; /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed deferred /// loading feature. - bool get enableDeferredLoading => _enableDeferredLoading; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed deferred - /// loading feature. - set enableDeferredLoading(bool value) { - _enableDeferredLoading = value; - } + bool? enableDeferredLoading; /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed enum feature. - bool get enableEnums => _enableEnums; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed enum feature. - set enableEnums(bool value) { - _enableEnums = value; - } + bool? enableEnums; /// Deprecated: this feature is always enabled. /// /// True if the client wants to enable support for the proposed "null aware /// operators" feature. - bool get enableNullAwareOperators => _enableNullAwareOperators; - - /// Deprecated: this feature is always enabled. - /// - /// True if the client wants to enable support for the proposed "null aware - /// operators" feature. - set enableNullAwareOperators(bool value) { - _enableNullAwareOperators = value; - } + bool? enableNullAwareOperators; /// True if the client wants to enable support for the proposed "less /// restricted mixins" proposal (DEP 34). - bool get enableSuperMixins => _enableSuperMixins; - - /// True if the client wants to enable support for the proposed "less - /// restricted mixins" proposal (DEP 34). - set enableSuperMixins(bool value) { - _enableSuperMixins = value; - } + bool? enableSuperMixins; /// True if hints that are specific to dart2js should be generated. This /// option is ignored if generateHints is false. - bool get generateDart2jsHints => _generateDart2jsHints; - - /// True if hints that are specific to dart2js should be generated. This - /// option is ignored if generateHints is false. - set generateDart2jsHints(bool value) { - _generateDart2jsHints = value; - } + bool? generateDart2jsHints; /// True if hints should be generated as part of generating errors and /// warnings. - bool get generateHints => _generateHints; - - /// True if hints should be generated as part of generating errors and - /// warnings. - set generateHints(bool value) { - _generateHints = value; - } + bool? generateHints; /// True if lints should be generated as part of generating errors and /// warnings. - bool get generateLints => _generateLints; - - /// True if lints should be generated as part of generating errors and - /// warnings. - set generateLints(bool value) { - _generateLints = value; - } + bool? generateLints; AnalysisOptions( - {bool enableAsync, - bool enableDeferredLoading, - bool enableEnums, - bool enableNullAwareOperators, - bool enableSuperMixins, - bool generateDart2jsHints, - bool generateHints, - bool generateLints}) { - this.enableAsync = enableAsync; - this.enableDeferredLoading = enableDeferredLoading; - this.enableEnums = enableEnums; - this.enableNullAwareOperators = enableNullAwareOperators; - this.enableSuperMixins = enableSuperMixins; - this.generateDart2jsHints = generateDart2jsHints; - this.generateHints = generateHints; - this.generateLints = generateLints; - } + {this.enableAsync, + this.enableDeferredLoading, + this.enableEnums, + this.enableNullAwareOperators, + this.enableSuperMixins, + this.generateDart2jsHints, + this.generateHints, + this.generateLints}); factory AnalysisOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - bool enableAsync; + bool? enableAsync; if (json.containsKey('enableAsync')) { enableAsync = jsonDecoder.decodeBool( jsonPath + '.enableAsync', json['enableAsync']); } - bool enableDeferredLoading; + bool? enableDeferredLoading; if (json.containsKey('enableDeferredLoading')) { enableDeferredLoading = jsonDecoder.decodeBool( jsonPath + '.enableDeferredLoading', json['enableDeferredLoading']); } - bool enableEnums; + bool? enableEnums; if (json.containsKey('enableEnums')) { enableEnums = jsonDecoder.decodeBool( jsonPath + '.enableEnums', json['enableEnums']); } - bool enableNullAwareOperators; + bool? enableNullAwareOperators; if (json.containsKey('enableNullAwareOperators')) { enableNullAwareOperators = jsonDecoder.decodeBool( jsonPath + '.enableNullAwareOperators', json['enableNullAwareOperators']); } - bool enableSuperMixins; + bool? enableSuperMixins; if (json.containsKey('enableSuperMixins')) { enableSuperMixins = jsonDecoder.decodeBool( jsonPath + '.enableSuperMixins', json['enableSuperMixins']); } - bool generateDart2jsHints; + bool? generateDart2jsHints; if (json.containsKey('generateDart2jsHints')) { generateDart2jsHints = jsonDecoder.decodeBool( jsonPath + '.generateDart2jsHints', json['generateDart2jsHints']); } - bool generateHints; + bool? generateHints; if (json.containsKey('generateHints')) { generateHints = jsonDecoder.decodeBool( jsonPath + '.generateHints', json['generateHints']); } - bool generateLints; + bool? generateLints; if (json.containsKey('generateLints')) { generateLints = jsonDecoder.decodeBool( jsonPath + '.generateLints', json['generateLints']); @@ -2822,29 +2226,37 @@ class AnalysisOptions implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var enableAsync = this.enableAsync; if (enableAsync != null) { result['enableAsync'] = enableAsync; } + var enableDeferredLoading = this.enableDeferredLoading; if (enableDeferredLoading != null) { result['enableDeferredLoading'] = enableDeferredLoading; } + var enableEnums = this.enableEnums; if (enableEnums != null) { result['enableEnums'] = enableEnums; } + var enableNullAwareOperators = this.enableNullAwareOperators; if (enableNullAwareOperators != null) { result['enableNullAwareOperators'] = enableNullAwareOperators; } + var enableSuperMixins = this.enableSuperMixins; if (enableSuperMixins != null) { result['enableSuperMixins'] = enableSuperMixins; } + var generateDart2jsHints = this.generateDart2jsHints; if (generateDart2jsHints != null) { result['generateDart2jsHints'] = generateDart2jsHints; } + var generateHints = this.generateHints; if (generateHints != null) { result['generateHints'] = generateHints; } + var generateLints = this.generateLints; if (generateLints != null) { result['generateLints'] = generateLints; } @@ -2895,67 +2307,26 @@ class AnalysisOptions implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOutlineParams implements HasToJson { - String _file; - - FileKind _kind; - - String _libraryName; - - Outline _outline; - /// The file with which the outline is associated. - String get file => _file; - - /// The file with which the outline is associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The kind of the file. - FileKind get kind => _kind; - - /// The kind of the file. - set kind(FileKind value) { - assert(value != null); - _kind = value; - } + FileKind kind; /// The name of the library defined by the file using a "library" directive, /// or referenced by a "part of" directive. If both "library" and "part of" /// directives are present, then the "library" directive takes precedence. /// This field will be omitted if the file has neither "library" nor "part /// of" directives. - String get libraryName => _libraryName; - - /// The name of the library defined by the file using a "library" directive, - /// or referenced by a "part of" directive. If both "library" and "part of" - /// directives are present, then the "library" directive takes precedence. - /// This field will be omitted if the file has neither "library" nor "part - /// of" directives. - set libraryName(String value) { - _libraryName = value; - } + String? libraryName; /// The outline associated with the file. - Outline get outline => _outline; + Outline outline; - /// The outline associated with the file. - set outline(Outline value) { - assert(value != null); - _outline = value; - } - - AnalysisOutlineParams(String file, FileKind kind, Outline outline, - {String libraryName}) { - this.file = file; - this.kind = kind; - this.libraryName = libraryName; - this.outline = outline; - } + AnalysisOutlineParams(this.file, this.kind, this.outline, {this.libraryName}); factory AnalysisOutlineParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -2970,7 +2341,7 @@ class AnalysisOutlineParams implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'kind'); } - String libraryName; + String? libraryName; if (json.containsKey('libraryName')) { libraryName = jsonDecoder.decodeString( jsonPath + '.libraryName', json['libraryName']); @@ -2995,10 +2366,11 @@ class AnalysisOutlineParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['kind'] = kind.toJson(); + var libraryName = this.libraryName; if (libraryName != null) { result['libraryName'] = libraryName; } @@ -3044,35 +2416,16 @@ class AnalysisOutlineParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisOverridesParams implements HasToJson { - String _file; - - List _overrides; - /// The file with which the overrides are associated. - String get file => _file; - - /// The file with which the overrides are associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The overrides associated with the file. - List get overrides => _overrides; + List overrides; - /// The overrides associated with the file. - set overrides(List value) { - assert(value != null); - _overrides = value; - } - - AnalysisOverridesParams(String file, List overrides) { - this.file = file; - this.overrides = overrides; - } + AnalysisOverridesParams(this.file, this.overrides); factory AnalysisOverridesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -3086,7 +2439,7 @@ class AnalysisOverridesParams implements HasToJson { overrides = jsonDecoder.decodeList( jsonPath + '.overrides', json['overrides'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Override.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'overrides'); @@ -3103,8 +2456,8 @@ class AnalysisOverridesParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['overrides'] = overrides.map((Override value) => value.toJson()).toList(); @@ -3142,7 +2495,7 @@ class AnalysisOverridesParams implements HasToJson { /// Clients may not extend, implement or mix-in this class. class AnalysisReanalyzeParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -3168,7 +2521,7 @@ class AnalysisReanalyzeParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisReanalyzeResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3269,7 +2622,7 @@ class AnalysisService implements Enum { } factory AnalysisService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return AnalysisService(json); @@ -3296,31 +2649,12 @@ class AnalysisService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetAnalysisRootsParams implements RequestParams { - List _included; - - List _excluded; - - Map _packageRoots; - /// A list of the files and directories that should be analyzed. - List get included => _included; - - /// A list of the files and directories that should be analyzed. - set included(List value) { - assert(value != null); - _included = value; - } + List included; /// A list of the files and directories within the included directories that /// should not be analyzed. - List get excluded => _excluded; - - /// A list of the files and directories within the included directories that - /// should not be analyzed. - set excluded(List value) { - assert(value != null); - _excluded = value; - } + List excluded; /// A mapping from source directories to package roots that should override /// the normal package: URI resolution mechanism. @@ -3334,33 +2668,13 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { /// their package: URI's resolved using the normal pubspec.yaml mechanism. If /// this field is absent, or the empty map is specified, that indicates that /// the normal pubspec.yaml mechanism should always be used. - Map get packageRoots => _packageRoots; + Map? packageRoots; - /// A mapping from source directories to package roots that should override - /// the normal package: URI resolution mechanism. - /// - /// If a package root is a file, then the analyzer will behave as though that - /// file is a ".packages" file in the source directory. The effect is the - /// same as specifying the file as a "--packages" parameter to the Dart VM - /// when executing any Dart file inside the source directory. - /// - /// Files in any directories that are not overridden by this mapping have - /// their package: URI's resolved using the normal pubspec.yaml mechanism. If - /// this field is absent, or the empty map is specified, that indicates that - /// the normal pubspec.yaml mechanism should always be used. - set packageRoots(Map value) { - _packageRoots = value; - } - - AnalysisSetAnalysisRootsParams(List included, List excluded, - {Map packageRoots}) { - this.included = included; - this.excluded = excluded; - this.packageRoots = packageRoots; - } + AnalysisSetAnalysisRootsParams(this.included, this.excluded, + {this.packageRoots}); factory AnalysisSetAnalysisRootsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List included; @@ -3377,7 +2691,7 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'excluded'); } - Map packageRoots; + Map? packageRoots; if (json.containsKey('packageRoots')) { packageRoots = jsonDecoder.decodeMap( jsonPath + '.packageRoots', json['packageRoots'], @@ -3397,10 +2711,11 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['included'] = included; result['excluded'] = excluded; + var packageRoots = this.packageRoots; if (packageRoots != null) { result['packageRoots'] = packageRoots; } @@ -3442,7 +2757,7 @@ class AnalysisSetAnalysisRootsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetAnalysisRootsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3471,24 +2786,13 @@ class AnalysisSetAnalysisRootsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetGeneralSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - AnalysisSetGeneralSubscriptionsParams( - List subscriptions) { - this.subscriptions = subscriptions; - } + AnalysisSetGeneralSubscriptionsParams(this.subscriptions); factory AnalysisSetGeneralSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -3496,7 +2800,7 @@ class AnalysisSetGeneralSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => GeneralAnalysisService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -3514,8 +2818,8 @@ class AnalysisSetGeneralSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions .map((GeneralAnalysisService value) => value.toJson()) .toList(); @@ -3552,7 +2856,7 @@ class AnalysisSetGeneralSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetGeneralSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3581,23 +2885,13 @@ class AnalysisSetGeneralSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetPriorityFilesParams implements RequestParams { - List _files; - /// The files that are to be a priority for analysis. - List get files => _files; + List files; - /// The files that are to be a priority for analysis. - set files(List value) { - assert(value != null); - _files = value; - } - - AnalysisSetPriorityFilesParams(List files) { - this.files = files; - } + AnalysisSetPriorityFilesParams(this.files); factory AnalysisSetPriorityFilesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List files; @@ -3620,8 +2914,8 @@ class AnalysisSetPriorityFilesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = files; return result; } @@ -3655,7 +2949,7 @@ class AnalysisSetPriorityFilesParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetPriorityFilesResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3684,35 +2978,23 @@ class AnalysisSetPriorityFilesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisSetSubscriptionsParams implements RequestParams { - Map> _subscriptions; - /// A table mapping services to a list of the files being subscribed to the /// service. - Map> get subscriptions => _subscriptions; + Map> subscriptions; - /// A table mapping services to a list of the files being subscribed to the - /// service. - set subscriptions(Map> value) { - assert(value != null); - _subscriptions = value; - } - - AnalysisSetSubscriptionsParams( - Map> subscriptions) { - this.subscriptions = subscriptions; - } + AnalysisSetSubscriptionsParams(this.subscriptions); factory AnalysisSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map> subscriptions; if (json.containsKey('subscriptions')) { subscriptions = jsonDecoder.decodeMap( jsonPath + '.subscriptions', json['subscriptions'], - keyDecoder: (String jsonPath, Object json) => + keyDecoder: (String jsonPath, Object? json) => AnalysisService.fromJson(jsonDecoder, jsonPath, json), - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -3730,8 +3012,8 @@ class AnalysisSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = mapMap(subscriptions, keyCallback: (AnalysisService value) => value.toJson()); return result; @@ -3770,7 +3052,7 @@ class AnalysisSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -3800,36 +3082,17 @@ class AnalysisSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisStatus implements HasToJson { - bool _isAnalyzing; - - String _analysisTarget; - /// True if analysis is currently being performed. - bool get isAnalyzing => _isAnalyzing; - - /// True if analysis is currently being performed. - set isAnalyzing(bool value) { - assert(value != null); - _isAnalyzing = value; - } + bool isAnalyzing; /// The name of the current target of analysis. This field is omitted if /// analyzing is false. - String get analysisTarget => _analysisTarget; + String? analysisTarget; - /// The name of the current target of analysis. This field is omitted if - /// analyzing is false. - set analysisTarget(String value) { - _analysisTarget = value; - } - - AnalysisStatus(bool isAnalyzing, {String analysisTarget}) { - this.isAnalyzing = isAnalyzing; - this.analysisTarget = analysisTarget; - } + AnalysisStatus(this.isAnalyzing, {this.analysisTarget}); factory AnalysisStatus.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool isAnalyzing; @@ -3839,7 +3102,7 @@ class AnalysisStatus implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'isAnalyzing'); } - String analysisTarget; + String? analysisTarget; if (json.containsKey('analysisTarget')) { analysisTarget = jsonDecoder.decodeString( jsonPath + '.analysisTarget', json['analysisTarget']); @@ -3851,9 +3114,10 @@ class AnalysisStatus implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['isAnalyzing'] = isAnalyzing; + var analysisTarget = this.analysisTarget; if (analysisTarget != null) { result['analysisTarget'] = analysisTarget; } @@ -3889,38 +3153,27 @@ class AnalysisStatus implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AnalysisUpdateContentParams implements RequestParams { - Map _files; - /// A table mapping the files whose content has changed to a description of /// the content change. - Map get files => _files; + Map files; - /// A table mapping the files whose content has changed to a description of - /// the content change. - set files(Map value) { - assert(value != null); - _files = value; - } - - AnalysisUpdateContentParams(Map files) { - this.files = files; - } + AnalysisUpdateContentParams(this.files); factory AnalysisUpdateContentParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map files; if (json.containsKey('files')) { files = jsonDecoder.decodeMap(jsonPath + '.files', json['files'], - valueDecoder: (String jsonPath, Object json) => + valueDecoder: (String jsonPath, Object? json) => jsonDecoder.decodeUnion(jsonPath, json, 'type', { - 'add': (String jsonPath, Object json) => + 'add': (String jsonPath, Object? json) => AddContentOverlay.fromJson(jsonDecoder, jsonPath, json), - 'change': (String jsonPath, Object json) => + 'change': (String jsonPath, Object? json) => ChangeContentOverlay.fromJson( jsonDecoder, jsonPath, json), - 'remove': (String jsonPath, Object json) => + 'remove': (String jsonPath, Object? json) => RemoveContentOverlay.fromJson(jsonDecoder, jsonPath, json) })); } else { @@ -3939,8 +3192,8 @@ class AnalysisUpdateContentParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['files'] = mapMap(files, valueCallback: (dynamic value) => value.toJson()); return result; @@ -3980,7 +3233,7 @@ class AnalysisUpdateContentResult implements ResponseResult { AnalysisUpdateContentResult(); factory AnalysisUpdateContentResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { return AnalysisUpdateContentResult(); @@ -3998,8 +3251,8 @@ class AnalysisUpdateContentResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -4034,23 +3287,13 @@ class AnalysisUpdateContentResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalysisUpdateOptionsParams implements RequestParams { - AnalysisOptions _options; - /// The options that are to be used to control analysis. - AnalysisOptions get options => _options; + AnalysisOptions options; - /// The options that are to be used to control analysis. - set options(AnalysisOptions value) { - assert(value != null); - _options = value; - } - - AnalysisUpdateOptionsParams(AnalysisOptions options) { - this.options = options; - } + AnalysisUpdateOptionsParams(this.options); factory AnalysisUpdateOptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { AnalysisOptions options; @@ -4073,8 +3316,8 @@ class AnalysisUpdateOptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['options'] = options.toJson(); return result; } @@ -4108,7 +3351,7 @@ class AnalysisUpdateOptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalysisUpdateOptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4137,23 +3380,13 @@ class AnalysisUpdateOptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsEnableParams implements RequestParams { - bool _value; - /// Enable or disable analytics. - bool get value => _value; + bool value; - /// Enable or disable analytics. - set value(bool value) { - assert(value != null); - _value = value; - } - - AnalyticsEnableParams(bool value) { - this.value = value; - } + AnalyticsEnableParams(this.value); factory AnalyticsEnableParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool value; @@ -4174,8 +3407,8 @@ class AnalyticsEnableParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['value'] = value; return result; } @@ -4209,7 +3442,7 @@ class AnalyticsEnableParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalyticsEnableResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4235,7 +3468,7 @@ class AnalyticsEnableResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class AnalyticsIsEnabledParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -4264,23 +3497,13 @@ class AnalyticsIsEnabledParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsIsEnabledResult implements ResponseResult { - bool _enabled; - /// Whether sending analytics is enabled or not. - bool get enabled => _enabled; + bool enabled; - /// Whether sending analytics is enabled or not. - set enabled(bool value) { - assert(value != null); - _enabled = value; - } - - AnalyticsIsEnabledResult(bool enabled) { - this.enabled = enabled; - } + AnalyticsIsEnabledResult(this.enabled); factory AnalyticsIsEnabledResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool enabled; @@ -4304,8 +3527,8 @@ class AnalyticsIsEnabledResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['enabled'] = enabled; return result; } @@ -4342,23 +3565,13 @@ class AnalyticsIsEnabledResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsSendEventParams implements RequestParams { - String _action; - /// The value used to indicate which action was performed. - String get action => _action; + String action; - /// The value used to indicate which action was performed. - set action(String value) { - assert(value != null); - _action = value; - } - - AnalyticsSendEventParams(String action) { - this.action = action; - } + AnalyticsSendEventParams(this.action); factory AnalyticsSendEventParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String action; @@ -4379,8 +3592,8 @@ class AnalyticsSendEventParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['action'] = action; return result; } @@ -4414,7 +3627,7 @@ class AnalyticsSendEventParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalyticsSendEventResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4444,35 +3657,16 @@ class AnalyticsSendEventResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AnalyticsSendTimingParams implements RequestParams { - String _event; - - int _millis; - /// The name of the event. - String get event => _event; - - /// The name of the event. - set event(String value) { - assert(value != null); - _event = value; - } + String event; /// The duration of the event in milliseconds. - int get millis => _millis; + int millis; - /// The duration of the event in milliseconds. - set millis(int value) { - assert(value != null); - _millis = value; - } - - AnalyticsSendTimingParams(String event, int millis) { - this.event = event; - this.millis = millis; - } + AnalyticsSendTimingParams(this.event, this.millis); factory AnalyticsSendTimingParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String event; @@ -4499,8 +3693,8 @@ class AnalyticsSendTimingParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['event'] = event; result['millis'] = millis; return result; @@ -4536,7 +3730,7 @@ class AnalyticsSendTimingParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class AnalyticsSendTimingResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -4573,62 +3767,19 @@ class AnalyticsSendTimingResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class AvailableSuggestion implements HasToJson { - String _label; - - String _declaringLibraryUri; - - Element _element; - - String _defaultArgumentListString; - - List _defaultArgumentListTextRanges; - - List _parameterNames; - - List _parameterTypes; - - List _relevanceTags; - - int _requiredParameterCount; - /// The identifier to present to the user for code completion. - String get label => _label; - - /// The identifier to present to the user for code completion. - set label(String value) { - assert(value != null); - _label = value; - } + String label; /// The URI of the library that declares the element being suggested, not the /// URI of the library associated with the enclosing AvailableSuggestionSet. - String get declaringLibraryUri => _declaringLibraryUri; - - /// The URI of the library that declares the element being suggested, not the - /// URI of the library associated with the enclosing AvailableSuggestionSet. - set declaringLibraryUri(String value) { - assert(value != null); - _declaringLibraryUri = value; - } + String declaringLibraryUri; /// Information about the element reference being suggested. - Element get element => _element; - - /// Information about the element reference being suggested. - set element(Element value) { - assert(value != null); - _element = value; - } + Element element; /// A default String for use in generating argument list source contents on /// the client side. - String get defaultArgumentListString => _defaultArgumentListString; - - /// A default String for use in generating argument list source contents on - /// the client side. - set defaultArgumentListString(String value) { - _defaultArgumentListString = value; - } + String? defaultArgumentListString; /// Pairs of offsets and lengths describing 'defaultArgumentListString' text /// ranges suitable for use by clients to set up linked edits of default @@ -4636,80 +3787,35 @@ class AvailableSuggestion implements HasToJson { /// y', the corresponding text range [0, 1, 3, 1], indicates two text ranges /// of length 1, starting at offsets 0 and 3. Clients can use these ranges to /// treat the 'x' and 'y' values specially for linked edits. - List get defaultArgumentListTextRanges => _defaultArgumentListTextRanges; - - /// Pairs of offsets and lengths describing 'defaultArgumentListString' text - /// ranges suitable for use by clients to set up linked edits of default - /// argument source contents. For example, given an argument list string 'x, - /// y', the corresponding text range [0, 1, 3, 1], indicates two text ranges - /// of length 1, starting at offsets 0 and 3. Clients can use these ranges to - /// treat the 'x' and 'y' values specially for linked edits. - set defaultArgumentListTextRanges(List value) { - _defaultArgumentListTextRanges = value; - } + List? defaultArgumentListTextRanges; /// If the element is an executable, the names of the formal parameters of /// all kinds - required, optional positional, and optional named. The names /// of positional parameters are empty strings. Omitted if the element is not /// an executable. - List get parameterNames => _parameterNames; - - /// If the element is an executable, the names of the formal parameters of - /// all kinds - required, optional positional, and optional named. The names - /// of positional parameters are empty strings. Omitted if the element is not - /// an executable. - set parameterNames(List value) { - _parameterNames = value; - } + List? parameterNames; /// If the element is an executable, the declared types of the formal /// parameters of all kinds - required, optional positional, and optional /// named. Omitted if the element is not an executable. - List get parameterTypes => _parameterTypes; - - /// If the element is an executable, the declared types of the formal - /// parameters of all kinds - required, optional positional, and optional - /// named. Omitted if the element is not an executable. - set parameterTypes(List value) { - _parameterTypes = value; - } + List? parameterTypes; /// This field is set if the relevance of this suggestion might be changed /// depending on where completion is requested. - List get relevanceTags => _relevanceTags; + List? relevanceTags; - /// This field is set if the relevance of this suggestion might be changed - /// depending on where completion is requested. - set relevanceTags(List value) { - _relevanceTags = value; - } + int? requiredParameterCount; - int get requiredParameterCount => _requiredParameterCount; - - set requiredParameterCount(int value) { - _requiredParameterCount = value; - } - - AvailableSuggestion(String label, String declaringLibraryUri, Element element, - {String defaultArgumentListString, - List defaultArgumentListTextRanges, - List parameterNames, - List parameterTypes, - List relevanceTags, - int requiredParameterCount}) { - this.label = label; - this.declaringLibraryUri = declaringLibraryUri; - this.element = element; - this.defaultArgumentListString = defaultArgumentListString; - this.defaultArgumentListTextRanges = defaultArgumentListTextRanges; - this.parameterNames = parameterNames; - this.parameterTypes = parameterTypes; - this.relevanceTags = relevanceTags; - this.requiredParameterCount = requiredParameterCount; - } + AvailableSuggestion(this.label, this.declaringLibraryUri, this.element, + {this.defaultArgumentListString, + this.defaultArgumentListTextRanges, + this.parameterNames, + this.parameterTypes, + this.relevanceTags, + this.requiredParameterCount}); factory AvailableSuggestion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String label; @@ -4732,35 +3838,35 @@ class AvailableSuggestion implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'element'); } - String defaultArgumentListString; + String? defaultArgumentListString; if (json.containsKey('defaultArgumentListString')) { defaultArgumentListString = jsonDecoder.decodeString( jsonPath + '.defaultArgumentListString', json['defaultArgumentListString']); } - List defaultArgumentListTextRanges; + List? defaultArgumentListTextRanges; if (json.containsKey('defaultArgumentListTextRanges')) { defaultArgumentListTextRanges = jsonDecoder.decodeList( jsonPath + '.defaultArgumentListTextRanges', json['defaultArgumentListTextRanges'], jsonDecoder.decodeInt); } - List parameterNames; + List? parameterNames; if (json.containsKey('parameterNames')) { parameterNames = jsonDecoder.decodeList(jsonPath + '.parameterNames', json['parameterNames'], jsonDecoder.decodeString); } - List parameterTypes; + List? parameterTypes; if (json.containsKey('parameterTypes')) { parameterTypes = jsonDecoder.decodeList(jsonPath + '.parameterTypes', json['parameterTypes'], jsonDecoder.decodeString); } - List relevanceTags; + List? relevanceTags; if (json.containsKey('relevanceTags')) { relevanceTags = jsonDecoder.decodeList(jsonPath + '.relevanceTags', json['relevanceTags'], jsonDecoder.decodeString); } - int requiredParameterCount; + int? requiredParameterCount; if (json.containsKey('requiredParameterCount')) { requiredParameterCount = jsonDecoder.decodeInt( jsonPath + '.requiredParameterCount', @@ -4779,26 +3885,32 @@ class AvailableSuggestion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['label'] = label; result['declaringLibraryUri'] = declaringLibraryUri; result['element'] = element.toJson(); + var defaultArgumentListString = this.defaultArgumentListString; if (defaultArgumentListString != null) { result['defaultArgumentListString'] = defaultArgumentListString; } + var defaultArgumentListTextRanges = this.defaultArgumentListTextRanges; if (defaultArgumentListTextRanges != null) { result['defaultArgumentListTextRanges'] = defaultArgumentListTextRanges; } + var parameterNames = this.parameterNames; if (parameterNames != null) { result['parameterNames'] = parameterNames; } + var parameterTypes = this.parameterTypes; if (parameterTypes != null) { result['parameterTypes'] = parameterTypes; } + var relevanceTags = this.relevanceTags; if (relevanceTags != null) { result['relevanceTags'] = relevanceTags; } + var requiredParameterCount = this.requiredParameterCount; if (requiredParameterCount != null) { result['requiredParameterCount'] = requiredParameterCount; } @@ -4854,45 +3966,18 @@ class AvailableSuggestion implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class AvailableSuggestionSet implements HasToJson { - int _id; - - String _uri; - - List _items; - /// The id associated with the library. - int get id => _id; - - /// The id associated with the library. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The URI of the library. - String get uri => _uri; + String uri; - /// The URI of the library. - set uri(String value) { - assert(value != null); - _uri = value; - } + List items; - List get items => _items; - - set items(List value) { - assert(value != null); - _items = value; - } - - AvailableSuggestionSet(int id, String uri, List items) { - this.id = id; - this.uri = uri; - this.items = items; - } + AvailableSuggestionSet(this.id, this.uri, this.items); factory AvailableSuggestionSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int id; @@ -4912,7 +3997,7 @@ class AvailableSuggestionSet implements HasToJson { items = jsonDecoder.decodeList( jsonPath + '.items', json['items'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AvailableSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'items'); @@ -4924,8 +4009,8 @@ class AvailableSuggestionSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['uri'] = uri; result['items'] = @@ -4966,35 +4051,16 @@ class AvailableSuggestionSet implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class BulkFix implements HasToJson { - String _path; - - List _fixes; - /// The path of the library. - String get path => _path; - - /// The path of the library. - set path(String value) { - assert(value != null); - _path = value; - } + String path; /// A list of bulk fix details. - List get fixes => _fixes; + List fixes; - /// A list of bulk fix details. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - BulkFix(String path, List fixes) { - this.path = path; - this.fixes = fixes; - } + BulkFix(this.path, this.fixes); factory BulkFix.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String path; @@ -5008,7 +4074,7 @@ class BulkFix implements HasToJson { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => BulkFixDetail.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -5020,8 +4086,8 @@ class BulkFix implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['path'] = path; result['fixes'] = fixes.map((BulkFixDetail value) => value.toJson()).toList(); @@ -5059,37 +4125,17 @@ class BulkFix implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class BulkFixDetail implements HasToJson { - String _code; - - int _occurrences; - /// The code of the diagnostic associated with the fix. - String get code => _code; - - /// The code of the diagnostic associated with the fix. - set code(String value) { - assert(value != null); - _code = value; - } + String code; /// The number times the associated diagnostic was fixed in the associated /// source edit. - int get occurrences => _occurrences; + int occurrences; - /// The number times the associated diagnostic was fixed in the associated - /// source edit. - set occurrences(int value) { - assert(value != null); - _occurrences = value; - } - - BulkFixDetail(String code, int occurrences) { - this.code = code; - this.occurrences = occurrences; - } + BulkFixDetail(this.code, this.occurrences); factory BulkFixDetail.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String code; @@ -5112,8 +4158,8 @@ class BulkFixDetail implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['code'] = code; result['occurrences'] = occurrences; return result; @@ -5149,49 +4195,20 @@ class BulkFixDetail implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ClosingLabel implements HasToJson { - int _offset; - - int _length; - - String _label; - /// The offset of the construct being labelled. - int get offset => _offset; - - /// The offset of the construct being labelled. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the whole construct to be labelled. - int get length => _length; - - /// The length of the whole construct to be labelled. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The label associated with this range that should be displayed to the /// user. - String get label => _label; + String label; - /// The label associated with this range that should be displayed to the - /// user. - set label(String value) { - assert(value != null); - _label = value; - } - - ClosingLabel(int offset, int length, String label) { - this.offset = offset; - this.length = length; - this.label = label; - } + ClosingLabel(this.offset, this.length, this.label); factory ClosingLabel.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -5219,8 +4236,8 @@ class ClosingLabel implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['label'] = label; @@ -5259,48 +4276,29 @@ class ClosingLabel implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionAvailableSuggestionsParams implements HasToJson { - List _changedLibraries; - - List _removedLibraries; - /// A list of pre-computed, potential completions coming from this set of /// completion suggestions. - List get changedLibraries => _changedLibraries; - - /// A list of pre-computed, potential completions coming from this set of - /// completion suggestions. - set changedLibraries(List value) { - _changedLibraries = value; - } + List? changedLibraries; /// A list of library ids that no longer apply. - List get removedLibraries => _removedLibraries; - - /// A list of library ids that no longer apply. - set removedLibraries(List value) { - _removedLibraries = value; - } + List? removedLibraries; CompletionAvailableSuggestionsParams( - {List changedLibraries, - List removedLibraries}) { - this.changedLibraries = changedLibraries; - this.removedLibraries = removedLibraries; - } + {this.changedLibraries, this.removedLibraries}); factory CompletionAvailableSuggestionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List changedLibraries; + List? changedLibraries; if (json.containsKey('changedLibraries')) { changedLibraries = jsonDecoder.decodeList( jsonPath + '.changedLibraries', json['changedLibraries'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AvailableSuggestionSet.fromJson(jsonDecoder, jsonPath, json)); } - List removedLibraries; + List? removedLibraries; if (json.containsKey('removedLibraries')) { removedLibraries = jsonDecoder.decodeList( jsonPath + '.removedLibraries', @@ -5323,13 +4321,15 @@ class CompletionAvailableSuggestionsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var changedLibraries = this.changedLibraries; if (changedLibraries != null) { result['changedLibraries'] = changedLibraries .map((AvailableSuggestionSet value) => value.toJson()) .toList(); } + var removedLibraries = this.removedLibraries; if (removedLibraries != null) { result['removedLibraries'] = removedLibraries; } @@ -5372,35 +4372,16 @@ class CompletionAvailableSuggestionsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionExistingImportsParams implements HasToJson { - String _file; - - ExistingImports _imports; - /// The defining file of the library. - String get file => _file; - - /// The defining file of the library. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The existing imports in the library. - ExistingImports get imports => _imports; + ExistingImports imports; - /// The existing imports in the library. - set imports(ExistingImports value) { - assert(value != null); - _imports = value; - } - - CompletionExistingImportsParams(String file, ExistingImports imports) { - this.file = file; - this.imports = imports; - } + CompletionExistingImportsParams(this.file, this.imports); factory CompletionExistingImportsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5430,8 +4411,8 @@ class CompletionExistingImportsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['imports'] = imports.toJson(); return result; @@ -5472,64 +4453,25 @@ class CompletionExistingImportsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionDetailsParams implements RequestParams { - String _file; - - int _id; - - String _label; - - int _offset; - /// The path of the file into which this completion is being inserted. - String get file => _file; - - /// The path of the file into which this completion is being inserted. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The identifier of the AvailableSuggestionSet containing the selected /// label. - int get id => _id; - - /// The identifier of the AvailableSuggestionSet containing the selected - /// label. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The label from the AvailableSuggestionSet with the `id` for which /// insertion information is requested. - String get label => _label; - - /// The label from the AvailableSuggestionSet with the `id` for which - /// insertion information is requested. - set label(String value) { - assert(value != null); - _label = value; - } + String label; /// The offset in the file where the completion will be inserted. - int get offset => _offset; - - /// The offset in the file where the completion will be inserted. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; CompletionGetSuggestionDetailsParams( - String file, int id, String label, int offset) { - this.file = file; - this.id = id; - this.label = label; - this.offset = offset; - } + this.file, this.id, this.label, this.offset); factory CompletionGetSuggestionDetailsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5569,8 +4511,8 @@ class CompletionGetSuggestionDetailsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['id'] = id; result['label'] = label; @@ -5617,39 +4559,18 @@ class CompletionGetSuggestionDetailsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionDetailsResult implements ResponseResult { - String _completion; - - SourceChange _change; - /// The full text to insert, including any optional import prefix. - String get completion => _completion; - - /// The full text to insert, including any optional import prefix. - set completion(String value) { - assert(value != null); - _completion = value; - } + String completion; /// A change for the client to apply in case the library containing the /// accepted completion suggestion needs to be imported. The field will be /// omitted if there are no additional changes that need to be made. - SourceChange get change => _change; + SourceChange? change; - /// A change for the client to apply in case the library containing the - /// accepted completion suggestion needs to be imported. The field will be - /// omitted if there are no additional changes that need to be made. - set change(SourceChange value) { - _change = value; - } - - CompletionGetSuggestionDetailsResult(String completion, - {SourceChange change}) { - this.completion = completion; - this.change = change; - } + CompletionGetSuggestionDetailsResult(this.completion, {this.change}); factory CompletionGetSuggestionDetailsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String completion; @@ -5659,7 +4580,7 @@ class CompletionGetSuggestionDetailsResult implements ResponseResult { } else { throw jsonDecoder.mismatch(jsonPath, 'completion'); } - SourceChange change; + SourceChange? change; if (json.containsKey('change')) { change = SourceChange.fromJson( jsonDecoder, jsonPath + '.change', json['change']); @@ -5679,9 +4600,10 @@ class CompletionGetSuggestionDetailsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['completion'] = completion; + var change = this.change; if (change != null) { result['change'] = change.toJson(); } @@ -5722,35 +4644,16 @@ class CompletionGetSuggestionDetailsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionsParams implements RequestParams { - String _file; - - int _offset; - /// The file containing the point at which suggestions are to be made. - String get file => _file; - - /// The file containing the point at which suggestions are to be made. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset within the file at which suggestions are to be made. - int get offset => _offset; + int offset; - /// The offset within the file at which suggestions are to be made. - set offset(int value) { - assert(value != null); - _offset = value; - } - - CompletionGetSuggestionsParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + CompletionGetSuggestionsParams(this.file, this.offset); factory CompletionGetSuggestionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -5778,8 +4681,8 @@ class CompletionGetSuggestionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -5818,23 +4721,13 @@ class CompletionGetSuggestionsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class CompletionGetSuggestionsResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this completion request. - String get id => _id; + String id; - /// The identifier used to associate results with this completion request. - set id(String value) { - assert(value != null); - _id = value; - } - - CompletionGetSuggestionsResult(String id) { - this.id = id; - } + CompletionGetSuggestionsResult(this.id); factory CompletionGetSuggestionsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -5858,8 +4751,8 @@ class CompletionGetSuggestionsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -5896,29 +4789,16 @@ class CompletionGetSuggestionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class CompletionRegisterLibraryPathsParams implements RequestParams { - List _paths; - /// A list of objects each containing a path and the additional libraries /// from which the client is interested in receiving completion suggestions. /// If one configured path is beneath another, the descendent will override /// the ancestors' configured libraries of interest. - List get paths => _paths; + List paths; - /// A list of objects each containing a path and the additional libraries - /// from which the client is interested in receiving completion suggestions. - /// If one configured path is beneath another, the descendent will override - /// the ancestors' configured libraries of interest. - set paths(List value) { - assert(value != null); - _paths = value; - } - - CompletionRegisterLibraryPathsParams(List paths) { - this.paths = paths; - } + CompletionRegisterLibraryPathsParams(this.paths); factory CompletionRegisterLibraryPathsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List paths; @@ -5926,7 +4806,7 @@ class CompletionRegisterLibraryPathsParams implements RequestParams { paths = jsonDecoder.decodeList( jsonPath + '.paths', json['paths'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => LibraryPathSet.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'paths'); @@ -5944,8 +4824,8 @@ class CompletionRegisterLibraryPathsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['paths'] = paths.map((LibraryPathSet value) => value.toJson()).toList(); return result; @@ -5981,7 +4861,7 @@ class CompletionRegisterLibraryPathsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class CompletionRegisterLibraryPathsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -6018,131 +4898,48 @@ class CompletionRegisterLibraryPathsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class CompletionResultsParams implements HasToJson { - String _id; - - int _replacementOffset; - - int _replacementLength; - - List _results; - - bool _isLast; - - String _libraryFile; - - List _includedSuggestionSets; - - List _includedElementKinds; - - List _includedSuggestionRelevanceTags; - /// The id associated with the completion. - String get id => _id; - - /// The id associated with the completion. - set id(String value) { - assert(value != null); - _id = value; - } + String id; /// The offset of the start of the text to be replaced. This will be /// different than the offset used to request the completion suggestions if /// there was a portion of an identifier before the original offset. In /// particular, the replacementOffset will be the offset of the beginning of /// said identifier. - int get replacementOffset => _replacementOffset; - - /// The offset of the start of the text to be replaced. This will be - /// different than the offset used to request the completion suggestions if - /// there was a portion of an identifier before the original offset. In - /// particular, the replacementOffset will be the offset of the beginning of - /// said identifier. - set replacementOffset(int value) { - assert(value != null); - _replacementOffset = value; - } + int replacementOffset; /// The length of the text to be replaced if the remainder of the identifier /// containing the cursor is to be replaced when the suggestion is applied /// (that is, the number of characters in the existing identifier). - int get replacementLength => _replacementLength; - - /// The length of the text to be replaced if the remainder of the identifier - /// containing the cursor is to be replaced when the suggestion is applied - /// (that is, the number of characters in the existing identifier). - set replacementLength(int value) { - assert(value != null); - _replacementLength = value; - } + int replacementLength; /// The completion suggestions being reported. The notification contains all /// possible completions at the requested cursor position, even those that do /// not match the characters the user has already typed. This allows the /// client to respond to further keystrokes from the user without having to /// make additional requests. - List get results => _results; - - /// The completion suggestions being reported. The notification contains all - /// possible completions at the requested cursor position, even those that do - /// not match the characters the user has already typed. This allows the - /// client to respond to further keystrokes from the user without having to - /// make additional requests. - set results(List value) { - assert(value != null); - _results = value; - } + List results; /// True if this is that last set of results that will be returned for the /// indicated completion. - bool get isLast => _isLast; - - /// True if this is that last set of results that will be returned for the - /// indicated completion. - set isLast(bool value) { - assert(value != null); - _isLast = value; - } + bool isLast; /// The library file that contains the file where completion was requested. /// The client might use it for example together with the existingImports /// notification to filter out available suggestions. If there were changes /// to existing imports in the library, the corresponding existingImports /// notification will be sent before the completion notification. - String get libraryFile => _libraryFile; - - /// The library file that contains the file where completion was requested. - /// The client might use it for example together with the existingImports - /// notification to filter out available suggestions. If there were changes - /// to existing imports in the library, the corresponding existingImports - /// notification will be sent before the completion notification. - set libraryFile(String value) { - _libraryFile = value; - } + String? libraryFile; /// References to AvailableSuggestionSet objects previously sent to the /// client. The client can include applicable names from the referenced /// library in code completion suggestions. - List get includedSuggestionSets => - _includedSuggestionSets; - - /// References to AvailableSuggestionSet objects previously sent to the - /// client. The client can include applicable names from the referenced - /// library in code completion suggestions. - set includedSuggestionSets(List value) { - _includedSuggestionSets = value; - } + List? includedSuggestionSets; /// The client is expected to check this list against the ElementKind sent in /// IncludedSuggestionSet to decide whether or not these symbols should /// should be presented to the user. - List get includedElementKinds => _includedElementKinds; - - /// The client is expected to check this list against the ElementKind sent in - /// IncludedSuggestionSet to decide whether or not these symbols should - /// should be presented to the user. - set includedElementKinds(List value) { - _includedElementKinds = value; - } + List? includedElementKinds; /// The client is expected to check this list against the values of the field /// relevanceTags of AvailableSuggestion to decide if the suggestion should @@ -6152,41 +4949,17 @@ class CompletionResultsParams implements HasToJson { /// /// If an AvailableSuggestion has relevance tags that match more than one /// IncludedSuggestionRelevanceTag, the maximum relevance boost is used. - List get includedSuggestionRelevanceTags => - _includedSuggestionRelevanceTags; + List? includedSuggestionRelevanceTags; - /// The client is expected to check this list against the values of the field - /// relevanceTags of AvailableSuggestion to decide if the suggestion should - /// be given a different relevance than the IncludedSuggestionSet that - /// contains it. This might be used for example to give higher relevance to - /// suggestions of matching types. - /// - /// If an AvailableSuggestion has relevance tags that match more than one - /// IncludedSuggestionRelevanceTag, the maximum relevance boost is used. - set includedSuggestionRelevanceTags( - List value) { - _includedSuggestionRelevanceTags = value; - } - - CompletionResultsParams(String id, int replacementOffset, - int replacementLength, List results, bool isLast, - {String libraryFile, - List includedSuggestionSets, - List includedElementKinds, - List includedSuggestionRelevanceTags}) { - this.id = id; - this.replacementOffset = replacementOffset; - this.replacementLength = replacementLength; - this.results = results; - this.isLast = isLast; - this.libraryFile = libraryFile; - this.includedSuggestionSets = includedSuggestionSets; - this.includedElementKinds = includedElementKinds; - this.includedSuggestionRelevanceTags = includedSuggestionRelevanceTags; - } + CompletionResultsParams(this.id, this.replacementOffset, + this.replacementLength, this.results, this.isLast, + {this.libraryFile, + this.includedSuggestionSets, + this.includedElementKinds, + this.includedSuggestionRelevanceTags}); factory CompletionResultsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -6214,7 +4987,7 @@ class CompletionResultsParams implements HasToJson { results = jsonDecoder.decodeList( jsonPath + '.results', json['results'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'results'); @@ -6225,33 +4998,33 @@ class CompletionResultsParams implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'isLast'); } - String libraryFile; + String? libraryFile; if (json.containsKey('libraryFile')) { libraryFile = jsonDecoder.decodeString( jsonPath + '.libraryFile', json['libraryFile']); } - List includedSuggestionSets; + List? includedSuggestionSets; if (json.containsKey('includedSuggestionSets')) { includedSuggestionSets = jsonDecoder.decodeList( jsonPath + '.includedSuggestionSets', json['includedSuggestionSets'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => IncludedSuggestionSet.fromJson(jsonDecoder, jsonPath, json)); } - List includedElementKinds; + List? includedElementKinds; if (json.containsKey('includedElementKinds')) { includedElementKinds = jsonDecoder.decodeList( jsonPath + '.includedElementKinds', json['includedElementKinds'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ElementKind.fromJson(jsonDecoder, jsonPath, json)); } - List includedSuggestionRelevanceTags; + List? includedSuggestionRelevanceTags; if (json.containsKey('includedSuggestionRelevanceTags')) { includedSuggestionRelevanceTags = jsonDecoder.decodeList( jsonPath + '.includedSuggestionRelevanceTags', json['includedSuggestionRelevanceTags'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => IncludedSuggestionRelevanceTag.fromJson( jsonDecoder, jsonPath, json)); } @@ -6272,27 +5045,31 @@ class CompletionResultsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['replacementOffset'] = replacementOffset; result['replacementLength'] = replacementLength; result['results'] = results.map((CompletionSuggestion value) => value.toJson()).toList(); result['isLast'] = isLast; + var libraryFile = this.libraryFile; if (libraryFile != null) { result['libraryFile'] = libraryFile; } + var includedSuggestionSets = this.includedSuggestionSets; if (includedSuggestionSets != null) { result['includedSuggestionSets'] = includedSuggestionSets .map((IncludedSuggestionSet value) => value.toJson()) .toList(); } + var includedElementKinds = this.includedElementKinds; if (includedElementKinds != null) { result['includedElementKinds'] = includedElementKinds .map((ElementKind value) => value.toJson()) .toList(); } + var includedSuggestionRelevanceTags = this.includedSuggestionRelevanceTags; if (includedSuggestionRelevanceTags != null) { result['includedSuggestionRelevanceTags'] = includedSuggestionRelevanceTags @@ -6387,7 +5164,7 @@ class CompletionService implements Enum { } factory CompletionService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return CompletionService(json); @@ -6412,23 +5189,13 @@ class CompletionService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class CompletionSetSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - CompletionSetSubscriptionsParams(List subscriptions) { - this.subscriptions = subscriptions; - } + CompletionSetSubscriptionsParams(this.subscriptions); factory CompletionSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -6436,7 +5203,7 @@ class CompletionSetSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => CompletionService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -6454,8 +5221,8 @@ class CompletionSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions.map((CompletionService value) => value.toJson()).toList(); return result; @@ -6491,7 +5258,7 @@ class CompletionSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class CompletionSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -6524,72 +5291,26 @@ class CompletionSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ContextData implements HasToJson { - String _name; - - int _explicitFileCount; - - int _implicitFileCount; - - int _workItemQueueLength; - - List _cacheEntryExceptions; - /// The name of the context. - String get name => _name; - - /// The name of the context. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// Explicitly analyzed files. - int get explicitFileCount => _explicitFileCount; - - /// Explicitly analyzed files. - set explicitFileCount(int value) { - assert(value != null); - _explicitFileCount = value; - } + int explicitFileCount; /// Implicitly analyzed files. - int get implicitFileCount => _implicitFileCount; - - /// Implicitly analyzed files. - set implicitFileCount(int value) { - assert(value != null); - _implicitFileCount = value; - } + int implicitFileCount; /// The number of work items in the queue. - int get workItemQueueLength => _workItemQueueLength; - - /// The number of work items in the queue. - set workItemQueueLength(int value) { - assert(value != null); - _workItemQueueLength = value; - } + int workItemQueueLength; /// Exceptions associated with cache entries. - List get cacheEntryExceptions => _cacheEntryExceptions; + List cacheEntryExceptions; - /// Exceptions associated with cache entries. - set cacheEntryExceptions(List value) { - assert(value != null); - _cacheEntryExceptions = value; - } - - ContextData(String name, int explicitFileCount, int implicitFileCount, - int workItemQueueLength, List cacheEntryExceptions) { - this.name = name; - this.explicitFileCount = explicitFileCount; - this.implicitFileCount = implicitFileCount; - this.workItemQueueLength = workItemQueueLength; - this.cacheEntryExceptions = cacheEntryExceptions; - } + ContextData(this.name, this.explicitFileCount, this.implicitFileCount, + this.workItemQueueLength, this.cacheEntryExceptions); factory ContextData.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -6636,8 +5357,8 @@ class ContextData implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['explicitFileCount'] = explicitFileCount; result['implicitFileCount'] = implicitFileCount; @@ -6759,34 +5480,16 @@ class ConvertMethodToGetterOptions extends RefactoringOptions /// /// Clients may not extend, implement or mix-in this class. class DartFix implements HasToJson { - String _name; - - String _description; - /// The name of the fix. - String get name => _name; - - /// The name of the fix. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// A human readable description of the fix. - String get description => _description; + String? description; - /// A human readable description of the fix. - set description(String value) { - _description = value; - } - - DartFix(String name, {String description}) { - this.name = name; - this.description = description; - } + DartFix(this.name, {this.description}); factory DartFix.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -6795,7 +5498,7 @@ class DartFix implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - String description; + String? description; if (json.containsKey('description')) { description = jsonDecoder.decodeString( jsonPath + '.description', json['description']); @@ -6807,9 +5510,10 @@ class DartFix implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; + var description = this.description; if (description != null) { result['description'] = description; } @@ -6845,34 +5549,16 @@ class DartFix implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class DartFixSuggestion implements HasToJson { - String _description; - - Location _location; - /// A human readable description of the suggested change. - String get description => _description; - - /// A human readable description of the suggested change. - set description(String value) { - assert(value != null); - _description = value; - } + String description; /// The location of the suggested change. - Location get location => _location; + Location? location; - /// The location of the suggested change. - set location(Location value) { - _location = value; - } - - DartFixSuggestion(String description, {Location location}) { - this.description = description; - this.location = location; - } + DartFixSuggestion(this.description, {this.location}); factory DartFixSuggestion.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String description; @@ -6882,7 +5568,7 @@ class DartFixSuggestion implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'description'); } - Location location; + Location? location; if (json.containsKey('location')) { location = Location.fromJson( jsonDecoder, jsonPath + '.location', json['location']); @@ -6894,9 +5580,10 @@ class DartFixSuggestion implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['description'] = description; + var location = this.location; if (location != null) { result['location'] = location.toJson(); } @@ -6928,7 +5615,7 @@ class DartFixSuggestion implements HasToJson { /// Clients may not extend, implement or mix-in this class. class DiagnosticGetDiagnosticsParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -6957,23 +5644,13 @@ class DiagnosticGetDiagnosticsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class DiagnosticGetDiagnosticsResult implements ResponseResult { - List _contexts; - /// The list of analysis contexts. - List get contexts => _contexts; + List contexts; - /// The list of analysis contexts. - set contexts(List value) { - assert(value != null); - _contexts = value; - } - - DiagnosticGetDiagnosticsResult(List contexts) { - this.contexts = contexts; - } + DiagnosticGetDiagnosticsResult(this.contexts); factory DiagnosticGetDiagnosticsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List contexts; @@ -6981,7 +5658,7 @@ class DiagnosticGetDiagnosticsResult implements ResponseResult { contexts = jsonDecoder.decodeList( jsonPath + '.contexts', json['contexts'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ContextData.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'contexts'); @@ -7001,8 +5678,8 @@ class DiagnosticGetDiagnosticsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['contexts'] = contexts.map((ContextData value) => value.toJson()).toList(); return result; @@ -7038,7 +5715,7 @@ class DiagnosticGetDiagnosticsResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class DiagnosticGetServerPortParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -7067,23 +5744,13 @@ class DiagnosticGetServerPortParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class DiagnosticGetServerPortResult implements ResponseResult { - int _port; - /// The diagnostic server port. - int get port => _port; + int port; - /// The diagnostic server port. - set port(int value) { - assert(value != null); - _port = value; - } - - DiagnosticGetServerPortResult(int port) { - this.port = port; - } + DiagnosticGetServerPortResult(this.port); factory DiagnosticGetServerPortResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int port; @@ -7107,8 +5774,8 @@ class DiagnosticGetServerPortResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['port'] = port; return result; } @@ -7146,10 +5813,6 @@ class DiagnosticGetServerPortResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditBulkFixesParams implements RequestParams { - List _included; - - bool _inTestMode; - /// A list of the files and directories for which edits should be suggested. /// /// If a request is made with a path that is invalid, e.g. is not absolute @@ -7158,20 +5821,7 @@ class EditBulkFixesParams implements RequestParams { /// is not currently subject to analysis (e.g. because it is not associated /// with any analysis root specified to analysis.setAnalysisRoots), an error /// of type FILE_NOT_ANALYZED will be generated. - List get included => _included; - - /// A list of the files and directories for which edits should be suggested. - /// - /// If a request is made with a path that is invalid, e.g. is not absolute - /// and normalized, an error of type INVALID_FILE_PATH_FORMAT will be - /// generated. If a request is made for a file which does not exist, or which - /// is not currently subject to analysis (e.g. because it is not associated - /// with any analysis root specified to analysis.setAnalysisRoots), an error - /// of type FILE_NOT_ANALYZED will be generated. - set included(List value) { - assert(value != null); - _included = value; - } + List included; /// A flag indicating whether the bulk fixes are being run in test mode. The /// only difference is that in test mode the fix processor will look for a @@ -7179,25 +5829,12 @@ class EditBulkFixesParams implements RequestParams { /// compute the fixes when data-driven fixes are being considered. /// /// If this field is omitted the flag defaults to false. - bool get inTestMode => _inTestMode; + bool? inTestMode; - /// A flag indicating whether the bulk fixes are being run in test mode. The - /// only difference is that in test mode the fix processor will look for a - /// configuration file that can modify the content of the data file used to - /// compute the fixes when data-driven fixes are being considered. - /// - /// If this field is omitted the flag defaults to false. - set inTestMode(bool value) { - _inTestMode = value; - } - - EditBulkFixesParams(List included, {bool inTestMode}) { - this.included = included; - this.inTestMode = inTestMode; - } + EditBulkFixesParams(this.included, {this.inTestMode}); factory EditBulkFixesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List included; @@ -7207,7 +5844,7 @@ class EditBulkFixesParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'included'); } - bool inTestMode; + bool? inTestMode; if (json.containsKey('inTestMode')) { inTestMode = jsonDecoder.decodeBool( jsonPath + '.inTestMode', json['inTestMode']); @@ -7224,9 +5861,10 @@ class EditBulkFixesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['included'] = included; + var inTestMode = this.inTestMode; if (inTestMode != null) { result['inTestMode'] = inTestMode; } @@ -7269,35 +5907,16 @@ class EditBulkFixesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditBulkFixesResult implements ResponseResult { - List _edits; - - List _details; - /// A list of source edits to apply the recommended changes. - List get edits => _edits; - - /// A list of source edits to apply the recommended changes. - set edits(List value) { - assert(value != null); - _edits = value; - } + List edits; /// Details that summarize the fixes associated with the recommended changes. - List get details => _details; + List details; - /// Details that summarize the fixes associated with the recommended changes. - set details(List value) { - assert(value != null); - _details = value; - } - - EditBulkFixesResult(List edits, List details) { - this.edits = edits; - this.details = details; - } + EditBulkFixesResult(this.edits, this.details); factory EditBulkFixesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List edits; @@ -7305,7 +5924,7 @@ class EditBulkFixesResult implements ResponseResult { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -7315,7 +5934,7 @@ class EditBulkFixesResult implements ResponseResult { details = jsonDecoder.decodeList( jsonPath + '.details', json['details'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => BulkFix.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'details'); @@ -7334,8 +5953,8 @@ class EditBulkFixesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edits'] = edits.map((SourceFileEdit value) => value.toJson()).toList(); result['details'] = details.map((BulkFix value) => value.toJson()).toList(); @@ -7382,18 +6001,6 @@ class EditBulkFixesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditDartfixParams implements RequestParams { - List _included; - - List _includedFixes; - - bool _includePedanticFixes; - - List _excludedFixes; - - int _port; - - String _outputDir; - /// A list of the files and directories for which edits should be suggested. /// /// If a request is made with a path that is invalid, e.g. is not absolute @@ -7402,89 +6009,38 @@ class EditDartfixParams implements RequestParams { /// is not currently subject to analysis (e.g. because it is not associated /// with any analysis root specified to analysis.setAnalysisRoots), an error /// of type FILE_NOT_ANALYZED will be generated. - List get included => _included; - - /// A list of the files and directories for which edits should be suggested. - /// - /// If a request is made with a path that is invalid, e.g. is not absolute - /// and normalized, an error of type INVALID_FILE_PATH_FORMAT will be - /// generated. If a request is made for a file which does not exist, or which - /// is not currently subject to analysis (e.g. because it is not associated - /// with any analysis root specified to analysis.setAnalysisRoots), an error - /// of type FILE_NOT_ANALYZED will be generated. - set included(List value) { - assert(value != null); - _included = value; - } + List included; /// A list of names indicating which fixes should be applied. /// /// If a name is specified that does not match the name of a known fix, an /// error of type UNKNOWN_FIX will be generated. - List get includedFixes => _includedFixes; - - /// A list of names indicating which fixes should be applied. - /// - /// If a name is specified that does not match the name of a known fix, an - /// error of type UNKNOWN_FIX will be generated. - set includedFixes(List value) { - _includedFixes = value; - } + List? includedFixes; /// A flag indicating whether "pedantic" fixes should be applied. - bool get includePedanticFixes => _includePedanticFixes; - - /// A flag indicating whether "pedantic" fixes should be applied. - set includePedanticFixes(bool value) { - _includePedanticFixes = value; - } + bool? includePedanticFixes; /// A list of names indicating which fixes should not be applied. /// /// If a name is specified that does not match the name of a known fix, an /// error of type UNKNOWN_FIX will be generated. - List get excludedFixes => _excludedFixes; - - /// A list of names indicating which fixes should not be applied. - /// - /// If a name is specified that does not match the name of a known fix, an - /// error of type UNKNOWN_FIX will be generated. - set excludedFixes(List value) { - _excludedFixes = value; - } + List? excludedFixes; /// Deprecated: This field is now ignored by server. - int get port => _port; + int? port; /// Deprecated: This field is now ignored by server. - set port(int value) { - _port = value; - } + String? outputDir; - /// Deprecated: This field is now ignored by server. - String get outputDir => _outputDir; - - /// Deprecated: This field is now ignored by server. - set outputDir(String value) { - _outputDir = value; - } - - EditDartfixParams(List included, - {List includedFixes, - bool includePedanticFixes, - List excludedFixes, - int port, - String outputDir}) { - this.included = included; - this.includedFixes = includedFixes; - this.includePedanticFixes = includePedanticFixes; - this.excludedFixes = excludedFixes; - this.port = port; - this.outputDir = outputDir; - } + EditDartfixParams(this.included, + {this.includedFixes, + this.includePedanticFixes, + this.excludedFixes, + this.port, + this.outputDir}); factory EditDartfixParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List included; @@ -7494,26 +6050,26 @@ class EditDartfixParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'included'); } - List includedFixes; + List? includedFixes; if (json.containsKey('includedFixes')) { includedFixes = jsonDecoder.decodeList(jsonPath + '.includedFixes', json['includedFixes'], jsonDecoder.decodeString); } - bool includePedanticFixes; + bool? includePedanticFixes; if (json.containsKey('includePedanticFixes')) { includePedanticFixes = jsonDecoder.decodeBool( jsonPath + '.includePedanticFixes', json['includePedanticFixes']); } - List excludedFixes; + List? excludedFixes; if (json.containsKey('excludedFixes')) { excludedFixes = jsonDecoder.decodeList(jsonPath + '.excludedFixes', json['excludedFixes'], jsonDecoder.decodeString); } - int port; + int? port; if (json.containsKey('port')) { port = jsonDecoder.decodeInt(jsonPath + '.port', json['port']); } - String outputDir; + String? outputDir; if (json.containsKey('outputDir')) { outputDir = jsonDecoder.decodeString( jsonPath + '.outputDir', json['outputDir']); @@ -7535,21 +6091,26 @@ class EditDartfixParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['included'] = included; + var includedFixes = this.includedFixes; if (includedFixes != null) { result['includedFixes'] = includedFixes; } + var includePedanticFixes = this.includePedanticFixes; if (includePedanticFixes != null) { result['includePedanticFixes'] = includePedanticFixes; } + var excludedFixes = this.excludedFixes; if (excludedFixes != null) { result['excludedFixes'] = excludedFixes; } + var port = this.port; if (port != null) { result['port'] = port; } + var outputDir = this.outputDir; if (outputDir != null) { result['outputDir'] = outputDir; } @@ -7607,117 +6168,42 @@ class EditDartfixParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditDartfixResult implements ResponseResult { - List _suggestions; - - List _otherSuggestions; - - bool _hasErrors; - - List _edits; - - List _details; - - int _port; - - List _urls; - /// A list of recommended changes that can be automatically made by applying /// the 'edits' included in this response. - List get suggestions => _suggestions; - - /// A list of recommended changes that can be automatically made by applying - /// the 'edits' included in this response. - set suggestions(List value) { - assert(value != null); - _suggestions = value; - } + List suggestions; /// A list of recommended changes that could not be automatically made. - List get otherSuggestions => _otherSuggestions; - - /// A list of recommended changes that could not be automatically made. - set otherSuggestions(List value) { - assert(value != null); - _otherSuggestions = value; - } + List otherSuggestions; /// True if the analyzed source contains errors that might impact the /// correctness of the recommended changes that can be automatically applied. - bool get hasErrors => _hasErrors; - - /// True if the analyzed source contains errors that might impact the - /// correctness of the recommended changes that can be automatically applied. - set hasErrors(bool value) { - assert(value != null); - _hasErrors = value; - } + bool hasErrors; /// A list of source edits to apply the recommended changes. - List get edits => _edits; - - /// A list of source edits to apply the recommended changes. - set edits(List value) { - assert(value != null); - _edits = value; - } + List edits; /// Messages that should be displayed to the user that describe details of /// the fix generation. For example, the messages might (a) point out details /// that users might want to explore before committing the changes or (b) /// describe exceptions that were thrown but that did not stop the fixes from /// being produced. The list will be omitted if it is empty. - List get details => _details; - - /// Messages that should be displayed to the user that describe details of - /// the fix generation. For example, the messages might (a) point out details - /// that users might want to explore before committing the changes or (b) - /// describe exceptions that were thrown but that did not stop the fixes from - /// being produced. The list will be omitted if it is empty. - set details(List value) { - _details = value; - } + List? details; /// The port on which the preview tool will respond to GET requests. The /// field is omitted if a preview was not requested. - int get port => _port; - - /// The port on which the preview tool will respond to GET requests. The - /// field is omitted if a preview was not requested. - set port(int value) { - _port = value; - } + int? port; /// The URLs that users can visit in a browser to see a preview of the /// proposed changes. There is one URL for each of the included file paths. /// The field is omitted if a preview was not requested. - List get urls => _urls; - - /// The URLs that users can visit in a browser to see a preview of the - /// proposed changes. There is one URL for each of the included file paths. - /// The field is omitted if a preview was not requested. - set urls(List value) { - _urls = value; - } + List? urls; EditDartfixResult( - List suggestions, - List otherSuggestions, - bool hasErrors, - List edits, - {List details, - int port, - List urls}) { - this.suggestions = suggestions; - this.otherSuggestions = otherSuggestions; - this.hasErrors = hasErrors; - this.edits = edits; - this.details = details; - this.port = port; - this.urls = urls; - } + this.suggestions, this.otherSuggestions, this.hasErrors, this.edits, + {this.details, this.port, this.urls}); factory EditDartfixResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List suggestions; @@ -7725,7 +6211,7 @@ class EditDartfixResult implements ResponseResult { suggestions = jsonDecoder.decodeList( jsonPath + '.suggestions', json['suggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DartFixSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'suggestions'); @@ -7735,7 +6221,7 @@ class EditDartfixResult implements ResponseResult { otherSuggestions = jsonDecoder.decodeList( jsonPath + '.otherSuggestions', json['otherSuggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DartFixSuggestion.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'otherSuggestions'); @@ -7752,21 +6238,21 @@ class EditDartfixResult implements ResponseResult { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); } - List details; + List? details; if (json.containsKey('details')) { details = jsonDecoder.decodeList( jsonPath + '.details', json['details'], jsonDecoder.decodeString); } - int port; + int? port; if (json.containsKey('port')) { port = jsonDecoder.decodeInt(jsonPath + '.port', json['port']); } - List urls; + List? urls; if (json.containsKey('urls')) { urls = jsonDecoder.decodeList( jsonPath + '.urls', json['urls'], jsonDecoder.decodeString); @@ -7786,8 +6272,8 @@ class EditDartfixResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['suggestions'] = suggestions.map((DartFixSuggestion value) => value.toJson()).toList(); result['otherSuggestions'] = otherSuggestions @@ -7796,12 +6282,15 @@ class EditDartfixResult implements ResponseResult { result['hasErrors'] = hasErrors; result['edits'] = edits.map((SourceFileEdit value) => value.toJson()).toList(); + var details = this.details; if (details != null) { result['details'] = details; } + var port = this.port; if (port != null) { result['port'] = port; } + var urls = this.urls; if (urls != null) { result['urls'] = urls; } @@ -7858,59 +6347,23 @@ class EditDartfixResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditFormatParams implements RequestParams { - String _file; - - int _selectionOffset; - - int _selectionLength; - - int _lineLength; - /// The file containing the code to be formatted. - String get file => _file; - - /// The file containing the code to be formatted. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the current selection in the file. - int get selectionOffset => _selectionOffset; - - /// The offset of the current selection in the file. - set selectionOffset(int value) { - assert(value != null); - _selectionOffset = value; - } + int selectionOffset; /// The length of the current selection in the file. - int get selectionLength => _selectionLength; - - /// The length of the current selection in the file. - set selectionLength(int value) { - assert(value != null); - _selectionLength = value; - } + int selectionLength; /// The line length to be used by the formatter. - int get lineLength => _lineLength; + int? lineLength; - /// The line length to be used by the formatter. - set lineLength(int value) { - _lineLength = value; - } - - EditFormatParams(String file, int selectionOffset, int selectionLength, - {int lineLength}) { - this.file = file; - this.selectionOffset = selectionOffset; - this.selectionLength = selectionLength; - this.lineLength = lineLength; - } + EditFormatParams(this.file, this.selectionOffset, this.selectionLength, + {this.lineLength}); factory EditFormatParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -7933,7 +6386,7 @@ class EditFormatParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'selectionLength'); } - int lineLength; + int? lineLength; if (json.containsKey('lineLength')) { lineLength = jsonDecoder.decodeInt(jsonPath + '.lineLength', json['lineLength']); @@ -7951,11 +6404,12 @@ class EditFormatParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['selectionOffset'] = selectionOffset; result['selectionLength'] = selectionLength; + var lineLength = this.lineLength; if (lineLength != null) { result['lineLength'] = lineLength; } @@ -8002,50 +6456,20 @@ class EditFormatParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditFormatResult implements ResponseResult { - List _edits; - - int _selectionOffset; - - int _selectionLength; - /// The edit(s) to be applied in order to format the code. The list will be /// empty if the code was already formatted (there are no changes). - List get edits => _edits; - - /// The edit(s) to be applied in order to format the code. The list will be - /// empty if the code was already formatted (there are no changes). - set edits(List value) { - assert(value != null); - _edits = value; - } + List edits; /// The offset of the selection after formatting the code. - int get selectionOffset => _selectionOffset; - - /// The offset of the selection after formatting the code. - set selectionOffset(int value) { - assert(value != null); - _selectionOffset = value; - } + int selectionOffset; /// The length of the selection after formatting the code. - int get selectionLength => _selectionLength; + int selectionLength; - /// The length of the selection after formatting the code. - set selectionLength(int value) { - assert(value != null); - _selectionLength = value; - } - - EditFormatResult( - List edits, int selectionOffset, int selectionLength) { - this.edits = edits; - this.selectionOffset = selectionOffset; - this.selectionLength = selectionLength; - } + EditFormatResult(this.edits, this.selectionOffset, this.selectionLength); factory EditFormatResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List edits; @@ -8053,7 +6477,7 @@ class EditFormatResult implements ResponseResult { edits = jsonDecoder.decodeList( jsonPath + '.edits', json['edits'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceEdit.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'edits'); @@ -8086,8 +6510,8 @@ class EditFormatResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edits'] = edits.map((SourceEdit value) => value.toJson()).toList(); result['selectionOffset'] = selectionOffset; result['selectionLength'] = selectionLength; @@ -8133,47 +6557,19 @@ class EditFormatResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetAssistsParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file containing the code for which assists are being requested. - String get file => _file; - - /// The file containing the code for which assists are being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the code for which assists are being requested. - int get offset => _offset; - - /// The offset of the code for which assists are being requested. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the code for which assists are being requested. - int get length => _length; + int length; - /// The length of the code for which assists are being requested. - set length(int value) { - assert(value != null); - _length = value; - } - - EditGetAssistsParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + EditGetAssistsParams(this.file, this.offset, this.length); factory EditGetAssistsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8206,8 +6602,8 @@ class EditGetAssistsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -8250,23 +6646,13 @@ class EditGetAssistsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetAssistsResult implements ResponseResult { - List _assists; - /// The assists that are available at the given location. - List get assists => _assists; + List assists; - /// The assists that are available at the given location. - set assists(List value) { - assert(value != null); - _assists = value; - } - - EditGetAssistsResult(List assists) { - this.assists = assists; - } + EditGetAssistsResult(this.assists); factory EditGetAssistsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List assists; @@ -8274,7 +6660,7 @@ class EditGetAssistsResult implements ResponseResult { assists = jsonDecoder.decodeList( jsonPath + '.assists', json['assists'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SourceChange.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'assists'); @@ -8293,8 +6679,8 @@ class EditGetAssistsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['assists'] = assists.map((SourceChange value) => value.toJson()).toList(); return result; @@ -8335,47 +6721,19 @@ class EditGetAssistsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetAvailableRefactoringsParams implements RequestParams { - String _file; - - int _offset; - - int _length; - /// The file containing the code on which the refactoring would be based. - String get file => _file; - - /// The file containing the code on which the refactoring would be based. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the code on which the refactoring would be based. - int get offset => _offset; - - /// The offset of the code on which the refactoring would be based. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the code on which the refactoring would be based. - int get length => _length; + int length; - /// The length of the code on which the refactoring would be based. - set length(int value) { - assert(value != null); - _length = value; - } - - EditGetAvailableRefactoringsParams(String file, int offset, int length) { - this.file = file; - this.offset = offset; - this.length = length; - } + EditGetAvailableRefactoringsParams(this.file, this.offset, this.length); factory EditGetAvailableRefactoringsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8409,8 +6767,8 @@ class EditGetAvailableRefactoringsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['length'] = length; @@ -8453,23 +6811,13 @@ class EditGetAvailableRefactoringsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetAvailableRefactoringsResult implements ResponseResult { - List _kinds; - /// The kinds of refactorings that are valid for the given selection. - List get kinds => _kinds; + List kinds; - /// The kinds of refactorings that are valid for the given selection. - set kinds(List value) { - assert(value != null); - _kinds = value; - } - - EditGetAvailableRefactoringsResult(List kinds) { - this.kinds = kinds; - } + EditGetAvailableRefactoringsResult(this.kinds); factory EditGetAvailableRefactoringsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List kinds; @@ -8477,7 +6825,7 @@ class EditGetAvailableRefactoringsResult implements ResponseResult { kinds = jsonDecoder.decodeList( jsonPath + '.kinds', json['kinds'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringKind.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'kinds'); @@ -8497,8 +6845,8 @@ class EditGetAvailableRefactoringsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kinds'] = kinds.map((RefactoringKind value) => value.toJson()).toList(); return result; @@ -8539,7 +6887,7 @@ class EditGetDartfixInfoParams implements RequestParams { EditGetDartfixInfoParams(); factory EditGetDartfixInfoParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { return EditGetDartfixInfoParams(); @@ -8554,8 +6902,8 @@ class EditGetDartfixInfoParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -8590,23 +6938,13 @@ class EditGetDartfixInfoParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetDartfixInfoResult implements ResponseResult { - List _fixes; - /// A list of fixes that can be specified in an edit.dartfix request. - List get fixes => _fixes; + List fixes; - /// A list of fixes that can be specified in an edit.dartfix request. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - EditGetDartfixInfoResult(List fixes) { - this.fixes = fixes; - } + EditGetDartfixInfoResult(this.fixes); factory EditGetDartfixInfoResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List fixes; @@ -8614,7 +6952,7 @@ class EditGetDartfixInfoResult implements ResponseResult { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => DartFix.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -8633,8 +6971,8 @@ class EditGetDartfixInfoResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['fixes'] = fixes.map((DartFix value) => value.toJson()).toList(); return result; } @@ -8672,35 +7010,16 @@ class EditGetDartfixInfoResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetFixesParams implements RequestParams { - String _file; - - int _offset; - /// The file containing the errors for which fixes are being requested. - String get file => _file; - - /// The file containing the errors for which fixes are being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset used to select the errors for which fixes will be returned. - int get offset => _offset; + int offset; - /// The offset used to select the errors for which fixes will be returned. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditGetFixesParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + EditGetFixesParams(this.file, this.offset); factory EditGetFixesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8727,8 +7046,8 @@ class EditGetFixesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -8767,23 +7086,13 @@ class EditGetFixesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetFixesResult implements ResponseResult { - List _fixes; - /// The fixes that are available for the errors at the given offset. - List get fixes => _fixes; + List fixes; - /// The fixes that are available for the errors at the given offset. - set fixes(List value) { - assert(value != null); - _fixes = value; - } - - EditGetFixesResult(List fixes) { - this.fixes = fixes; - } + EditGetFixesResult(this.fixes); factory EditGetFixesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List fixes; @@ -8791,7 +7100,7 @@ class EditGetFixesResult implements ResponseResult { fixes = jsonDecoder.decodeList( jsonPath + '.fixes', json['fixes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => AnalysisErrorFixes.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'fixes'); @@ -8810,8 +7119,8 @@ class EditGetFixesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['fixes'] = fixes.map((AnalysisErrorFixes value) => value.toJson()).toList(); return result; @@ -8852,49 +7161,20 @@ class EditGetFixesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetPostfixCompletionParams implements RequestParams { - String _file; - - String _key; - - int _offset; - /// The file containing the postfix template to be expanded. - String get file => _file; - - /// The file containing the postfix template to be expanded. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The unique name that identifies the template in use. - String get key => _key; - - /// The unique name that identifies the template in use. - set key(String value) { - assert(value != null); - _key = value; - } + String key; /// The offset used to identify the code to which the template will be /// applied. - int get offset => _offset; + int offset; - /// The offset used to identify the code to which the template will be - /// applied. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditGetPostfixCompletionParams(String file, String key, int offset) { - this.file = file; - this.key = key; - this.offset = offset; - } + EditGetPostfixCompletionParams(this.file, this.key, this.offset); factory EditGetPostfixCompletionParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -8928,8 +7208,8 @@ class EditGetPostfixCompletionParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['key'] = key; result['offset'] = offset; @@ -8970,23 +7250,13 @@ class EditGetPostfixCompletionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetPostfixCompletionResult implements ResponseResult { - SourceChange _change; - /// The change to be applied in order to complete the statement. - SourceChange get change => _change; + SourceChange change; - /// The change to be applied in order to complete the statement. - set change(SourceChange value) { - assert(value != null); - _change = value; - } - - EditGetPostfixCompletionResult(SourceChange change) { - this.change = change; - } + EditGetPostfixCompletionResult(this.change); factory EditGetPostfixCompletionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceChange change; @@ -9011,8 +7281,8 @@ class EditGetPostfixCompletionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['change'] = change.toJson(); return result; } @@ -9054,94 +7324,35 @@ class EditGetPostfixCompletionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetRefactoringParams implements RequestParams { - RefactoringKind _kind; - - String _file; - - int _offset; - - int _length; - - bool _validateOnly; - - RefactoringOptions _options; - /// The kind of refactoring to be performed. - RefactoringKind get kind => _kind; - - /// The kind of refactoring to be performed. - set kind(RefactoringKind value) { - assert(value != null); - _kind = value; - } + RefactoringKind kind; /// The file containing the code involved in the refactoring. - String get file => _file; - - /// The file containing the code involved in the refactoring. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the region involved in the refactoring. - int get offset => _offset; - - /// The offset of the region involved in the refactoring. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the region involved in the refactoring. - int get length => _length; - - /// The length of the region involved in the refactoring. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// True if the client is only requesting that the values of the options be /// validated and no change be generated. - bool get validateOnly => _validateOnly; - - /// True if the client is only requesting that the values of the options be - /// validated and no change be generated. - set validateOnly(bool value) { - assert(value != null); - _validateOnly = value; - } + bool validateOnly; /// Data used to provide values provided by the user. The structure of the /// data is dependent on the kind of refactoring being performed. The data /// that is expected is documented in the section titled Refactorings, /// labeled as "Options". This field can be omitted if the refactoring does /// not require any options or if the values of those options are not known. - RefactoringOptions get options => _options; + RefactoringOptions? options; - /// Data used to provide values provided by the user. The structure of the - /// data is dependent on the kind of refactoring being performed. The data - /// that is expected is documented in the section titled Refactorings, - /// labeled as "Options". This field can be omitted if the refactoring does - /// not require any options or if the values of those options are not known. - set options(RefactoringOptions value) { - _options = value; - } - - EditGetRefactoringParams(RefactoringKind kind, String file, int offset, - int length, bool validateOnly, - {RefactoringOptions options}) { - this.kind = kind; - this.file = file; - this.offset = offset; - this.length = length; - this.validateOnly = validateOnly; - this.options = options; - } + EditGetRefactoringParams( + this.kind, this.file, this.offset, this.length, this.validateOnly, + {this.options}); factory EditGetRefactoringParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { RefactoringKind kind; @@ -9176,7 +7387,7 @@ class EditGetRefactoringParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'validateOnly'); } - RefactoringOptions options; + RefactoringOptions? options; if (json.containsKey('options')) { options = RefactoringOptions.fromJson( jsonDecoder, jsonPath + '.options', json['options'], kind); @@ -9196,13 +7407,14 @@ class EditGetRefactoringParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['file'] = file; result['offset'] = offset; result['length'] = length; result['validateOnly'] = validateOnly; + var options = this.options; if (options != null) { result['options'] = options.toJson(); } @@ -9256,84 +7468,32 @@ class EditGetRefactoringParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetRefactoringResult implements ResponseResult { - List _initialProblems; - - List _optionsProblems; - - List _finalProblems; - - RefactoringFeedback _feedback; - - SourceChange _change; - - List _potentialEdits; - /// The initial status of the refactoring, i.e. problems related to the /// context in which the refactoring is requested. The array will be empty if /// there are no known problems. - List get initialProblems => _initialProblems; - - /// The initial status of the refactoring, i.e. problems related to the - /// context in which the refactoring is requested. The array will be empty if - /// there are no known problems. - set initialProblems(List value) { - assert(value != null); - _initialProblems = value; - } + List initialProblems; /// The options validation status, i.e. problems in the given options, such /// as light-weight validation of a new name, flags compatibility, etc. The /// array will be empty if there are no known problems. - List get optionsProblems => _optionsProblems; - - /// The options validation status, i.e. problems in the given options, such - /// as light-weight validation of a new name, flags compatibility, etc. The - /// array will be empty if there are no known problems. - set optionsProblems(List value) { - assert(value != null); - _optionsProblems = value; - } + List optionsProblems; /// The final status of the refactoring, i.e. problems identified in the /// result of a full, potentially expensive validation and / or change /// creation. The array will be empty if there are no known problems. - List get finalProblems => _finalProblems; - - /// The final status of the refactoring, i.e. problems identified in the - /// result of a full, potentially expensive validation and / or change - /// creation. The array will be empty if there are no known problems. - set finalProblems(List value) { - assert(value != null); - _finalProblems = value; - } + List finalProblems; /// Data used to provide feedback to the user. The structure of the data is /// dependent on the kind of refactoring being created. The data that is /// returned is documented in the section titled Refactorings, labeled as /// "Feedback". - RefactoringFeedback get feedback => _feedback; - - /// Data used to provide feedback to the user. The structure of the data is - /// dependent on the kind of refactoring being created. The data that is - /// returned is documented in the section titled Refactorings, labeled as - /// "Feedback". - set feedback(RefactoringFeedback value) { - _feedback = value; - } + RefactoringFeedback? feedback; /// The changes that are to be applied to affect the refactoring. This field /// will be omitted if there are problems that prevent a set of changes from /// being computed, such as having no options specified for a refactoring /// that requires them, or if only validation was requested. - SourceChange get change => _change; - - /// The changes that are to be applied to affect the refactoring. This field - /// will be omitted if there are problems that prevent a set of changes from - /// being computed, such as having no options specified for a refactoring - /// that requires them, or if only validation was requested. - set change(SourceChange value) { - _change = value; - } + SourceChange? change; /// The ids of source edits that are not known to be valid. An edit is not /// known to be valid if there was insufficient type information for the @@ -9342,36 +7502,14 @@ class EditGetRefactoringResult implements ResponseResult { /// to a member from an unknown type. This field will be omitted if the /// change field is omitted or if there are no potential edits for the /// refactoring. - List get potentialEdits => _potentialEdits; - - /// The ids of source edits that are not known to be valid. An edit is not - /// known to be valid if there was insufficient type information for the - /// server to be able to determine whether or not the code needs to be - /// modified, such as when a member is being renamed and there is a reference - /// to a member from an unknown type. This field will be omitted if the - /// change field is omitted or if there are no potential edits for the - /// refactoring. - set potentialEdits(List value) { - _potentialEdits = value; - } + List? potentialEdits; EditGetRefactoringResult( - List initialProblems, - List optionsProblems, - List finalProblems, - {RefactoringFeedback feedback, - SourceChange change, - List potentialEdits}) { - this.initialProblems = initialProblems; - this.optionsProblems = optionsProblems; - this.finalProblems = finalProblems; - this.feedback = feedback; - this.change = change; - this.potentialEdits = potentialEdits; - } + this.initialProblems, this.optionsProblems, this.finalProblems, + {this.feedback, this.change, this.potentialEdits}); factory EditGetRefactoringResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List initialProblems; @@ -9379,7 +7517,7 @@ class EditGetRefactoringResult implements ResponseResult { initialProblems = jsonDecoder.decodeList( jsonPath + '.initialProblems', json['initialProblems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'initialProblems'); @@ -9389,7 +7527,7 @@ class EditGetRefactoringResult implements ResponseResult { optionsProblems = jsonDecoder.decodeList( jsonPath + '.optionsProblems', json['optionsProblems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'optionsProblems'); @@ -9399,22 +7537,22 @@ class EditGetRefactoringResult implements ResponseResult { finalProblems = jsonDecoder.decodeList( jsonPath + '.finalProblems', json['finalProblems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'finalProblems'); } - RefactoringFeedback feedback; + RefactoringFeedback? feedback; if (json.containsKey('feedback')) { feedback = RefactoringFeedback.fromJson( jsonDecoder, jsonPath + '.feedback', json['feedback'], json); } - SourceChange change; + SourceChange? change; if (json.containsKey('change')) { change = SourceChange.fromJson( jsonDecoder, jsonPath + '.change', json['change']); } - List potentialEdits; + List? potentialEdits; if (json.containsKey('potentialEdits')) { potentialEdits = jsonDecoder.decodeList(jsonPath + '.potentialEdits', json['potentialEdits'], jsonDecoder.decodeString); @@ -9435,8 +7573,8 @@ class EditGetRefactoringResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['initialProblems'] = initialProblems .map((RefactoringProblem value) => value.toJson()) .toList(); @@ -9446,12 +7584,15 @@ class EditGetRefactoringResult implements ResponseResult { result['finalProblems'] = finalProblems .map((RefactoringProblem value) => value.toJson()) .toList(); + var feedback = this.feedback; if (feedback != null) { result['feedback'] = feedback.toJson(); } + var change = this.change; if (change != null) { result['change'] = change.toJson(); } + var potentialEdits = this.potentialEdits; if (potentialEdits != null) { result['potentialEdits'] = potentialEdits; } @@ -9505,35 +7646,16 @@ class EditGetRefactoringResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditGetStatementCompletionParams implements RequestParams { - String _file; - - int _offset; - /// The file containing the statement to be completed. - String get file => _file; - - /// The file containing the statement to be completed. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset used to identify the statement to be completed. - int get offset => _offset; + int offset; - /// The offset used to identify the statement to be completed. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditGetStatementCompletionParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + EditGetStatementCompletionParams(this.file, this.offset); factory EditGetStatementCompletionParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -9561,8 +7683,8 @@ class EditGetStatementCompletionParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -9602,37 +7724,17 @@ class EditGetStatementCompletionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditGetStatementCompletionResult implements ResponseResult { - SourceChange _change; - - bool _whitespaceOnly; - /// The change to be applied in order to complete the statement. - SourceChange get change => _change; - - /// The change to be applied in order to complete the statement. - set change(SourceChange value) { - assert(value != null); - _change = value; - } + SourceChange change; /// Will be true if the change contains nothing but whitespace characters, or /// is empty. - bool get whitespaceOnly => _whitespaceOnly; + bool whitespaceOnly; - /// Will be true if the change contains nothing but whitespace characters, or - /// is empty. - set whitespaceOnly(bool value) { - assert(value != null); - _whitespaceOnly = value; - } - - EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) { - this.change = change; - this.whitespaceOnly = whitespaceOnly; - } + EditGetStatementCompletionResult(this.change, this.whitespaceOnly); factory EditGetStatementCompletionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceChange change; @@ -9664,8 +7766,8 @@ class EditGetStatementCompletionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['change'] = change.toJson(); result['whitespaceOnly'] = whitespaceOnly; return result; @@ -9706,53 +7808,22 @@ class EditGetStatementCompletionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditImportElementsParams implements RequestParams { - String _file; - - List _elements; - - int _offset; - /// The file in which the specified elements are to be made accessible. - String get file => _file; - - /// The file in which the specified elements are to be made accessible. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The elements to be made accessible in the specified file. - List get elements => _elements; - - /// The elements to be made accessible in the specified file. - set elements(List value) { - assert(value != null); - _elements = value; - } + List elements; /// The offset at which the specified elements need to be made accessible. If /// provided, this is used to guard against adding imports for text that /// would be inserted into a comment, string literal, or other location where /// the imports would not be necessary. - int get offset => _offset; + int? offset; - /// The offset at which the specified elements need to be made accessible. If - /// provided, this is used to guard against adding imports for text that - /// would be inserted into a comment, string literal, or other location where - /// the imports would not be necessary. - set offset(int value) { - _offset = value; - } - - EditImportElementsParams(String file, List elements, - {int offset}) { - this.file = file; - this.elements = elements; - this.offset = offset; - } + EditImportElementsParams(this.file, this.elements, {this.offset}); factory EditImportElementsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -9766,12 +7837,12 @@ class EditImportElementsParams implements RequestParams { elements = jsonDecoder.decodeList( jsonPath + '.elements', json['elements'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ImportedElements.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'elements'); } - int offset; + int? offset; if (json.containsKey('offset')) { offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']); } @@ -9787,11 +7858,12 @@ class EditImportElementsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['elements'] = elements.map((ImportedElements value) => value.toJson()).toList(); + var offset = this.offset; if (offset != null) { result['offset'] = offset; } @@ -9835,35 +7907,21 @@ class EditImportElementsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditImportElementsResult implements ResponseResult { - SourceFileEdit _edit; - /// The edits to be applied in order to make the specified elements /// accessible. The file to be edited will be the defining compilation unit /// of the library containing the file specified in the request, which can be /// different than the file specified in the request if the specified file is /// a part file. This field will be omitted if there are no edits that need /// to be applied. - SourceFileEdit get edit => _edit; + SourceFileEdit? edit; - /// The edits to be applied in order to make the specified elements - /// accessible. The file to be edited will be the defining compilation unit - /// of the library containing the file specified in the request, which can be - /// different than the file specified in the request if the specified file is - /// a part file. This field will be omitted if there are no edits that need - /// to be applied. - set edit(SourceFileEdit value) { - _edit = value; - } - - EditImportElementsResult({SourceFileEdit edit}) { - this.edit = edit; - } + EditImportElementsResult({this.edit}); factory EditImportElementsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - SourceFileEdit edit; + SourceFileEdit? edit; if (json.containsKey('edit')) { edit = SourceFileEdit.fromJson( jsonDecoder, jsonPath + '.edit', json['edit']); @@ -9882,8 +7940,9 @@ class EditImportElementsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var edit = this.edit; if (edit != null) { result['edit'] = edit.toJson(); } @@ -9924,49 +7983,20 @@ class EditImportElementsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditIsPostfixCompletionApplicableParams implements RequestParams { - String _file; - - String _key; - - int _offset; - /// The file containing the postfix template to be expanded. - String get file => _file; - - /// The file containing the postfix template to be expanded. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The unique name that identifies the template in use. - String get key => _key; - - /// The unique name that identifies the template in use. - set key(String value) { - assert(value != null); - _key = value; - } + String key; /// The offset used to identify the code to which the template will be /// applied. - int get offset => _offset; + int offset; - /// The offset used to identify the code to which the template will be - /// applied. - set offset(int value) { - assert(value != null); - _offset = value; - } - - EditIsPostfixCompletionApplicableParams(String file, String key, int offset) { - this.file = file; - this.key = key; - this.offset = offset; - } + EditIsPostfixCompletionApplicableParams(this.file, this.key, this.offset); factory EditIsPostfixCompletionApplicableParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10000,8 +8030,8 @@ class EditIsPostfixCompletionApplicableParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['key'] = key; result['offset'] = offset; @@ -10042,23 +8072,13 @@ class EditIsPostfixCompletionApplicableParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditIsPostfixCompletionApplicableResult implements ResponseResult { - bool _value; - /// True if the template can be expanded at the given location. - bool get value => _value; + bool value; - /// True if the template can be expanded at the given location. - set value(bool value) { - assert(value != null); - _value = value; - } - - EditIsPostfixCompletionApplicableResult(bool value) { - this.value = value; - } + EditIsPostfixCompletionApplicableResult(this.value); factory EditIsPostfixCompletionApplicableResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool value; @@ -10083,8 +8103,8 @@ class EditIsPostfixCompletionApplicableResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['value'] = value; return result; } @@ -10118,7 +8138,7 @@ class EditIsPostfixCompletionApplicableResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class EditListPostfixCompletionTemplatesParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -10147,24 +8167,13 @@ class EditListPostfixCompletionTemplatesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditListPostfixCompletionTemplatesResult implements ResponseResult { - List _templates; - /// The list of available templates. - List get templates => _templates; + List templates; - /// The list of available templates. - set templates(List value) { - assert(value != null); - _templates = value; - } - - EditListPostfixCompletionTemplatesResult( - List templates) { - this.templates = templates; - } + EditListPostfixCompletionTemplatesResult(this.templates); factory EditListPostfixCompletionTemplatesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List templates; @@ -10172,7 +8181,7 @@ class EditListPostfixCompletionTemplatesResult implements ResponseResult { templates = jsonDecoder.decodeList( jsonPath + '.templates', json['templates'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => PostfixTemplateDescriptor.fromJson( jsonDecoder, jsonPath, json)); } else { @@ -10194,8 +8203,8 @@ class EditListPostfixCompletionTemplatesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['templates'] = templates .map((PostfixTemplateDescriptor value) => value.toJson()) .toList(); @@ -10235,23 +8244,13 @@ class EditListPostfixCompletionTemplatesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditOrganizeDirectivesParams implements RequestParams { - String _file; - /// The Dart file to organize directives in. - String get file => _file; + String file; - /// The Dart file to organize directives in. - set file(String value) { - assert(value != null); - _file = value; - } - - EditOrganizeDirectivesParams(String file) { - this.file = file; - } + EditOrganizeDirectivesParams(this.file); factory EditOrganizeDirectivesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10273,8 +8272,8 @@ class EditOrganizeDirectivesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -10311,25 +8310,14 @@ class EditOrganizeDirectivesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditOrganizeDirectivesResult implements ResponseResult { - SourceFileEdit _edit; - /// The file edit that is to be applied to the given file to effect the /// organizing. - SourceFileEdit get edit => _edit; + SourceFileEdit edit; - /// The file edit that is to be applied to the given file to effect the - /// organizing. - set edit(SourceFileEdit value) { - assert(value != null); - _edit = value; - } - - EditOrganizeDirectivesResult(SourceFileEdit edit) { - this.edit = edit; - } + EditOrganizeDirectivesResult(this.edit); factory EditOrganizeDirectivesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceFileEdit edit; @@ -10354,8 +8342,8 @@ class EditOrganizeDirectivesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edit'] = edit.toJson(); return result; } @@ -10392,23 +8380,13 @@ class EditOrganizeDirectivesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class EditSortMembersParams implements RequestParams { - String _file; - /// The Dart file to sort. - String get file => _file; + String file; - /// The Dart file to sort. - set file(String value) { - assert(value != null); - _file = value; - } - - EditSortMembersParams(String file) { - this.file = file; - } + EditSortMembersParams(this.file); factory EditSortMembersParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10429,8 +8407,8 @@ class EditSortMembersParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -10467,25 +8445,14 @@ class EditSortMembersParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class EditSortMembersResult implements ResponseResult { - SourceFileEdit _edit; - /// The file edit that is to be applied to the given file to effect the /// sorting. - SourceFileEdit get edit => _edit; + SourceFileEdit edit; - /// The file edit that is to be applied to the given file to effect the - /// sorting. - set edit(SourceFileEdit value) { - assert(value != null); - _edit = value; - } - - EditSortMembersResult(SourceFileEdit edit) { - this.edit = edit; - } + EditSortMembersResult(this.edit); factory EditSortMembersResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceFileEdit edit; @@ -10509,8 +8476,8 @@ class EditSortMembersResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['edit'] = edit.toJson(); return result; } @@ -10557,119 +8524,37 @@ class EditSortMembersResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ElementDeclaration implements HasToJson { - String _name; - - ElementKind _kind; - - int _fileIndex; - - int _offset; - - int _line; - - int _column; - - int _codeOffset; - - int _codeLength; - - String _className; - - String _mixinName; - - String _parameters; - /// The name of the declaration. - String get name => _name; - - /// The name of the declaration. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The kind of the element that corresponds to the declaration. - ElementKind get kind => _kind; - - /// The kind of the element that corresponds to the declaration. - set kind(ElementKind value) { - assert(value != null); - _kind = value; - } + ElementKind kind; /// The index of the file (in the enclosing response). - int get fileIndex => _fileIndex; - - /// The index of the file (in the enclosing response). - set fileIndex(int value) { - assert(value != null); - _fileIndex = value; - } + int fileIndex; /// The offset of the declaration name in the file. - int get offset => _offset; - - /// The offset of the declaration name in the file. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The one-based index of the line containing the declaration name. - int get line => _line; - - /// The one-based index of the line containing the declaration name. - set line(int value) { - assert(value != null); - _line = value; - } + int line; /// The one-based index of the column containing the declaration name. - int get column => _column; - - /// The one-based index of the column containing the declaration name. - set column(int value) { - assert(value != null); - _column = value; - } + int column; /// The offset of the first character of the declaration code in the file. - int get codeOffset => _codeOffset; - - /// The offset of the first character of the declaration code in the file. - set codeOffset(int value) { - assert(value != null); - _codeOffset = value; - } + int codeOffset; /// The length of the declaration code in the file. - int get codeLength => _codeLength; - - /// The length of the declaration code in the file. - set codeLength(int value) { - assert(value != null); - _codeLength = value; - } + int codeLength; /// The name of the class enclosing this declaration. If the declaration is /// not a class member, this field will be absent. - String get className => _className; - - /// The name of the class enclosing this declaration. If the declaration is - /// not a class member, this field will be absent. - set className(String value) { - _className = value; - } + String? className; /// The name of the mixin enclosing this declaration. If the declaration is /// not a mixin member, this field will be absent. - String get mixinName => _mixinName; - - /// The name of the mixin enclosing this declaration. If the declaration is - /// not a mixin member, this field will be absent. - set mixinName(String value) { - _mixinName = value; - } + String? mixinName; /// The parameter list for the element. If the element is not a method or /// function this field will not be defined. If the element doesn't have @@ -10677,36 +8562,14 @@ class ElementDeclaration implements HasToJson { /// has zero parameters, this field will have a value of "()". The value /// should not be treated as exact presentation of parameters, it is just /// approximation of parameters to give the user general idea. - String get parameters => _parameters; + String? parameters; - /// The parameter list for the element. If the element is not a method or - /// function this field will not be defined. If the element doesn't have - /// parameters (e.g. getter), this field will not be defined. If the element - /// has zero parameters, this field will have a value of "()". The value - /// should not be treated as exact presentation of parameters, it is just - /// approximation of parameters to give the user general idea. - set parameters(String value) { - _parameters = value; - } - - ElementDeclaration(String name, ElementKind kind, int fileIndex, int offset, - int line, int column, int codeOffset, int codeLength, - {String className, String mixinName, String parameters}) { - this.name = name; - this.kind = kind; - this.fileIndex = fileIndex; - this.offset = offset; - this.line = line; - this.column = column; - this.codeOffset = codeOffset; - this.codeLength = codeLength; - this.className = className; - this.mixinName = mixinName; - this.parameters = parameters; - } + ElementDeclaration(this.name, this.kind, this.fileIndex, this.offset, + this.line, this.column, this.codeOffset, this.codeLength, + {this.className, this.mixinName, this.parameters}); factory ElementDeclaration.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -10761,17 +8624,17 @@ class ElementDeclaration implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'codeLength'); } - String className; + String? className; if (json.containsKey('className')) { className = jsonDecoder.decodeString( jsonPath + '.className', json['className']); } - String mixinName; + String? mixinName; if (json.containsKey('mixinName')) { mixinName = jsonDecoder.decodeString( jsonPath + '.mixinName', json['mixinName']); } - String parameters; + String? parameters; if (json.containsKey('parameters')) { parameters = jsonDecoder.decodeString( jsonPath + '.parameters', json['parameters']); @@ -10785,8 +8648,8 @@ class ElementDeclaration implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['kind'] = kind.toJson(); result['fileIndex'] = fileIndex; @@ -10795,12 +8658,15 @@ class ElementDeclaration implements HasToJson { result['column'] = column; result['codeOffset'] = codeOffset; result['codeLength'] = codeLength; + var className = this.className; if (className != null) { result['className'] = className; } + var mixinName = this.mixinName; if (mixinName != null) { result['mixinName'] = mixinName; } + var parameters = this.parameters; if (parameters != null) { result['parameters'] = parameters; } @@ -10855,35 +8721,16 @@ class ElementDeclaration implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExecutableFile implements HasToJson { - String _file; - - ExecutableKind _kind; - /// The path of the executable file. - String get file => _file; - - /// The path of the executable file. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The kind of the executable file. - ExecutableKind get kind => _kind; + ExecutableKind kind; - /// The kind of the executable file. - set kind(ExecutableKind value) { - assert(value != null); - _kind = value; - } - - ExecutableFile(String file, ExecutableKind kind) { - this.file = file; - this.kind = kind; - } + ExecutableFile(this.file, this.kind); factory ExecutableFile.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -10906,8 +8753,8 @@ class ExecutableFile implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['kind'] = kind.toJson(); return result; @@ -10981,7 +8828,7 @@ class ExecutableKind implements Enum { } factory ExecutableKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ExecutableKind(json); @@ -11006,25 +8853,14 @@ class ExecutableKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ExecutionCreateContextParams implements RequestParams { - String _contextRoot; - /// The path of the Dart or HTML file that will be launched, or the path of /// the directory containing the file. - String get contextRoot => _contextRoot; + String contextRoot; - /// The path of the Dart or HTML file that will be launched, or the path of - /// the directory containing the file. - set contextRoot(String value) { - assert(value != null); - _contextRoot = value; - } - - ExecutionCreateContextParams(String contextRoot) { - this.contextRoot = contextRoot; - } + ExecutionCreateContextParams(this.contextRoot); factory ExecutionCreateContextParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String contextRoot; @@ -11047,8 +8883,8 @@ class ExecutionCreateContextParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['contextRoot'] = contextRoot; return result; } @@ -11085,23 +8921,13 @@ class ExecutionCreateContextParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ExecutionCreateContextResult implements ResponseResult { - String _id; - /// The identifier used to refer to the execution context that was created. - String get id => _id; + String id; - /// The identifier used to refer to the execution context that was created. - set id(String value) { - assert(value != null); - _id = value; - } - - ExecutionCreateContextResult(String id) { - this.id = id; - } + ExecutionCreateContextResult(this.id); factory ExecutionCreateContextResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -11125,8 +8951,8 @@ class ExecutionCreateContextResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -11163,23 +8989,13 @@ class ExecutionCreateContextResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExecutionDeleteContextParams implements RequestParams { - String _id; - /// The identifier of the execution context that is to be deleted. - String get id => _id; + String id; - /// The identifier of the execution context that is to be deleted. - set id(String value) { - assert(value != null); - _id = value; - } - - ExecutionDeleteContextParams(String id) { - this.id = id; - } + ExecutionDeleteContextParams(this.id); factory ExecutionDeleteContextParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -11201,8 +9017,8 @@ class ExecutionDeleteContextParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -11236,7 +9052,7 @@ class ExecutionDeleteContextParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ExecutionDeleteContextResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -11270,72 +9086,25 @@ class ExecutionDeleteContextResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExecutionGetSuggestionsParams implements RequestParams { - String _code; - - int _offset; - - String _contextFile; - - int _contextOffset; - - List _variables; - - List _expressions; - /// The code to get suggestions in. - String get code => _code; - - /// The code to get suggestions in. - set code(String value) { - assert(value != null); - _code = value; - } + String code; /// The offset within the code to get suggestions at. - int get offset => _offset; - - /// The offset within the code to get suggestions at. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The path of the context file, e.g. the file of the current debugger /// frame. The combination of the context file and context offset can be used /// to ensure that all variables of the context are available for completion /// (with their static types). - String get contextFile => _contextFile; - - /// The path of the context file, e.g. the file of the current debugger - /// frame. The combination of the context file and context offset can be used - /// to ensure that all variables of the context are available for completion - /// (with their static types). - set contextFile(String value) { - assert(value != null); - _contextFile = value; - } + String contextFile; /// The offset in the context file, e.g. the line offset in the current /// debugger frame. - int get contextOffset => _contextOffset; - - /// The offset in the context file, e.g. the line offset in the current - /// debugger frame. - set contextOffset(int value) { - assert(value != null); - _contextOffset = value; - } + int contextOffset; /// The runtime context variables that are potentially referenced in the /// code. - List get variables => _variables; - - /// The runtime context variables that are potentially referenced in the - /// code. - set variables(List value) { - assert(value != null); - _variables = value; - } + List variables; /// The list of sub-expressions in the code for which the client wants to /// provide runtime types. It does not have to be the full list of @@ -11346,34 +9115,14 @@ class ExecutionGetSuggestionsParams implements RequestParams { /// only when there are no interesting sub-expressions in the given code. The /// client may provide an empty list, in this case the server will return /// completion suggestions. - List get expressions => _expressions; + List? expressions; - /// The list of sub-expressions in the code for which the client wants to - /// provide runtime types. It does not have to be the full list of - /// expressions requested by the server, for missing expressions their static - /// types will be used. - /// - /// When this field is omitted, the server will return completion suggestions - /// only when there are no interesting sub-expressions in the given code. The - /// client may provide an empty list, in this case the server will return - /// completion suggestions. - set expressions(List value) { - _expressions = value; - } - - ExecutionGetSuggestionsParams(String code, int offset, String contextFile, - int contextOffset, List variables, - {List expressions}) { - this.code = code; - this.offset = offset; - this.contextFile = contextFile; - this.contextOffset = contextOffset; - this.variables = variables; - this.expressions = expressions; - } + ExecutionGetSuggestionsParams(this.code, this.offset, this.contextFile, + this.contextOffset, this.variables, + {this.expressions}); factory ExecutionGetSuggestionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String code; @@ -11407,18 +9156,18 @@ class ExecutionGetSuggestionsParams implements RequestParams { variables = jsonDecoder.decodeList( jsonPath + '.variables', json['variables'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionVariable.fromJson( jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'variables'); } - List expressions; + List? expressions; if (json.containsKey('expressions')) { expressions = jsonDecoder.decodeList( jsonPath + '.expressions', json['expressions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpression.fromJson( jsonDecoder, jsonPath, json)); } @@ -11437,8 +9186,8 @@ class ExecutionGetSuggestionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['code'] = code; result['offset'] = offset; result['contextFile'] = contextFile; @@ -11446,6 +9195,7 @@ class ExecutionGetSuggestionsParams implements RequestParams { result['variables'] = variables .map((RuntimeCompletionVariable value) => value.toJson()) .toList(); + var expressions = this.expressions; if (expressions != null) { result['expressions'] = expressions .map((RuntimeCompletionExpression value) => value.toJson()) @@ -11505,10 +9255,6 @@ class ExecutionGetSuggestionsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ExecutionGetSuggestionsResult implements ResponseResult { - List _suggestions; - - List _expressions; - /// The completion suggestions. In contrast to usual completion request, /// suggestions for private elements also will be provided. /// @@ -11517,59 +9263,34 @@ class ExecutionGetSuggestionsResult implements ResponseResult { /// their actual runtime types can improve completion results, the server /// omits this field in the response, and instead will return the /// "expressions" field. - List get suggestions => _suggestions; - - /// The completion suggestions. In contrast to usual completion request, - /// suggestions for private elements also will be provided. - /// - /// If there are sub-expressions that can have different runtime types, and - /// are considered to be safe to evaluate at runtime (e.g. getters), so using - /// their actual runtime types can improve completion results, the server - /// omits this field in the response, and instead will return the - /// "expressions" field. - set suggestions(List value) { - _suggestions = value; - } + List? suggestions; /// The list of sub-expressions in the code for which the server would like /// to know runtime types to provide better completion suggestions. /// /// This field is omitted the field "suggestions" is returned. - List get expressions => _expressions; + List? expressions; - /// The list of sub-expressions in the code for which the server would like - /// to know runtime types to provide better completion suggestions. - /// - /// This field is omitted the field "suggestions" is returned. - set expressions(List value) { - _expressions = value; - } - - ExecutionGetSuggestionsResult( - {List suggestions, - List expressions}) { - this.suggestions = suggestions; - this.expressions = expressions; - } + ExecutionGetSuggestionsResult({this.suggestions, this.expressions}); factory ExecutionGetSuggestionsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List suggestions; + List? suggestions; if (json.containsKey('suggestions')) { suggestions = jsonDecoder.decodeList( jsonPath + '.suggestions', json['suggestions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json)); } - List expressions; + List? expressions; if (json.containsKey('expressions')) { expressions = jsonDecoder.decodeList( jsonPath + '.expressions', json['expressions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpression.fromJson( jsonDecoder, jsonPath, json)); } @@ -11589,13 +9310,15 @@ class ExecutionGetSuggestionsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var suggestions = this.suggestions; if (suggestions != null) { result['suggestions'] = suggestions .map((CompletionSuggestion value) => value.toJson()) .toList(); } + var expressions = this.expressions; if (expressions != null) { result['expressions'] = expressions .map((RuntimeCompletionExpression value) => value.toJson()) @@ -11645,52 +9368,22 @@ class ExecutionGetSuggestionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExecutionLaunchDataParams implements HasToJson { - String _file; - - ExecutableKind _kind; - - List _referencedFiles; - /// The file for which launch data is being provided. This will either be a /// Dart library or an HTML file. - String get file => _file; - - /// The file for which launch data is being provided. This will either be a - /// Dart library or an HTML file. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The kind of the executable file. This field is omitted if the file is not /// a Dart file. - ExecutableKind get kind => _kind; - - /// The kind of the executable file. This field is omitted if the file is not - /// a Dart file. - set kind(ExecutableKind value) { - _kind = value; - } + ExecutableKind? kind; /// A list of the Dart files that are referenced by the file. This field is /// omitted if the file is not an HTML file. - List get referencedFiles => _referencedFiles; + List? referencedFiles; - /// A list of the Dart files that are referenced by the file. This field is - /// omitted if the file is not an HTML file. - set referencedFiles(List value) { - _referencedFiles = value; - } - - ExecutionLaunchDataParams(String file, - {ExecutableKind kind, List referencedFiles}) { - this.file = file; - this.kind = kind; - this.referencedFiles = referencedFiles; - } + ExecutionLaunchDataParams(this.file, {this.kind, this.referencedFiles}); factory ExecutionLaunchDataParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -11699,12 +9392,12 @@ class ExecutionLaunchDataParams implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'file'); } - ExecutableKind kind; + ExecutableKind? kind; if (json.containsKey('kind')) { kind = ExecutableKind.fromJson( jsonDecoder, jsonPath + '.kind', json['kind']); } - List referencedFiles; + List? referencedFiles; if (json.containsKey('referencedFiles')) { referencedFiles = jsonDecoder.decodeList(jsonPath + '.referencedFiles', json['referencedFiles'], jsonDecoder.decodeString); @@ -11723,12 +9416,14 @@ class ExecutionLaunchDataParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; + var kind = this.kind; if (kind != null) { result['kind'] = kind.toJson(); } + var referencedFiles = this.referencedFiles; if (referencedFiles != null) { result['referencedFiles'] = referencedFiles; } @@ -11773,45 +9468,19 @@ class ExecutionLaunchDataParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExecutionMapUriParams implements RequestParams { - String _id; - - String _file; - - String _uri; - /// The identifier of the execution context in which the URI is to be mapped. - String get id => _id; - - /// The identifier of the execution context in which the URI is to be mapped. - set id(String value) { - assert(value != null); - _id = value; - } + String id; /// The path of the file to be mapped into a URI. - String get file => _file; - - /// The path of the file to be mapped into a URI. - set file(String value) { - _file = value; - } + String? file; /// The URI to be mapped into a file path. - String get uri => _uri; + String? uri; - /// The URI to be mapped into a file path. - set uri(String value) { - _uri = value; - } - - ExecutionMapUriParams(String id, {String file, String uri}) { - this.id = id; - this.file = file; - this.uri = uri; - } + ExecutionMapUriParams(this.id, {this.file, this.uri}); factory ExecutionMapUriParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -11820,11 +9489,11 @@ class ExecutionMapUriParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'id'); } - String file; + String? file; if (json.containsKey('file')) { file = jsonDecoder.decodeString(jsonPath + '.file', json['file']); } - String uri; + String? uri; if (json.containsKey('uri')) { uri = jsonDecoder.decodeString(jsonPath + '.uri', json['uri']); } @@ -11840,12 +9509,14 @@ class ExecutionMapUriParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; + var file = this.file; if (file != null) { result['file'] = file; } + var uri = this.uri; if (uri != null) { result['uri'] = uri; } @@ -11887,44 +9558,25 @@ class ExecutionMapUriParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ExecutionMapUriResult implements ResponseResult { - String _file; - - String _uri; - /// The file to which the URI was mapped. This field is omitted if the uri /// field was not given in the request. - String get file => _file; - - /// The file to which the URI was mapped. This field is omitted if the uri - /// field was not given in the request. - set file(String value) { - _file = value; - } + String? file; /// The URI to which the file path was mapped. This field is omitted if the /// file field was not given in the request. - String get uri => _uri; + String? uri; - /// The URI to which the file path was mapped. This field is omitted if the - /// file field was not given in the request. - set uri(String value) { - _uri = value; - } - - ExecutionMapUriResult({String file, String uri}) { - this.file = file; - this.uri = uri; - } + ExecutionMapUriResult({this.file, this.uri}); factory ExecutionMapUriResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String file; + String? file; if (json.containsKey('file')) { file = jsonDecoder.decodeString(jsonPath + '.file', json['file']); } - String uri; + String? uri; if (json.containsKey('uri')) { uri = jsonDecoder.decodeString(jsonPath + '.uri', json['uri']); } @@ -11942,11 +9594,13 @@ class ExecutionMapUriResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var file = this.file; if (file != null) { result['file'] = file; } + var uri = this.uri; if (uri != null) { result['uri'] = uri; } @@ -12005,7 +9659,7 @@ class ExecutionService implements Enum { } factory ExecutionService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ExecutionService(json); @@ -12030,23 +9684,13 @@ class ExecutionService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ExecutionSetSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - ExecutionSetSubscriptionsParams(List subscriptions) { - this.subscriptions = subscriptions; - } + ExecutionSetSubscriptionsParams(this.subscriptions); factory ExecutionSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -12054,7 +9698,7 @@ class ExecutionSetSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ExecutionService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -12072,8 +9716,8 @@ class ExecutionSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions.map((ExecutionService value) => value.toJson()).toList(); return result; @@ -12109,7 +9753,7 @@ class ExecutionSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ExecutionSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -12139,37 +9783,17 @@ class ExecutionSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ExistingImport implements HasToJson { - int _uri; - - List _elements; - /// The URI of the imported library. It is an index in the strings field, in /// the enclosing ExistingImports and its ImportedElementSet object. - int get uri => _uri; - - /// The URI of the imported library. It is an index in the strings field, in - /// the enclosing ExistingImports and its ImportedElementSet object. - set uri(int value) { - assert(value != null); - _uri = value; - } + int uri; /// The list of indexes of elements, in the enclosing ExistingImports object. - List get elements => _elements; + List elements; - /// The list of indexes of elements, in the enclosing ExistingImports object. - set elements(List value) { - assert(value != null); - _elements = value; - } - - ExistingImport(int uri, List elements) { - this.uri = uri; - this.elements = elements; - } + ExistingImport(this.uri, this.elements); factory ExistingImport.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int uri; @@ -12192,8 +9816,8 @@ class ExistingImport implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['uri'] = uri; result['elements'] = elements; return result; @@ -12229,35 +9853,16 @@ class ExistingImport implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExistingImports implements HasToJson { - ImportedElementSet _elements; - - List _imports; - /// The set of all unique imported elements for all imports. - ImportedElementSet get elements => _elements; - - /// The set of all unique imported elements for all imports. - set elements(ImportedElementSet value) { - assert(value != null); - _elements = value; - } + ImportedElementSet elements; /// The list of imports in the library. - List get imports => _imports; + List imports; - /// The list of imports in the library. - set imports(List value) { - assert(value != null); - _imports = value; - } - - ExistingImports(ImportedElementSet elements, List imports) { - this.elements = elements; - this.imports = imports; - } + ExistingImports(this.elements, this.imports); factory ExistingImports.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ImportedElementSet elements; @@ -12272,7 +9877,7 @@ class ExistingImports implements HasToJson { imports = jsonDecoder.decodeList( jsonPath + '.imports', json['imports'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ExistingImport.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'imports'); @@ -12284,8 +9889,8 @@ class ExistingImports implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['elements'] = elements.toJson(); result['imports'] = imports.map((ExistingImport value) => value.toJson()).toList(); @@ -12326,94 +9931,42 @@ class ExistingImports implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ExtractLocalVariableFeedback extends RefactoringFeedback { - List _coveringExpressionOffsets; - - List _coveringExpressionLengths; - - List _names; - - List _offsets; - - List _lengths; - /// The offsets of the expressions that cover the specified selection, from /// the down most to the up most. - List get coveringExpressionOffsets => _coveringExpressionOffsets; - - /// The offsets of the expressions that cover the specified selection, from - /// the down most to the up most. - set coveringExpressionOffsets(List value) { - _coveringExpressionOffsets = value; - } + List? coveringExpressionOffsets; /// The lengths of the expressions that cover the specified selection, from /// the down most to the up most. - List get coveringExpressionLengths => _coveringExpressionLengths; - - /// The lengths of the expressions that cover the specified selection, from - /// the down most to the up most. - set coveringExpressionLengths(List value) { - _coveringExpressionLengths = value; - } + List? coveringExpressionLengths; /// The proposed names for the local variable. - List get names => _names; - - /// The proposed names for the local variable. - set names(List value) { - assert(value != null); - _names = value; - } + List names; /// The offsets of the expressions that would be replaced by a reference to /// the variable. - List get offsets => _offsets; - - /// The offsets of the expressions that would be replaced by a reference to - /// the variable. - set offsets(List value) { - assert(value != null); - _offsets = value; - } + List offsets; /// The lengths of the expressions that would be replaced by a reference to /// the variable. The lengths correspond to the offsets. In other words, for /// a given expression, if the offset of that expression is offsets[i], then /// the length of that expression is lengths[i]. - List get lengths => _lengths; + List lengths; - /// The lengths of the expressions that would be replaced by a reference to - /// the variable. The lengths correspond to the offsets. In other words, for - /// a given expression, if the offset of that expression is offsets[i], then - /// the length of that expression is lengths[i]. - set lengths(List value) { - assert(value != null); - _lengths = value; - } - - ExtractLocalVariableFeedback( - List names, List offsets, List lengths, - {List coveringExpressionOffsets, - List coveringExpressionLengths}) { - this.coveringExpressionOffsets = coveringExpressionOffsets; - this.coveringExpressionLengths = coveringExpressionLengths; - this.names = names; - this.offsets = offsets; - this.lengths = lengths; - } + ExtractLocalVariableFeedback(this.names, this.offsets, this.lengths, + {this.coveringExpressionOffsets, this.coveringExpressionLengths}); factory ExtractLocalVariableFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List coveringExpressionOffsets; + List? coveringExpressionOffsets; if (json.containsKey('coveringExpressionOffsets')) { coveringExpressionOffsets = jsonDecoder.decodeList( jsonPath + '.coveringExpressionOffsets', json['coveringExpressionOffsets'], jsonDecoder.decodeInt); } - List coveringExpressionLengths; + List? coveringExpressionLengths; if (json.containsKey('coveringExpressionLengths')) { coveringExpressionLengths = jsonDecoder.decodeList( jsonPath + '.coveringExpressionLengths', @@ -12451,11 +10004,13 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var coveringExpressionOffsets = this.coveringExpressionOffsets; if (coveringExpressionOffsets != null) { result['coveringExpressionOffsets'] = coveringExpressionOffsets; } + var coveringExpressionLengths = this.coveringExpressionLengths; if (coveringExpressionLengths != null) { result['coveringExpressionLengths'] = coveringExpressionLengths; } @@ -12503,41 +10058,19 @@ class ExtractLocalVariableFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class ExtractLocalVariableOptions extends RefactoringOptions { - String _name; - - bool _extractAll; - /// The name that the local variable should be given. - String get name => _name; - - /// The name that the local variable should be given. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// True if all occurrences of the expression within the scope in which the /// variable will be defined should be replaced by a reference to the local /// variable. The expression used to initiate the refactoring will always be /// replaced. - bool get extractAll => _extractAll; + bool extractAll; - /// True if all occurrences of the expression within the scope in which the - /// variable will be defined should be replaced by a reference to the local - /// variable. The expression used to initiate the refactoring will always be - /// replaced. - set extractAll(bool value) { - assert(value != null); - _extractAll = value; - } - - ExtractLocalVariableOptions(String name, bool extractAll) { - this.name = name; - this.extractAll = extractAll; - } + ExtractLocalVariableOptions(this.name, this.extractAll); factory ExtractLocalVariableOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -12567,8 +10100,8 @@ class ExtractLocalVariableOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['extractAll'] = extractAll; return result; @@ -12609,129 +10142,42 @@ class ExtractLocalVariableOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class ExtractMethodFeedback extends RefactoringFeedback { - int _offset; - - int _length; - - String _returnType; - - List _names; - - bool _canCreateGetter; - - List _parameters; - - List _offsets; - - List _lengths; - /// The offset to the beginning of the expression or statements that will be /// extracted. - int get offset => _offset; - - /// The offset to the beginning of the expression or statements that will be - /// extracted. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the expression or statements that will be extracted. - int get length => _length; - - /// The length of the expression or statements that will be extracted. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The proposed return type for the method. If the returned element does not /// have a declared return type, this field will contain an empty string. - String get returnType => _returnType; - - /// The proposed return type for the method. If the returned element does not - /// have a declared return type, this field will contain an empty string. - set returnType(String value) { - assert(value != null); - _returnType = value; - } + String returnType; /// The proposed names for the method. - List get names => _names; - - /// The proposed names for the method. - set names(List value) { - assert(value != null); - _names = value; - } + List names; /// True if a getter could be created rather than a method. - bool get canCreateGetter => _canCreateGetter; - - /// True if a getter could be created rather than a method. - set canCreateGetter(bool value) { - assert(value != null); - _canCreateGetter = value; - } + bool canCreateGetter; /// The proposed parameters for the method. - List get parameters => _parameters; - - /// The proposed parameters for the method. - set parameters(List value) { - assert(value != null); - _parameters = value; - } + List parameters; /// The offsets of the expressions or statements that would be replaced by an /// invocation of the method. - List get offsets => _offsets; - - /// The offsets of the expressions or statements that would be replaced by an - /// invocation of the method. - set offsets(List value) { - assert(value != null); - _offsets = value; - } + List offsets; /// The lengths of the expressions or statements that would be replaced by an /// invocation of the method. The lengths correspond to the offsets. In other /// words, for a given expression (or block of statements), if the offset of /// that expression is offsets[i], then the length of that expression is /// lengths[i]. - List get lengths => _lengths; + List lengths; - /// The lengths of the expressions or statements that would be replaced by an - /// invocation of the method. The lengths correspond to the offsets. In other - /// words, for a given expression (or block of statements), if the offset of - /// that expression is offsets[i], then the length of that expression is - /// lengths[i]. - set lengths(List value) { - assert(value != null); - _lengths = value; - } - - ExtractMethodFeedback( - int offset, - int length, - String returnType, - List names, - bool canCreateGetter, - List parameters, - List offsets, - List lengths) { - this.offset = offset; - this.length = length; - this.returnType = returnType; - this.names = names; - this.canCreateGetter = canCreateGetter; - this.parameters = parameters; - this.offsets = offsets; - this.lengths = lengths; - } + ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, + this.canCreateGetter, this.parameters, this.offsets, this.lengths); factory ExtractMethodFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -12772,7 +10218,7 @@ class ExtractMethodFeedback extends RefactoringFeedback { parameters = jsonDecoder.decodeList( jsonPath + '.parameters', json['parameters'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringMethodParameter.fromJson( jsonDecoder, jsonPath, json)); } else { @@ -12800,8 +10246,8 @@ class ExtractMethodFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['returnType'] = returnType; @@ -12864,44 +10310,15 @@ class ExtractMethodFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class ExtractMethodOptions extends RefactoringOptions { - String _returnType; - - bool _createGetter; - - String _name; - - List _parameters; - - bool _extractAll; - /// The return type that should be defined for the method. - String get returnType => _returnType; - - /// The return type that should be defined for the method. - set returnType(String value) { - assert(value != null); - _returnType = value; - } + String returnType; /// True if a getter should be created rather than a method. It is an error /// if this field is true and the list of parameters is non-empty. - bool get createGetter => _createGetter; - - /// True if a getter should be created rather than a method. It is an error - /// if this field is true and the list of parameters is non-empty. - set createGetter(bool value) { - assert(value != null); - _createGetter = value; - } + bool createGetter; /// The name that the method should be given. - String get name => _name; - - /// The name that the method should be given. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The parameters that should be defined for the method. /// @@ -12913,47 +10330,18 @@ class ExtractMethodOptions extends RefactoringOptions { /// with the same identifiers as proposed. /// - To add new parameters, omit their identifier. /// - To remove some parameters, omit them in this list. - List get parameters => _parameters; - - /// The parameters that should be defined for the method. - /// - /// It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL - /// parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a - /// NAMED parameter. - /// - /// - To change the order and/or update proposed parameters, add parameters - /// with the same identifiers as proposed. - /// - To add new parameters, omit their identifier. - /// - To remove some parameters, omit them in this list. - set parameters(List value) { - assert(value != null); - _parameters = value; - } + List parameters; /// True if all occurrences of the expression or statements should be /// replaced by an invocation of the method. The expression or statements /// used to initiate the refactoring will always be replaced. - bool get extractAll => _extractAll; + bool extractAll; - /// True if all occurrences of the expression or statements should be - /// replaced by an invocation of the method. The expression or statements - /// used to initiate the refactoring will always be replaced. - set extractAll(bool value) { - assert(value != null); - _extractAll = value; - } - - ExtractMethodOptions(String returnType, bool createGetter, String name, - List parameters, bool extractAll) { - this.returnType = returnType; - this.createGetter = createGetter; - this.name = name; - this.parameters = parameters; - this.extractAll = extractAll; - } + ExtractMethodOptions(this.returnType, this.createGetter, this.name, + this.parameters, this.extractAll); factory ExtractMethodOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String returnType; @@ -12981,7 +10369,7 @@ class ExtractMethodOptions extends RefactoringOptions { parameters = jsonDecoder.decodeList( jsonPath + '.parameters', json['parameters'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RefactoringMethodParameter.fromJson( jsonDecoder, jsonPath, json)); } else { @@ -13008,8 +10396,8 @@ class ExtractMethodOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['returnType'] = returnType; result['createGetter'] = createGetter; result['name'] = name; @@ -13061,7 +10449,7 @@ class ExtractWidgetFeedback extends RefactoringFeedback { ExtractWidgetFeedback(); factory ExtractWidgetFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { return ExtractWidgetFeedback(); @@ -13071,8 +10459,8 @@ class ExtractWidgetFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -13102,23 +10490,13 @@ class ExtractWidgetFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class ExtractWidgetOptions extends RefactoringOptions { - String _name; - /// The name that the widget class should be given. - String get name => _name; + String name; - /// The name that the widget class should be given. - set name(String value) { - assert(value != null); - _name = value; - } - - ExtractWidgetOptions(String name) { - this.name = name; - } + ExtractWidgetOptions(this.name); factory ExtractWidgetOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -13140,8 +10518,8 @@ class ExtractWidgetOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; return result; } @@ -13197,7 +10575,7 @@ class FileKind implements Enum { } factory FileKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FileKind(json); @@ -13223,35 +10601,16 @@ class FileKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterGetWidgetDescriptionParams implements RequestParams { - String _file; - - int _offset; - /// The file where the widget instance is created. - String get file => _file; - - /// The file where the widget instance is created. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset in the file where the widget instance is created. - int get offset => _offset; + int offset; - /// The offset in the file where the widget instance is created. - set offset(int value) { - assert(value != null); - _offset = value; - } - - FlutterGetWidgetDescriptionParams(String file, int offset) { - this.file = file; - this.offset = offset; - } + FlutterGetWidgetDescriptionParams(this.file, this.offset); factory FlutterGetWidgetDescriptionParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -13279,8 +10638,8 @@ class FlutterGetWidgetDescriptionParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; return result; @@ -13319,29 +10678,16 @@ class FlutterGetWidgetDescriptionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class FlutterGetWidgetDescriptionResult implements ResponseResult { - List _properties; - /// The list of properties of the widget. Some of the properties might be /// read only, when their editor is not set. This might be because they have /// type that we don't know how to edit, or for compound properties that work /// as containers for sub-properties. - List get properties => _properties; + List properties; - /// The list of properties of the widget. Some of the properties might be - /// read only, when their editor is not set. This might be because they have - /// type that we don't know how to edit, or for compound properties that work - /// as containers for sub-properties. - set properties(List value) { - assert(value != null); - _properties = value; - } - - FlutterGetWidgetDescriptionResult(List properties) { - this.properties = properties; - } + FlutterGetWidgetDescriptionResult(this.properties); factory FlutterGetWidgetDescriptionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List properties; @@ -13349,7 +10695,7 @@ class FlutterGetWidgetDescriptionResult implements ResponseResult { properties = jsonDecoder.decodeList( jsonPath + '.properties', json['properties'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterWidgetProperty.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'properties'); @@ -13369,8 +10715,8 @@ class FlutterGetWidgetDescriptionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['properties'] = properties .map((FlutterWidgetProperty value) => value.toJson()) .toList(); @@ -13421,178 +10767,65 @@ class FlutterGetWidgetDescriptionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class FlutterOutline implements HasToJson { - FlutterOutlineKind _kind; - - int _offset; - - int _length; - - int _codeOffset; - - int _codeLength; - - String _label; - - Element _dartElement; - - List _attributes; - - String _className; - - String _parentAssociationLabel; - - String _variableName; - - List _children; - /// The kind of the node. - FlutterOutlineKind get kind => _kind; - - /// The kind of the node. - set kind(FlutterOutlineKind value) { - assert(value != null); - _kind = value; - } + FlutterOutlineKind kind; /// The offset of the first character of the element. This is different than /// the offset in the Element, which is the offset of the name of the /// element. It can be used, for example, to map locations in the file back /// to an outline. - int get offset => _offset; - - /// The offset of the first character of the element. This is different than - /// the offset in the Element, which is the offset of the name of the - /// element. It can be used, for example, to map locations in the file back - /// to an outline. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the element. - int get length => _length; - - /// The length of the element. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The offset of the first character of the element code, which is neither /// documentation, nor annotation. - int get codeOffset => _codeOffset; - - /// The offset of the first character of the element code, which is neither - /// documentation, nor annotation. - set codeOffset(int value) { - assert(value != null); - _codeOffset = value; - } + int codeOffset; /// The length of the element code. - int get codeLength => _codeLength; - - /// The length of the element code. - set codeLength(int value) { - assert(value != null); - _codeLength = value; - } + int codeLength; /// The text label of the node children of the node. It is provided for any /// FlutterOutlineKind.GENERIC node, where better information is not /// available. - String get label => _label; - - /// The text label of the node children of the node. It is provided for any - /// FlutterOutlineKind.GENERIC node, where better information is not - /// available. - set label(String value) { - _label = value; - } + String? label; /// If this node is a Dart element, the description of it; omitted otherwise. - Element get dartElement => _dartElement; - - /// If this node is a Dart element, the description of it; omitted otherwise. - set dartElement(Element value) { - _dartElement = value; - } + Element? dartElement; /// Additional attributes for this node, which might be interesting to /// display on the client. These attributes are usually arguments for the /// instance creation or the invocation that created the widget. - List get attributes => _attributes; - - /// Additional attributes for this node, which might be interesting to - /// display on the client. These attributes are usually arguments for the - /// instance creation or the invocation that created the widget. - set attributes(List value) { - _attributes = value; - } + List? attributes; /// If the node creates a new class instance, or a reference to an instance, /// this field has the name of the class. - String get className => _className; - - /// If the node creates a new class instance, or a reference to an instance, - /// this field has the name of the class. - set className(String value) { - _className = value; - } + String? className; /// A short text description how this node is associated with the parent /// node. For example "appBar" or "body" in Scaffold. - String get parentAssociationLabel => _parentAssociationLabel; - - /// A short text description how this node is associated with the parent - /// node. For example "appBar" or "body" in Scaffold. - set parentAssociationLabel(String value) { - _parentAssociationLabel = value; - } + String? parentAssociationLabel; /// If FlutterOutlineKind.VARIABLE, the name of the variable. - String get variableName => _variableName; - - /// If FlutterOutlineKind.VARIABLE, the name of the variable. - set variableName(String value) { - _variableName = value; - } + String? variableName; /// The children of the node. The field will be omitted if the node has no /// children. - List get children => _children; + List? children; - /// The children of the node. The field will be omitted if the node has no - /// children. - set children(List value) { - _children = value; - } - - FlutterOutline(FlutterOutlineKind kind, int offset, int length, - int codeOffset, int codeLength, - {String label, - Element dartElement, - List attributes, - String className, - String parentAssociationLabel, - String variableName, - List children}) { - this.kind = kind; - this.offset = offset; - this.length = length; - this.codeOffset = codeOffset; - this.codeLength = codeLength; - this.label = label; - this.dartElement = dartElement; - this.attributes = attributes; - this.className = className; - this.parentAssociationLabel = parentAssociationLabel; - this.variableName = variableName; - this.children = children; - } + FlutterOutline( + this.kind, this.offset, this.length, this.codeOffset, this.codeLength, + {this.label, + this.dartElement, + this.attributes, + this.className, + this.parentAssociationLabel, + this.variableName, + this.children}); factory FlutterOutline.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { FlutterOutlineKind kind; @@ -13628,45 +10861,45 @@ class FlutterOutline implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'codeLength'); } - String label; + String? label; if (json.containsKey('label')) { label = jsonDecoder.decodeString(jsonPath + '.label', json['label']); } - Element dartElement; + Element? dartElement; if (json.containsKey('dartElement')) { dartElement = Element.fromJson( jsonDecoder, jsonPath + '.dartElement', json['dartElement']); } - List attributes; + List? attributes; if (json.containsKey('attributes')) { attributes = jsonDecoder.decodeList( jsonPath + '.attributes', json['attributes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterOutlineAttribute.fromJson(jsonDecoder, jsonPath, json)); } - String className; + String? className; if (json.containsKey('className')) { className = jsonDecoder.decodeString( jsonPath + '.className', json['className']); } - String parentAssociationLabel; + String? parentAssociationLabel; if (json.containsKey('parentAssociationLabel')) { parentAssociationLabel = jsonDecoder.decodeString( jsonPath + '.parentAssociationLabel', json['parentAssociationLabel']); } - String variableName; + String? variableName; if (json.containsKey('variableName')) { variableName = jsonDecoder.decodeString( jsonPath + '.variableName', json['variableName']); } - List children; + List? children; if (json.containsKey('children')) { children = jsonDecoder.decodeList( jsonPath + '.children', json['children'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterOutline.fromJson(jsonDecoder, jsonPath, json)); } return FlutterOutline(kind, offset, length, codeOffset, codeLength, @@ -13683,33 +10916,40 @@ class FlutterOutline implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); result['offset'] = offset; result['length'] = length; result['codeOffset'] = codeOffset; result['codeLength'] = codeLength; + var label = this.label; if (label != null) { result['label'] = label; } + var dartElement = this.dartElement; if (dartElement != null) { result['dartElement'] = dartElement.toJson(); } + var attributes = this.attributes; if (attributes != null) { result['attributes'] = attributes .map((FlutterOutlineAttribute value) => value.toJson()) .toList(); } + var className = this.className; if (className != null) { result['className'] = className; } + var parentAssociationLabel = this.parentAssociationLabel; if (parentAssociationLabel != null) { result['parentAssociationLabel'] = parentAssociationLabel; } + var variableName = this.variableName; if (variableName != null) { result['variableName'] = variableName; } + var children = this.children; if (children != null) { result['children'] = children.map((FlutterOutline value) => value.toJson()).toList(); @@ -13777,111 +11017,44 @@ class FlutterOutline implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class FlutterOutlineAttribute implements HasToJson { - String _name; - - String _label; - - bool _literalValueBoolean; - - int _literalValueInteger; - - String _literalValueString; - - Location _nameLocation; - - Location _valueLocation; - /// The name of the attribute. - String get name => _name; - - /// The name of the attribute. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The label of the attribute value, usually the Dart code. It might be /// quite long, the client should abbreviate as needed. - String get label => _label; - - /// The label of the attribute value, usually the Dart code. It might be - /// quite long, the client should abbreviate as needed. - set label(String value) { - assert(value != null); - _label = value; - } + String label; /// The boolean literal value of the attribute. This field is absent if the /// value is not a boolean literal. - bool get literalValueBoolean => _literalValueBoolean; - - /// The boolean literal value of the attribute. This field is absent if the - /// value is not a boolean literal. - set literalValueBoolean(bool value) { - _literalValueBoolean = value; - } + bool? literalValueBoolean; /// The integer literal value of the attribute. This field is absent if the /// value is not an integer literal. - int get literalValueInteger => _literalValueInteger; - - /// The integer literal value of the attribute. This field is absent if the - /// value is not an integer literal. - set literalValueInteger(int value) { - _literalValueInteger = value; - } + int? literalValueInteger; /// The string literal value of the attribute. This field is absent if the /// value is not a string literal. - String get literalValueString => _literalValueString; - - /// The string literal value of the attribute. This field is absent if the - /// value is not a string literal. - set literalValueString(String value) { - _literalValueString = value; - } + String? literalValueString; /// If the attribute is a named argument, the location of the name, without /// the colon. - Location get nameLocation => _nameLocation; - - /// If the attribute is a named argument, the location of the name, without - /// the colon. - set nameLocation(Location value) { - _nameLocation = value; - } + Location? nameLocation; /// The location of the value. /// /// This field is always available, but marked optional for backward /// compatibility between new clients with older servers. - Location get valueLocation => _valueLocation; + Location? valueLocation; - /// The location of the value. - /// - /// This field is always available, but marked optional for backward - /// compatibility between new clients with older servers. - set valueLocation(Location value) { - _valueLocation = value; - } - - FlutterOutlineAttribute(String name, String label, - {bool literalValueBoolean, - int literalValueInteger, - String literalValueString, - Location nameLocation, - Location valueLocation}) { - this.name = name; - this.label = label; - this.literalValueBoolean = literalValueBoolean; - this.literalValueInteger = literalValueInteger; - this.literalValueString = literalValueString; - this.nameLocation = nameLocation; - this.valueLocation = valueLocation; - } + FlutterOutlineAttribute(this.name, this.label, + {this.literalValueBoolean, + this.literalValueInteger, + this.literalValueString, + this.nameLocation, + this.valueLocation}); factory FlutterOutlineAttribute.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -13896,27 +11069,27 @@ class FlutterOutlineAttribute implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'label'); } - bool literalValueBoolean; + bool? literalValueBoolean; if (json.containsKey('literalValueBoolean')) { literalValueBoolean = jsonDecoder.decodeBool( jsonPath + '.literalValueBoolean', json['literalValueBoolean']); } - int literalValueInteger; + int? literalValueInteger; if (json.containsKey('literalValueInteger')) { literalValueInteger = jsonDecoder.decodeInt( jsonPath + '.literalValueInteger', json['literalValueInteger']); } - String literalValueString; + String? literalValueString; if (json.containsKey('literalValueString')) { literalValueString = jsonDecoder.decodeString( jsonPath + '.literalValueString', json['literalValueString']); } - Location nameLocation; + Location? nameLocation; if (json.containsKey('nameLocation')) { nameLocation = Location.fromJson( jsonDecoder, jsonPath + '.nameLocation', json['nameLocation']); } - Location valueLocation; + Location? valueLocation; if (json.containsKey('valueLocation')) { valueLocation = Location.fromJson( jsonDecoder, jsonPath + '.valueLocation', json['valueLocation']); @@ -13933,22 +11106,27 @@ class FlutterOutlineAttribute implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['label'] = label; + var literalValueBoolean = this.literalValueBoolean; if (literalValueBoolean != null) { result['literalValueBoolean'] = literalValueBoolean; } + var literalValueInteger = this.literalValueInteger; if (literalValueInteger != null) { result['literalValueInteger'] = literalValueInteger; } + var literalValueString = this.literalValueString; if (literalValueString != null) { result['literalValueString'] = literalValueString; } + var nameLocation = this.nameLocation; if (nameLocation != null) { result['nameLocation'] = nameLocation.toJson(); } + var valueLocation = this.valueLocation; if (valueLocation != null) { result['valueLocation'] = valueLocation.toJson(); } @@ -14057,7 +11235,7 @@ class FlutterOutlineKind implements Enum { } factory FlutterOutlineKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FlutterOutlineKind(json); @@ -14083,35 +11261,16 @@ class FlutterOutlineKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterOutlineParams implements HasToJson { - String _file; - - FlutterOutline _outline; - /// The file with which the outline is associated. - String get file => _file; - - /// The file with which the outline is associated. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The outline associated with the file. - FlutterOutline get outline => _outline; + FlutterOutline outline; - /// The outline associated with the file. - set outline(FlutterOutline value) { - assert(value != null); - _outline = value; - } - - FlutterOutlineParams(String file, FlutterOutline outline) { - this.file = file; - this.outline = outline; - } + FlutterOutlineParams(this.file, this.outline); factory FlutterOutlineParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -14139,8 +11298,8 @@ class FlutterOutlineParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['outline'] = outline.toJson(); return result; @@ -14197,7 +11356,7 @@ class FlutterService implements Enum { } factory FlutterService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FlutterService(json); @@ -14222,35 +11381,23 @@ class FlutterService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterSetSubscriptionsParams implements RequestParams { - Map> _subscriptions; - /// A table mapping services to a list of the files being subscribed to the /// service. - Map> get subscriptions => _subscriptions; + Map> subscriptions; - /// A table mapping services to a list of the files being subscribed to the - /// service. - set subscriptions(Map> value) { - assert(value != null); - _subscriptions = value; - } - - FlutterSetSubscriptionsParams( - Map> subscriptions) { - this.subscriptions = subscriptions; - } + FlutterSetSubscriptionsParams(this.subscriptions); factory FlutterSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Map> subscriptions; if (json.containsKey('subscriptions')) { subscriptions = jsonDecoder.decodeMap( jsonPath + '.subscriptions', json['subscriptions'], - keyDecoder: (String jsonPath, Object json) => + keyDecoder: (String jsonPath, Object? json) => FlutterService.fromJson(jsonDecoder, jsonPath, json), - valueDecoder: (String jsonPath, Object json) => jsonDecoder + valueDecoder: (String jsonPath, Object? json) => jsonDecoder .decodeList(jsonPath, json, jsonDecoder.decodeString)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -14268,8 +11415,8 @@ class FlutterSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = mapMap(subscriptions, keyCallback: (FlutterService value) => value.toJson()); return result; @@ -14308,7 +11455,7 @@ class FlutterSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class FlutterSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -14338,26 +11485,12 @@ class FlutterSetSubscriptionsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class FlutterSetWidgetPropertyValueParams implements RequestParams { - int _id; - - FlutterWidgetPropertyValue _value; - /// The identifier of the property, previously returned as a part of a /// FlutterWidgetProperty. /// /// An error of type FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID is /// generated if the identifier is not valid. - int get id => _id; - - /// The identifier of the property, previously returned as a part of a - /// FlutterWidgetProperty. - /// - /// An error of type FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID is - /// generated if the identifier is not valid. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The new value to set for the property. /// @@ -14368,29 +11501,12 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { /// /// If the expression is not a syntactically valid Dart code, then /// FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION is reported. - FlutterWidgetPropertyValue get value => _value; + FlutterWidgetPropertyValue? value; - /// The new value to set for the property. - /// - /// If absent, indicates that the property should be removed. If the property - /// corresponds to an optional parameter, the corresponding named argument is - /// removed. If the property isRequired is true, - /// FLUTTER_SET_WIDGET_PROPERTY_VALUE_IS_REQUIRED error is generated. - /// - /// If the expression is not a syntactically valid Dart code, then - /// FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION is reported. - set value(FlutterWidgetPropertyValue value) { - _value = value; - } - - FlutterSetWidgetPropertyValueParams(int id, - {FlutterWidgetPropertyValue value}) { - this.id = id; - this.value = value; - } + FlutterSetWidgetPropertyValueParams(this.id, {this.value}); factory FlutterSetWidgetPropertyValueParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int id; @@ -14399,7 +11515,7 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'id'); } - FlutterWidgetPropertyValue value; + FlutterWidgetPropertyValue? value; if (json.containsKey('value')) { value = FlutterWidgetPropertyValue.fromJson( jsonDecoder, jsonPath + '.value', json['value']); @@ -14417,9 +11533,10 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; + var value = this.value; if (value != null) { result['value'] = value.toJson(); } @@ -14459,23 +11576,13 @@ class FlutterSetWidgetPropertyValueParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class FlutterSetWidgetPropertyValueResult implements ResponseResult { - SourceChange _change; - /// The change that should be applied. - SourceChange get change => _change; + SourceChange change; - /// The change that should be applied. - set change(SourceChange value) { - assert(value != null); - _change = value; - } - - FlutterSetWidgetPropertyValueResult(SourceChange change) { - this.change = change; - } + FlutterSetWidgetPropertyValueResult(this.change); factory FlutterSetWidgetPropertyValueResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { SourceChange change; @@ -14500,8 +11607,8 @@ class FlutterSetWidgetPropertyValueResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['change'] = change.toJson(); return result; } @@ -14546,158 +11653,66 @@ class FlutterSetWidgetPropertyValueResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetProperty implements HasToJson { - String _documentation; - - String _expression; - - int _id; - - bool _isRequired; - - bool _isSafeToUpdate; - - String _name; - - List _children; - - FlutterWidgetPropertyEditor _editor; - - FlutterWidgetPropertyValue _value; - /// The documentation of the property to show to the user. Omitted if the /// server does not know the documentation, e.g. because the corresponding /// field is not documented. - String get documentation => _documentation; - - /// The documentation of the property to show to the user. Omitted if the - /// server does not know the documentation, e.g. because the corresponding - /// field is not documented. - set documentation(String value) { - _documentation = value; - } + String? documentation; /// If the value of this property is set, the Dart code of the expression of /// this property. - String get expression => _expression; - - /// If the value of this property is set, the Dart code of the expression of - /// this property. - set expression(String value) { - _expression = value; - } + String? expression; /// The unique identifier of the property, must be passed back to the server /// when updating the property value. Identifiers become invalid on any /// source code change. - int get id => _id; - - /// The unique identifier of the property, must be passed back to the server - /// when updating the property value. Identifiers become invalid on any - /// source code change. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// True if the property is required, e.g. because it corresponds to a /// required parameter of a constructor. - bool get isRequired => _isRequired; - - /// True if the property is required, e.g. because it corresponds to a - /// required parameter of a constructor. - set isRequired(bool value) { - assert(value != null); - _isRequired = value; - } + bool isRequired; /// If the property expression is a concrete value (e.g. a literal, or an /// enum constant), then it is safe to replace the expression with another /// concrete value. In this case this field is true. Otherwise, for example /// when the expression is a reference to a field, so that its value is /// provided from outside, this field is false. - bool get isSafeToUpdate => _isSafeToUpdate; - - /// If the property expression is a concrete value (e.g. a literal, or an - /// enum constant), then it is safe to replace the expression with another - /// concrete value. In this case this field is true. Otherwise, for example - /// when the expression is a reference to a field, so that its value is - /// provided from outside, this field is false. - set isSafeToUpdate(bool value) { - assert(value != null); - _isSafeToUpdate = value; - } + bool isSafeToUpdate; /// The name of the property to display to the user. - String get name => _name; - - /// The name of the property to display to the user. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The list of children properties, if any. For example any property of type /// EdgeInsets will have four children properties of type double - left / top /// / right / bottom. - List get children => _children; - - /// The list of children properties, if any. For example any property of type - /// EdgeInsets will have four children properties of type double - left / top - /// / right / bottom. - set children(List value) { - _children = value; - } + List? children; /// The editor that should be used by the client. This field is omitted if /// the server does not know the editor for this property, for example /// because it does not have one of the supported types. - FlutterWidgetPropertyEditor get editor => _editor; - - /// The editor that should be used by the client. This field is omitted if - /// the server does not know the editor for this property, for example - /// because it does not have one of the supported types. - set editor(FlutterWidgetPropertyEditor value) { - _editor = value; - } + FlutterWidgetPropertyEditor? editor; /// If the expression is set, and the server knows the value of the /// expression, this field is set. - FlutterWidgetPropertyValue get value => _value; - - /// If the expression is set, and the server knows the value of the - /// expression, this field is set. - set value(FlutterWidgetPropertyValue value) { - _value = value; - } + FlutterWidgetPropertyValue? value; FlutterWidgetProperty( - int id, bool isRequired, bool isSafeToUpdate, String name, - {String documentation, - String expression, - List children, - FlutterWidgetPropertyEditor editor, - FlutterWidgetPropertyValue value}) { - this.documentation = documentation; - this.expression = expression; - this.id = id; - this.isRequired = isRequired; - this.isSafeToUpdate = isSafeToUpdate; - this.name = name; - this.children = children; - this.editor = editor; - this.value = value; - } + this.id, this.isRequired, this.isSafeToUpdate, this.name, + {this.documentation, + this.expression, + this.children, + this.editor, + this.value}); factory FlutterWidgetProperty.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String documentation; + String? documentation; if (json.containsKey('documentation')) { documentation = jsonDecoder.decodeString( jsonPath + '.documentation', json['documentation']); } - String expression; + String? expression; if (json.containsKey('expression')) { expression = jsonDecoder.decodeString( jsonPath + '.expression', json['expression']); @@ -14728,20 +11743,20 @@ class FlutterWidgetProperty implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - List children; + List? children; if (json.containsKey('children')) { children = jsonDecoder.decodeList( jsonPath + '.children', json['children'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterWidgetProperty.fromJson(jsonDecoder, jsonPath, json)); } - FlutterWidgetPropertyEditor editor; + FlutterWidgetPropertyEditor? editor; if (json.containsKey('editor')) { editor = FlutterWidgetPropertyEditor.fromJson( jsonDecoder, jsonPath + '.editor', json['editor']); } - FlutterWidgetPropertyValue value; + FlutterWidgetPropertyValue? value; if (json.containsKey('value')) { value = FlutterWidgetPropertyValue.fromJson( jsonDecoder, jsonPath + '.value', json['value']); @@ -14758,11 +11773,13 @@ class FlutterWidgetProperty implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var documentation = this.documentation; if (documentation != null) { result['documentation'] = documentation; } + var expression = this.expression; if (expression != null) { result['expression'] = expression; } @@ -14770,14 +11787,17 @@ class FlutterWidgetProperty implements HasToJson { result['isRequired'] = isRequired; result['isSafeToUpdate'] = isSafeToUpdate; result['name'] = name; + var children = this.children; if (children != null) { result['children'] = children .map((FlutterWidgetProperty value) => value.toJson()) .toList(); } + var editor = this.editor; if (editor != null) { result['editor'] = editor.toJson(); } + var value = this.value; if (value != null) { result['value'] = value.toJson(); } @@ -14829,31 +11849,14 @@ class FlutterWidgetProperty implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetPropertyEditor implements HasToJson { - FlutterWidgetPropertyEditorKind _kind; + FlutterWidgetPropertyEditorKind kind; - List _enumItems; + List? enumItems; - FlutterWidgetPropertyEditorKind get kind => _kind; - - set kind(FlutterWidgetPropertyEditorKind value) { - assert(value != null); - _kind = value; - } - - List get enumItems => _enumItems; - - set enumItems(List value) { - _enumItems = value; - } - - FlutterWidgetPropertyEditor(FlutterWidgetPropertyEditorKind kind, - {List enumItems}) { - this.kind = kind; - this.enumItems = enumItems; - } + FlutterWidgetPropertyEditor(this.kind, {this.enumItems}); factory FlutterWidgetPropertyEditor.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { FlutterWidgetPropertyEditorKind kind; @@ -14863,12 +11866,12 @@ class FlutterWidgetPropertyEditor implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'kind'); } - List enumItems; + List? enumItems; if (json.containsKey('enumItems')) { enumItems = jsonDecoder.decodeList( jsonPath + '.enumItems', json['enumItems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => FlutterWidgetPropertyValueEnumItem.fromJson( jsonDecoder, jsonPath, json)); } @@ -14879,9 +11882,10 @@ class FlutterWidgetPropertyEditor implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['kind'] = kind.toJson(); + var enumItems = this.enumItems; if (enumItems != null) { result['enumItems'] = enumItems .map((FlutterWidgetPropertyValueEnumItem value) => value.toJson()) @@ -14991,7 +11995,7 @@ class FlutterWidgetPropertyEditorKind implements Enum { } factory FlutterWidgetPropertyEditorKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return FlutterWidgetPropertyEditorKind(json); @@ -15022,101 +12026,57 @@ class FlutterWidgetPropertyEditorKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetPropertyValue implements HasToJson { - bool _boolValue; + bool? boolValue; - double _doubleValue; + double? doubleValue; - int _intValue; + int? intValue; - String _stringValue; + String? stringValue; - FlutterWidgetPropertyValueEnumItem _enumValue; - - String _expression; - - bool get boolValue => _boolValue; - - set boolValue(bool value) { - _boolValue = value; - } - - double get doubleValue => _doubleValue; - - set doubleValue(double value) { - _doubleValue = value; - } - - int get intValue => _intValue; - - set intValue(int value) { - _intValue = value; - } - - String get stringValue => _stringValue; - - set stringValue(String value) { - _stringValue = value; - } - - FlutterWidgetPropertyValueEnumItem get enumValue => _enumValue; - - set enumValue(FlutterWidgetPropertyValueEnumItem value) { - _enumValue = value; - } + FlutterWidgetPropertyValueEnumItem? enumValue; /// A free-form expression, which will be used as the value as is. - String get expression => _expression; - - /// A free-form expression, which will be used as the value as is. - set expression(String value) { - _expression = value; - } + String? expression; FlutterWidgetPropertyValue( - {bool boolValue, - double doubleValue, - int intValue, - String stringValue, - FlutterWidgetPropertyValueEnumItem enumValue, - String expression}) { - this.boolValue = boolValue; - this.doubleValue = doubleValue; - this.intValue = intValue; - this.stringValue = stringValue; - this.enumValue = enumValue; - this.expression = expression; - } + {this.boolValue, + this.doubleValue, + this.intValue, + this.stringValue, + this.enumValue, + this.expression}); factory FlutterWidgetPropertyValue.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - bool boolValue; + bool? boolValue; if (json.containsKey('boolValue')) { boolValue = jsonDecoder.decodeBool(jsonPath + '.boolValue', json['boolValue']); } - double doubleValue; + double? doubleValue; if (json.containsKey('doubleValue')) { doubleValue = jsonDecoder.decodeDouble( jsonPath + '.doubleValue', json['doubleValue']); } - int intValue; + int? intValue; if (json.containsKey('intValue')) { intValue = jsonDecoder.decodeInt(jsonPath + '.intValue', json['intValue']); } - String stringValue; + String? stringValue; if (json.containsKey('stringValue')) { stringValue = jsonDecoder.decodeString( jsonPath + '.stringValue', json['stringValue']); } - FlutterWidgetPropertyValueEnumItem enumValue; + FlutterWidgetPropertyValueEnumItem? enumValue; if (json.containsKey('enumValue')) { enumValue = FlutterWidgetPropertyValueEnumItem.fromJson( jsonDecoder, jsonPath + '.enumValue', json['enumValue']); } - String expression; + String? expression; if (json.containsKey('expression')) { expression = jsonDecoder.decodeString( jsonPath + '.expression', json['expression']); @@ -15134,23 +12094,29 @@ class FlutterWidgetPropertyValue implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var boolValue = this.boolValue; if (boolValue != null) { result['boolValue'] = boolValue; } + var doubleValue = this.doubleValue; if (doubleValue != null) { result['doubleValue'] = doubleValue; } + var intValue = this.intValue; if (intValue != null) { result['intValue'] = intValue; } + var stringValue = this.stringValue; if (stringValue != null) { result['stringValue'] = stringValue; } + var enumValue = this.enumValue; if (enumValue != null) { result['enumValue'] = enumValue.toJson(); } + var expression = this.expression; if (expression != null) { result['expression'] = expression; } @@ -15197,70 +12163,28 @@ class FlutterWidgetPropertyValue implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class FlutterWidgetPropertyValueEnumItem implements HasToJson { - String _libraryUri; - - String _className; - - String _name; - - String _documentation; - /// The URI of the library containing the className. When the enum item is /// passed back, this will allow the server to import the corresponding /// library if necessary. - String get libraryUri => _libraryUri; - - /// The URI of the library containing the className. When the enum item is - /// passed back, this will allow the server to import the corresponding - /// library if necessary. - set libraryUri(String value) { - assert(value != null); - _libraryUri = value; - } + String libraryUri; /// The name of the class or enum. - String get className => _className; - - /// The name of the class or enum. - set className(String value) { - assert(value != null); - _className = value; - } + String className; /// The name of the field in the enumeration, or the static field in the /// class. - String get name => _name; - - /// The name of the field in the enumeration, or the static field in the - /// class. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The documentation to show to the user. Omitted if the server does not /// know the documentation, e.g. because the corresponding field is not /// documented. - String get documentation => _documentation; + String? documentation; - /// The documentation to show to the user. Omitted if the server does not - /// know the documentation, e.g. because the corresponding field is not - /// documented. - set documentation(String value) { - _documentation = value; - } - - FlutterWidgetPropertyValueEnumItem( - String libraryUri, String className, String name, - {String documentation}) { - this.libraryUri = libraryUri; - this.className = className; - this.name = name; - this.documentation = documentation; - } + FlutterWidgetPropertyValueEnumItem(this.libraryUri, this.className, this.name, + {this.documentation}); factory FlutterWidgetPropertyValueEnumItem.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String libraryUri; @@ -15283,7 +12207,7 @@ class FlutterWidgetPropertyValueEnumItem implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'name'); } - String documentation; + String? documentation; if (json.containsKey('documentation')) { documentation = jsonDecoder.decodeString( jsonPath + '.documentation', json['documentation']); @@ -15297,11 +12221,12 @@ class FlutterWidgetPropertyValueEnumItem implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['libraryUri'] = libraryUri; result['className'] = className; result['name'] = name; + var documentation = this.documentation; if (documentation != null) { result['documentation'] = documentation; } @@ -15363,7 +12288,7 @@ class GeneralAnalysisService implements Enum { } factory GeneralAnalysisService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return GeneralAnalysisService(json); @@ -15399,195 +12324,76 @@ class GeneralAnalysisService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class HoverInformation implements HasToJson { - int _offset; - - int _length; - - String _containingLibraryPath; - - String _containingLibraryName; - - String _containingClassDescription; - - String _dartdoc; - - String _elementDescription; - - String _elementKind; - - bool _isDeprecated; - - String _parameter; - - String _propagatedType; - - String _staticType; - /// The offset of the range of characters that encompasses the cursor /// position and has the same hover information as the cursor position. - int get offset => _offset; - - /// The offset of the range of characters that encompasses the cursor - /// position and has the same hover information as the cursor position. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the range of characters that encompasses the cursor /// position and has the same hover information as the cursor position. - int get length => _length; - - /// The length of the range of characters that encompasses the cursor - /// position and has the same hover information as the cursor position. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The path to the defining compilation unit of the library in which the /// referenced element is declared. This data is omitted if there is no /// referenced element, or if the element is declared inside an HTML file. - String get containingLibraryPath => _containingLibraryPath; - - /// The path to the defining compilation unit of the library in which the - /// referenced element is declared. This data is omitted if there is no - /// referenced element, or if the element is declared inside an HTML file. - set containingLibraryPath(String value) { - _containingLibraryPath = value; - } + String? containingLibraryPath; /// The URI of the containing library, examples here include "dart:core", /// "package:.." and file uris represented by the path on disk, "/..". The /// data is omitted if the element is declared inside an HTML file. - String get containingLibraryName => _containingLibraryName; - - /// The URI of the containing library, examples here include "dart:core", - /// "package:.." and file uris represented by the path on disk, "/..". The - /// data is omitted if the element is declared inside an HTML file. - set containingLibraryName(String value) { - _containingLibraryName = value; - } + String? containingLibraryName; /// A human-readable description of the class declaring the element being /// referenced. This data is omitted if there is no referenced element, or if /// the element is not a class member. - String get containingClassDescription => _containingClassDescription; - - /// A human-readable description of the class declaring the element being - /// referenced. This data is omitted if there is no referenced element, or if - /// the element is not a class member. - set containingClassDescription(String value) { - _containingClassDescription = value; - } + String? containingClassDescription; /// The dartdoc associated with the referenced element. Other than the /// removal of the comment delimiters, including leading asterisks in the /// case of a block comment, the dartdoc is unprocessed markdown. This data /// is omitted if there is no referenced element, or if the element has no /// dartdoc. - String get dartdoc => _dartdoc; - - /// The dartdoc associated with the referenced element. Other than the - /// removal of the comment delimiters, including leading asterisks in the - /// case of a block comment, the dartdoc is unprocessed markdown. This data - /// is omitted if there is no referenced element, or if the element has no - /// dartdoc. - set dartdoc(String value) { - _dartdoc = value; - } + String? dartdoc; /// A human-readable description of the element being referenced. This data /// is omitted if there is no referenced element. - String get elementDescription => _elementDescription; - - /// A human-readable description of the element being referenced. This data - /// is omitted if there is no referenced element. - set elementDescription(String value) { - _elementDescription = value; - } + String? elementDescription; /// A human-readable description of the kind of element being referenced /// (such as "class" or "function type alias"). This data is omitted if there /// is no referenced element. - String get elementKind => _elementKind; - - /// A human-readable description of the kind of element being referenced - /// (such as "class" or "function type alias"). This data is omitted if there - /// is no referenced element. - set elementKind(String value) { - _elementKind = value; - } + String? elementKind; /// True if the referenced element is deprecated. - bool get isDeprecated => _isDeprecated; - - /// True if the referenced element is deprecated. - set isDeprecated(bool value) { - _isDeprecated = value; - } + bool? isDeprecated; /// A human-readable description of the parameter corresponding to the /// expression being hovered over. This data is omitted if the location is /// not in an argument to a function. - String get parameter => _parameter; - - /// A human-readable description of the parameter corresponding to the - /// expression being hovered over. This data is omitted if the location is - /// not in an argument to a function. - set parameter(String value) { - _parameter = value; - } + String? parameter; /// The name of the propagated type of the expression. This data is omitted /// if the location does not correspond to an expression or if there is no /// propagated type information. - String get propagatedType => _propagatedType; - - /// The name of the propagated type of the expression. This data is omitted - /// if the location does not correspond to an expression or if there is no - /// propagated type information. - set propagatedType(String value) { - _propagatedType = value; - } + String? propagatedType; /// The name of the static type of the expression. This data is omitted if /// the location does not correspond to an expression. - String get staticType => _staticType; + String? staticType; - /// The name of the static type of the expression. This data is omitted if - /// the location does not correspond to an expression. - set staticType(String value) { - _staticType = value; - } - - HoverInformation(int offset, int length, - {String containingLibraryPath, - String containingLibraryName, - String containingClassDescription, - String dartdoc, - String elementDescription, - String elementKind, - bool isDeprecated, - String parameter, - String propagatedType, - String staticType}) { - this.offset = offset; - this.length = length; - this.containingLibraryPath = containingLibraryPath; - this.containingLibraryName = containingLibraryName; - this.containingClassDescription = containingClassDescription; - this.dartdoc = dartdoc; - this.elementDescription = elementDescription; - this.elementKind = elementKind; - this.isDeprecated = isDeprecated; - this.parameter = parameter; - this.propagatedType = propagatedType; - this.staticType = staticType; - } + HoverInformation(this.offset, this.length, + {this.containingLibraryPath, + this.containingLibraryName, + this.containingClassDescription, + this.dartdoc, + this.elementDescription, + this.elementKind, + this.isDeprecated, + this.parameter, + this.propagatedType, + this.staticType}); factory HoverInformation.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -15602,53 +12408,53 @@ class HoverInformation implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'length'); } - String containingLibraryPath; + String? containingLibraryPath; if (json.containsKey('containingLibraryPath')) { containingLibraryPath = jsonDecoder.decodeString( jsonPath + '.containingLibraryPath', json['containingLibraryPath']); } - String containingLibraryName; + String? containingLibraryName; if (json.containsKey('containingLibraryName')) { containingLibraryName = jsonDecoder.decodeString( jsonPath + '.containingLibraryName', json['containingLibraryName']); } - String containingClassDescription; + String? containingClassDescription; if (json.containsKey('containingClassDescription')) { containingClassDescription = jsonDecoder.decodeString( jsonPath + '.containingClassDescription', json['containingClassDescription']); } - String dartdoc; + String? dartdoc; if (json.containsKey('dartdoc')) { dartdoc = jsonDecoder.decodeString(jsonPath + '.dartdoc', json['dartdoc']); } - String elementDescription; + String? elementDescription; if (json.containsKey('elementDescription')) { elementDescription = jsonDecoder.decodeString( jsonPath + '.elementDescription', json['elementDescription']); } - String elementKind; + String? elementKind; if (json.containsKey('elementKind')) { elementKind = jsonDecoder.decodeString( jsonPath + '.elementKind', json['elementKind']); } - bool isDeprecated; + bool? isDeprecated; if (json.containsKey('isDeprecated')) { isDeprecated = jsonDecoder.decodeBool( jsonPath + '.isDeprecated', json['isDeprecated']); } - String parameter; + String? parameter; if (json.containsKey('parameter')) { parameter = jsonDecoder.decodeString( jsonPath + '.parameter', json['parameter']); } - String propagatedType; + String? propagatedType; if (json.containsKey('propagatedType')) { propagatedType = jsonDecoder.decodeString( jsonPath + '.propagatedType', json['propagatedType']); } - String staticType; + String? staticType; if (json.containsKey('staticType')) { staticType = jsonDecoder.decodeString( jsonPath + '.staticType', json['staticType']); @@ -15670,37 +12476,47 @@ class HoverInformation implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; + var containingLibraryPath = this.containingLibraryPath; if (containingLibraryPath != null) { result['containingLibraryPath'] = containingLibraryPath; } + var containingLibraryName = this.containingLibraryName; if (containingLibraryName != null) { result['containingLibraryName'] = containingLibraryName; } + var containingClassDescription = this.containingClassDescription; if (containingClassDescription != null) { result['containingClassDescription'] = containingClassDescription; } + var dartdoc = this.dartdoc; if (dartdoc != null) { result['dartdoc'] = dartdoc; } + var elementDescription = this.elementDescription; if (elementDescription != null) { result['elementDescription'] = elementDescription; } + var elementKind = this.elementKind; if (elementKind != null) { result['elementKind'] = elementKind; } + var isDeprecated = this.isDeprecated; if (isDeprecated != null) { result['isDeprecated'] = isDeprecated; } + var parameter = this.parameter; if (parameter != null) { result['parameter'] = parameter; } + var propagatedType = this.propagatedType; if (propagatedType != null) { result['propagatedType'] = propagatedType; } + var staticType = this.staticType; if (staticType != null) { result['staticType'] = staticType; } @@ -15757,35 +12573,16 @@ class HoverInformation implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImplementedClass implements HasToJson { - int _offset; - - int _length; - /// The offset of the name of the implemented class. - int get offset => _offset; - - /// The offset of the name of the implemented class. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name of the implemented class. - int get length => _length; + int length; - /// The length of the name of the implemented class. - set length(int value) { - assert(value != null); - _length = value; - } - - ImplementedClass(int offset, int length) { - this.offset = offset; - this.length = length; - } + ImplementedClass(this.offset, this.length); factory ImplementedClass.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -15807,8 +12604,8 @@ class ImplementedClass implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; return result; @@ -15843,35 +12640,16 @@ class ImplementedClass implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImplementedMember implements HasToJson { - int _offset; - - int _length; - /// The offset of the name of the implemented member. - int get offset => _offset; - - /// The offset of the name of the implemented member. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name of the implemented member. - int get length => _length; + int length; - /// The length of the name of the implemented member. - set length(int value) { - assert(value != null); - _length = value; - } - - ImplementedMember(int offset, int length) { - this.offset = offset; - this.length = length; - } + ImplementedMember(this.offset, this.length); factory ImplementedMember.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -15893,8 +12671,8 @@ class ImplementedMember implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; return result; @@ -15930,47 +12708,19 @@ class ImplementedMember implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImportedElementSet implements HasToJson { - List _strings; - - List _uris; - - List _names; - /// The list of unique strings in this object. - List get strings => _strings; - - /// The list of unique strings in this object. - set strings(List value) { - assert(value != null); - _strings = value; - } + List strings; /// The library URI part of the element. It is an index in the strings field. - List get uris => _uris; - - /// The library URI part of the element. It is an index in the strings field. - set uris(List value) { - assert(value != null); - _uris = value; - } + List uris; /// The name part of a the element. It is an index in the strings field. - List get names => _names; + List names; - /// The name part of a the element. It is an index in the strings field. - set names(List value) { - assert(value != null); - _names = value; - } - - ImportedElementSet(List strings, List uris, List names) { - this.strings = strings; - this.uris = uris; - this.names = names; - } + ImportedElementSet(this.strings, this.uris, this.names); factory ImportedElementSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List strings; @@ -16001,8 +12751,8 @@ class ImportedElementSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['strings'] = strings; result['uris'] = uris; result['names'] = names; @@ -16043,49 +12793,20 @@ class ImportedElementSet implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ImportedElements implements HasToJson { - String _path; - - String _prefix; - - List _elements; - /// The absolute and normalized path of the file containing the library. - String get path => _path; - - /// The absolute and normalized path of the file containing the library. - set path(String value) { - assert(value != null); - _path = value; - } + String path; /// The prefix that was used when importing the library into the original /// source. - String get prefix => _prefix; - - /// The prefix that was used when importing the library into the original - /// source. - set prefix(String value) { - assert(value != null); - _prefix = value; - } + String prefix; /// The names of the elements imported from the library. - List get elements => _elements; + List elements; - /// The names of the elements imported from the library. - set elements(List value) { - assert(value != null); - _elements = value; - } - - ImportedElements(String path, String prefix, List elements) { - this.path = path; - this.prefix = prefix; - this.elements = elements; - } + ImportedElements(this.path, this.prefix, this.elements); factory ImportedElements.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String path; @@ -16114,8 +12835,8 @@ class ImportedElements implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['path'] = path; result['prefix'] = prefix; result['elements'] = elements; @@ -16154,39 +12875,18 @@ class ImportedElements implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class IncludedSuggestionRelevanceTag implements HasToJson { - String _tag; - - int _relevanceBoost; - /// The opaque value of the tag. - String get tag => _tag; - - /// The opaque value of the tag. - set tag(String value) { - assert(value != null); - _tag = value; - } + String tag; /// The boost to the relevance of the completion suggestions that match this /// tag, which is added to the relevance of the containing /// IncludedSuggestionSet. - int get relevanceBoost => _relevanceBoost; + int relevanceBoost; - /// The boost to the relevance of the completion suggestions that match this - /// tag, which is added to the relevance of the containing - /// IncludedSuggestionSet. - set relevanceBoost(int value) { - assert(value != null); - _relevanceBoost = value; - } - - IncludedSuggestionRelevanceTag(String tag, int relevanceBoost) { - this.tag = tag; - this.relevanceBoost = relevanceBoost; - } + IncludedSuggestionRelevanceTag(this.tag, this.relevanceBoost); factory IncludedSuggestionRelevanceTag.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String tag; @@ -16210,8 +12910,8 @@ class IncludedSuggestionRelevanceTag implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['tag'] = tag; result['relevanceBoost'] = relevanceBoost; return result; @@ -16247,33 +12947,13 @@ class IncludedSuggestionRelevanceTag implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class IncludedSuggestionSet implements HasToJson { - int _id; - - int _relevance; - - String _displayUri; - /// Clients should use it to access the set of precomputed completions to be /// displayed to the user. - int get id => _id; - - /// Clients should use it to access the set of precomputed completions to be - /// displayed to the user. - set id(int value) { - assert(value != null); - _id = value; - } + int id; /// The relevance of completion suggestions from this library where a higher /// number indicates a higher relevance. - int get relevance => _relevance; - - /// The relevance of completion suggestions from this library where a higher - /// number indicates a higher relevance. - set relevance(int value) { - assert(value != null); - _relevance = value; - } + int relevance; /// The optional string that should be displayed instead of the uri of the /// referenced AvailableSuggestionSet. @@ -16282,27 +12962,12 @@ class IncludedSuggestionSet implements HasToJson { /// "file://" URIs, so are usually long, and don't look nice, but actual /// import directives will use relative URIs, which are short, so we probably /// want to display such relative URIs to the user. - String get displayUri => _displayUri; + String? displayUri; - /// The optional string that should be displayed instead of the uri of the - /// referenced AvailableSuggestionSet. - /// - /// For example libraries in the "test" directory of a package have only - /// "file://" URIs, so are usually long, and don't look nice, but actual - /// import directives will use relative URIs, which are short, so we probably - /// want to display such relative URIs to the user. - set displayUri(String value) { - _displayUri = value; - } - - IncludedSuggestionSet(int id, int relevance, {String displayUri}) { - this.id = id; - this.relevance = relevance; - this.displayUri = displayUri; - } + IncludedSuggestionSet(this.id, this.relevance, {this.displayUri}); factory IncludedSuggestionSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int id; @@ -16318,7 +12983,7 @@ class IncludedSuggestionSet implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'relevance'); } - String displayUri; + String? displayUri; if (json.containsKey('displayUri')) { displayUri = jsonDecoder.decodeString( jsonPath + '.displayUri', json['displayUri']); @@ -16330,10 +12995,11 @@ class IncludedSuggestionSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['relevance'] = relevance; + var displayUri = this.displayUri; if (displayUri != null) { result['displayUri'] = displayUri; } @@ -16372,35 +13038,16 @@ class IncludedSuggestionSet implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class InlineLocalVariableFeedback extends RefactoringFeedback { - String _name; - - int _occurrences; - /// The name of the variable being inlined. - String get name => _name; - - /// The name of the variable being inlined. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The number of times the variable occurs. - int get occurrences => _occurrences; + int occurrences; - /// The number of times the variable occurs. - set occurrences(int value) { - assert(value != null); - _occurrences = value; - } - - InlineLocalVariableFeedback(String name, int occurrences) { - this.name = name; - this.occurrences = occurrences; - } + InlineLocalVariableFeedback(this.name, this.occurrences); factory InlineLocalVariableFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -16424,8 +13071,8 @@ class InlineLocalVariableFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['occurrences'] = occurrences; return result; @@ -16480,54 +13127,24 @@ class InlineLocalVariableOptions extends RefactoringOptions /// /// Clients may not extend, implement or mix-in this class. class InlineMethodFeedback extends RefactoringFeedback { - String _className; - - String _methodName; - - bool _isDeclaration; - /// The name of the class enclosing the method being inlined. If not a class /// member is being inlined, this field will be absent. - String get className => _className; - - /// The name of the class enclosing the method being inlined. If not a class - /// member is being inlined, this field will be absent. - set className(String value) { - _className = value; - } + String? className; /// The name of the method (or function) being inlined. - String get methodName => _methodName; - - /// The name of the method (or function) being inlined. - set methodName(String value) { - assert(value != null); - _methodName = value; - } + String methodName; /// True if the declaration of the method is selected. So all references /// should be inlined. - bool get isDeclaration => _isDeclaration; + bool isDeclaration; - /// True if the declaration of the method is selected. So all references - /// should be inlined. - set isDeclaration(bool value) { - assert(value != null); - _isDeclaration = value; - } - - InlineMethodFeedback(String methodName, bool isDeclaration, - {String className}) { - this.className = className; - this.methodName = methodName; - this.isDeclaration = isDeclaration; - } + InlineMethodFeedback(this.methodName, this.isDeclaration, {this.className}); factory InlineMethodFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String className; + String? className; if (json.containsKey('className')) { className = jsonDecoder.decodeString( jsonPath + '.className', json['className']); @@ -16554,8 +13171,9 @@ class InlineMethodFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var className = this.className; if (className != null) { result['className'] = className; } @@ -16596,39 +13214,18 @@ class InlineMethodFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class InlineMethodOptions extends RefactoringOptions { - bool _deleteSource; - - bool _inlineAll; - /// True if the method being inlined should be removed. It is an error if /// this field is true and inlineAll is false. - bool get deleteSource => _deleteSource; - - /// True if the method being inlined should be removed. It is an error if - /// this field is true and inlineAll is false. - set deleteSource(bool value) { - assert(value != null); - _deleteSource = value; - } + bool deleteSource; /// True if all invocations of the method should be inlined, or false if only /// the invocation site used to create this refactoring should be inlined. - bool get inlineAll => _inlineAll; + bool inlineAll; - /// True if all invocations of the method should be inlined, or false if only - /// the invocation site used to create this refactoring should be inlined. - set inlineAll(bool value) { - assert(value != null); - _inlineAll = value; - } - - InlineMethodOptions(bool deleteSource, bool inlineAll) { - this.deleteSource = deleteSource; - this.inlineAll = inlineAll; - } + InlineMethodOptions(this.deleteSource, this.inlineAll); factory InlineMethodOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool deleteSource; @@ -16658,8 +13255,8 @@ class InlineMethodOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['deleteSource'] = deleteSource; result['inlineAll'] = inlineAll; return result; @@ -16693,25 +13290,14 @@ class InlineMethodOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class KytheGetKytheEntriesParams implements RequestParams { - String _file; - /// The file containing the code for which the Kythe Entry objects are being /// requested. - String get file => _file; + String file; - /// The file containing the code for which the Kythe Entry objects are being - /// requested. - set file(String value) { - assert(value != null); - _file = value; - } - - KytheGetKytheEntriesParams(String file) { - this.file = file; - } + KytheGetKytheEntriesParams(this.file); factory KytheGetKytheEntriesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -16733,8 +13319,8 @@ class KytheGetKytheEntriesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; return result; } @@ -16772,41 +13358,19 @@ class KytheGetKytheEntriesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class KytheGetKytheEntriesResult implements ResponseResult { - List _entries; - - List _files; - /// The list of KytheEntry objects for the queried file. - List get entries => _entries; - - /// The list of KytheEntry objects for the queried file. - set entries(List value) { - assert(value != null); - _entries = value; - } + List entries; /// The set of files paths that were required, but not in the file system, to /// give a complete and accurate Kythe graph for the file. This could be due /// to a referenced file that does not exist or generated files not being /// generated or passed before the call to "getKytheEntries". - List get files => _files; + List files; - /// The set of files paths that were required, but not in the file system, to - /// give a complete and accurate Kythe graph for the file. This could be due - /// to a referenced file that does not exist or generated files not being - /// generated or passed before the call to "getKytheEntries". - set files(List value) { - assert(value != null); - _files = value; - } - - KytheGetKytheEntriesResult(List entries, List files) { - this.entries = entries; - this.files = files; - } + KytheGetKytheEntriesResult(this.entries, this.files); factory KytheGetKytheEntriesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List entries; @@ -16814,7 +13378,7 @@ class KytheGetKytheEntriesResult implements ResponseResult { entries = jsonDecoder.decodeList( jsonPath + '.entries', json['entries'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => KytheEntry.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'entries'); @@ -16841,8 +13405,8 @@ class KytheGetKytheEntriesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['entries'] = entries.map((KytheEntry value) => value.toJson()).toList(); result['files'] = files; @@ -16885,41 +13449,19 @@ class KytheGetKytheEntriesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class LibraryPathSet implements HasToJson { - String _scope; - - List _libraryPaths; - /// The filepath for which this request's libraries should be active in /// completion suggestions. This object associates filesystem regions to /// libraries and library directories of interest to the client. - String get scope => _scope; - - /// The filepath for which this request's libraries should be active in - /// completion suggestions. This object associates filesystem regions to - /// libraries and library directories of interest to the client. - set scope(String value) { - assert(value != null); - _scope = value; - } + String scope; /// The paths of the libraries of interest to the client for completion /// suggestions. - List get libraryPaths => _libraryPaths; + List libraryPaths; - /// The paths of the libraries of interest to the client for completion - /// suggestions. - set libraryPaths(List value) { - assert(value != null); - _libraryPaths = value; - } - - LibraryPathSet(String scope, List libraryPaths) { - this.scope = scope; - this.libraryPaths = libraryPaths; - } + LibraryPathSet(this.scope, this.libraryPaths); factory LibraryPathSet.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String scope; @@ -16942,8 +13484,8 @@ class LibraryPathSet implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['scope'] = scope; result['libraryPaths'] = libraryPaths; return result; @@ -16997,23 +13539,13 @@ class MoveFileFeedback extends RefactoringFeedback implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class MoveFileOptions extends RefactoringOptions { - String _newFile; - /// The new file path to which the given file is being moved. - String get newFile => _newFile; + String newFile; - /// The new file path to which the given file is being moved. - set newFile(String value) { - assert(value != null); - _newFile = value; - } - - MoveFileOptions(String newFile) { - this.newFile = newFile; - } + MoveFileOptions(this.newFile); factory MoveFileOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String newFile; @@ -17036,8 +13568,8 @@ class MoveFileOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['newFile'] = newFile; return result; } @@ -17070,35 +13602,16 @@ class MoveFileOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class OverriddenMember implements HasToJson { - Element _element; - - String _className; - /// The element that is being overridden. - Element get element => _element; - - /// The element that is being overridden. - set element(Element value) { - assert(value != null); - _element = value; - } + Element element; /// The name of the class in which the member is defined. - String get className => _className; + String className; - /// The name of the class in which the member is defined. - set className(String value) { - assert(value != null); - _className = value; - } - - OverriddenMember(Element element, String className) { - this.element = element; - this.className = className; - } + OverriddenMember(this.element, this.className); factory OverriddenMember.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Element element; @@ -17122,8 +13635,8 @@ class OverriddenMember implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['element'] = element.toJson(); result['className'] = className; return result; @@ -17160,67 +13673,27 @@ class OverriddenMember implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class Override implements HasToJson { - int _offset; - - int _length; - - OverriddenMember _superclassMember; - - List _interfaceMembers; - /// The offset of the name of the overriding member. - int get offset => _offset; - - /// The offset of the name of the overriding member. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name of the overriding member. - int get length => _length; - - /// The length of the name of the overriding member. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The member inherited from a superclass that is overridden by the /// overriding member. The field is omitted if there is no superclass member, /// in which case there must be at least one interface member. - OverriddenMember get superclassMember => _superclassMember; - - /// The member inherited from a superclass that is overridden by the - /// overriding member. The field is omitted if there is no superclass member, - /// in which case there must be at least one interface member. - set superclassMember(OverriddenMember value) { - _superclassMember = value; - } + OverriddenMember? superclassMember; /// The members inherited from interfaces that are overridden by the /// overriding member. The field is omitted if there are no interface /// members, in which case there must be a superclass member. - List get interfaceMembers => _interfaceMembers; + List? interfaceMembers; - /// The members inherited from interfaces that are overridden by the - /// overriding member. The field is omitted if there are no interface - /// members, in which case there must be a superclass member. - set interfaceMembers(List value) { - _interfaceMembers = value; - } - - Override(int offset, int length, - {OverriddenMember superclassMember, - List interfaceMembers}) { - this.offset = offset; - this.length = length; - this.superclassMember = superclassMember; - this.interfaceMembers = interfaceMembers; - } + Override(this.offset, this.length, + {this.superclassMember, this.interfaceMembers}); factory Override.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -17235,17 +13708,17 @@ class Override implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'length'); } - OverriddenMember superclassMember; + OverriddenMember? superclassMember; if (json.containsKey('superclassMember')) { superclassMember = OverriddenMember.fromJson(jsonDecoder, jsonPath + '.superclassMember', json['superclassMember']); } - List interfaceMembers; + List? interfaceMembers; if (json.containsKey('interfaceMembers')) { interfaceMembers = jsonDecoder.decodeList( jsonPath + '.interfaceMembers', json['interfaceMembers'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => OverriddenMember.fromJson(jsonDecoder, jsonPath, json)); } return Override(offset, length, @@ -17257,13 +13730,15 @@ class Override implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; + var superclassMember = this.superclassMember; if (superclassMember != null) { result['superclassMember'] = superclassMember.toJson(); } + var interfaceMembers = this.interfaceMembers; if (interfaceMembers != null) { result['interfaceMembers'] = interfaceMembers .map((OverriddenMember value) => value.toJson()) @@ -17308,49 +13783,20 @@ class Override implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class PostfixTemplateDescriptor implements HasToJson { - String _name; - - String _key; - - String _example; - /// The template name, shown in the UI. - String get name => _name; - - /// The template name, shown in the UI. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The unique template key, not shown in the UI. - String get key => _key; - - /// The unique template key, not shown in the UI. - set key(String value) { - assert(value != null); - _key = value; - } + String key; /// A short example of the transformation performed when the template is /// applied. - String get example => _example; + String example; - /// A short example of the transformation performed when the template is - /// applied. - set example(String value) { - assert(value != null); - _example = value; - } - - PostfixTemplateDescriptor(String name, String key, String example) { - this.name = name; - this.key = key; - this.example = example; - } + PostfixTemplateDescriptor(this.name, this.key, this.example); factory PostfixTemplateDescriptor.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -17379,8 +13825,8 @@ class PostfixTemplateDescriptor implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['key'] = key; result['example'] = example; @@ -17416,25 +13862,14 @@ class PostfixTemplateDescriptor implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class PubStatus implements HasToJson { - bool _isListingPackageDirs; - /// True if the server is currently running pub to produce a list of package /// directories. - bool get isListingPackageDirs => _isListingPackageDirs; + bool isListingPackageDirs; - /// True if the server is currently running pub to produce a list of package - /// directories. - set isListingPackageDirs(bool value) { - assert(value != null); - _isListingPackageDirs = value; - } - - PubStatus(bool isListingPackageDirs) { - this.isListingPackageDirs = isListingPackageDirs; - } + PubStatus(this.isListingPackageDirs); factory PubStatus.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool isListingPackageDirs; @@ -17451,8 +13886,8 @@ class PubStatus implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['isListingPackageDirs'] = isListingPackageDirs; return result; } @@ -17485,15 +13920,15 @@ class PubStatus implements HasToJson { class RefactoringFeedback implements HasToJson { RefactoringFeedback(); - factory RefactoringFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) { + static RefactoringFeedback? fromJson(JsonDecoder jsonDecoder, String jsonPath, + Object? json, Map responseJson) { return refactoringFeedbackFromJson( jsonDecoder, jsonPath, json, responseJson); } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -17524,14 +13959,14 @@ class RefactoringFeedback implements HasToJson { class RefactoringOptions implements HasToJson { RefactoringOptions(); - factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, - Object json, RefactoringKind kind) { + static RefactoringOptions? fromJson(JsonDecoder jsonDecoder, String jsonPath, + Object? json, RefactoringKind kind) { return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; return result; } @@ -17564,64 +13999,24 @@ class RefactoringOptions implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class RenameFeedback extends RefactoringFeedback { - int _offset; - - int _length; - - String _elementKindName; - - String _oldName; - /// The offset to the beginning of the name selected to be renamed, or -1 if /// the name does not exist yet. - int get offset => _offset; - - /// The offset to the beginning of the name selected to be renamed, or -1 if - /// the name does not exist yet. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the name selected to be renamed. - int get length => _length; - - /// The length of the name selected to be renamed. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// The human-readable description of the kind of element being renamed (such /// as "class" or "function type alias"). - String get elementKindName => _elementKindName; - - /// The human-readable description of the kind of element being renamed (such - /// as "class" or "function type alias"). - set elementKindName(String value) { - assert(value != null); - _elementKindName = value; - } + String elementKindName; /// The old name of the element before the refactoring. - String get oldName => _oldName; + String oldName; - /// The old name of the element before the refactoring. - set oldName(String value) { - assert(value != null); - _oldName = value; - } - - RenameFeedback( - int offset, int length, String elementKindName, String oldName) { - this.offset = offset; - this.length = length; - this.elementKindName = elementKindName; - this.oldName = oldName; - } + RenameFeedback(this.offset, this.length, this.elementKindName, this.oldName); factory RenameFeedback.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -17657,8 +14052,8 @@ class RenameFeedback extends RefactoringFeedback { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; result['elementKindName'] = elementKindName; @@ -17699,23 +14094,13 @@ class RenameFeedback extends RefactoringFeedback { /// /// Clients may not extend, implement or mix-in this class. class RenameOptions extends RefactoringOptions { - String _newName; - /// The name that the element should have after the refactoring. - String get newName => _newName; + String newName; - /// The name that the element should have after the refactoring. - set newName(String value) { - assert(value != null); - _newName = value; - } - - RenameOptions(String newName) { - this.newName = newName; - } + RenameOptions(this.newName); factory RenameOptions.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String newName; @@ -17738,8 +14123,8 @@ class RenameOptions extends RefactoringOptions { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['newName'] = newName; return result; } @@ -17773,48 +14158,20 @@ class RenameOptions extends RefactoringOptions { /// /// Clients may not extend, implement or mix-in this class. class RequestError implements HasToJson { - RequestErrorCode _code; - - String _message; - - String _stackTrace; - /// A code that uniquely identifies the error that occurred. - RequestErrorCode get code => _code; - - /// A code that uniquely identifies the error that occurred. - set code(RequestErrorCode value) { - assert(value != null); - _code = value; - } + RequestErrorCode code; /// A short description of the error. - String get message => _message; - - /// A short description of the error. - set message(String value) { - assert(value != null); - _message = value; - } + String message; /// The stack trace associated with processing the request, used for /// debugging the server. - String get stackTrace => _stackTrace; + String? stackTrace; - /// The stack trace associated with processing the request, used for - /// debugging the server. - set stackTrace(String value) { - _stackTrace = value; - } - - RequestError(RequestErrorCode code, String message, {String stackTrace}) { - this.code = code; - this.message = message; - this.stackTrace = stackTrace; - } + RequestError(this.code, this.message, {this.stackTrace}); factory RequestError.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { RequestErrorCode code; @@ -17831,7 +14188,7 @@ class RequestError implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'message'); } - String stackTrace; + String? stackTrace; if (json.containsKey('stackTrace')) { stackTrace = jsonDecoder.decodeString( jsonPath + '.stackTrace', json['stackTrace']); @@ -17843,10 +14200,11 @@ class RequestError implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['code'] = code.toJson(); result['message'] = message; + var stackTrace = this.stackTrace; if (stackTrace != null) { result['stackTrace'] = stackTrace; } @@ -18216,7 +14574,7 @@ class RequestErrorCode implements Enum { } factory RequestErrorCode.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RequestErrorCode(json); @@ -18243,51 +14601,21 @@ class RequestErrorCode implements Enum { /// /// Clients may not extend, implement or mix-in this class. class RuntimeCompletionExpression implements HasToJson { - int _offset; - - int _length; - - RuntimeCompletionExpressionType _type; - /// The offset of the expression in the code for completion. - int get offset => _offset; - - /// The offset of the expression in the code for completion. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// The length of the expression in the code for completion. - int get length => _length; - - /// The length of the expression in the code for completion. - set length(int value) { - assert(value != null); - _length = value; - } + int length; /// When the expression is sent from the server to the client, the type is /// omitted. The client should fill the type when it sends the request to the /// server again. - RuntimeCompletionExpressionType get type => _type; + RuntimeCompletionExpressionType? type; - /// When the expression is sent from the server to the client, the type is - /// omitted. The client should fill the type when it sends the request to the - /// server again. - set type(RuntimeCompletionExpressionType value) { - _type = value; - } - - RuntimeCompletionExpression(int offset, int length, - {RuntimeCompletionExpressionType type}) { - this.offset = offset; - this.length = length; - this.type = type; - } + RuntimeCompletionExpression(this.offset, this.length, {this.type}); factory RuntimeCompletionExpression.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int offset; @@ -18302,7 +14630,7 @@ class RuntimeCompletionExpression implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'length'); } - RuntimeCompletionExpressionType type; + RuntimeCompletionExpressionType? type; if (json.containsKey('type')) { type = RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath + '.type', json['type']); @@ -18314,10 +14642,11 @@ class RuntimeCompletionExpression implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['offset'] = offset; result['length'] = length; + var type = this.type; if (type != null) { result['type'] = type.toJson(); } @@ -18361,116 +14690,49 @@ class RuntimeCompletionExpression implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class RuntimeCompletionExpressionType implements HasToJson { - String _libraryPath; - - RuntimeCompletionExpressionTypeKind _kind; - - String _name; - - List _typeArguments; - - RuntimeCompletionExpressionType _returnType; - - List _parameterTypes; - - List _parameterNames; - /// The path of the library that has this type. Omitted if the type is not /// declared in any library, e.g. "dynamic", or "void". - String get libraryPath => _libraryPath; - - /// The path of the library that has this type. Omitted if the type is not - /// declared in any library, e.g. "dynamic", or "void". - set libraryPath(String value) { - _libraryPath = value; - } + String? libraryPath; /// The kind of the type. - RuntimeCompletionExpressionTypeKind get kind => _kind; - - /// The kind of the type. - set kind(RuntimeCompletionExpressionTypeKind value) { - assert(value != null); - _kind = value; - } + RuntimeCompletionExpressionTypeKind kind; /// The name of the type. Omitted if the type does not have a name, e.g. an /// inline function type. - String get name => _name; - - /// The name of the type. Omitted if the type does not have a name, e.g. an - /// inline function type. - set name(String value) { - _name = value; - } + String? name; /// The type arguments of the type. Omitted if the type does not have type /// parameters. - List get typeArguments => _typeArguments; - - /// The type arguments of the type. Omitted if the type does not have type - /// parameters. - set typeArguments(List value) { - _typeArguments = value; - } + List? typeArguments; /// If the type is a function type, the return type of the function. Omitted /// if the type is not a function type. - RuntimeCompletionExpressionType get returnType => _returnType; - - /// If the type is a function type, the return type of the function. Omitted - /// if the type is not a function type. - set returnType(RuntimeCompletionExpressionType value) { - _returnType = value; - } + RuntimeCompletionExpressionType? returnType; /// If the type is a function type, the types of the function parameters of /// all kinds - required, optional positional, and optional named. Omitted if /// the type is not a function type. - List get parameterTypes => _parameterTypes; - - /// If the type is a function type, the types of the function parameters of - /// all kinds - required, optional positional, and optional named. Omitted if - /// the type is not a function type. - set parameterTypes(List value) { - _parameterTypes = value; - } + List? parameterTypes; /// If the type is a function type, the names of the function parameters of /// all kinds - required, optional positional, and optional named. The names /// of positional parameters are empty strings. Omitted if the type is not a /// function type. - List get parameterNames => _parameterNames; + List? parameterNames; - /// If the type is a function type, the names of the function parameters of - /// all kinds - required, optional positional, and optional named. The names - /// of positional parameters are empty strings. Omitted if the type is not a - /// function type. - set parameterNames(List value) { - _parameterNames = value; - } - - RuntimeCompletionExpressionType(RuntimeCompletionExpressionTypeKind kind, - {String libraryPath, - String name, - List typeArguments, - RuntimeCompletionExpressionType returnType, - List parameterTypes, - List parameterNames}) { - this.libraryPath = libraryPath; - this.kind = kind; - this.name = name; - this.typeArguments = typeArguments; - this.returnType = returnType; - this.parameterTypes = parameterTypes; - this.parameterNames = parameterNames; - } + RuntimeCompletionExpressionType(this.kind, + {this.libraryPath, + this.name, + this.typeArguments, + this.returnType, + this.parameterTypes, + this.parameterNames}); factory RuntimeCompletionExpressionType.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String libraryPath; + String? libraryPath; if (json.containsKey('libraryPath')) { libraryPath = jsonDecoder.decodeString( jsonPath + '.libraryPath', json['libraryPath']); @@ -18482,34 +14744,34 @@ class RuntimeCompletionExpressionType implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'kind'); } - String name; + String? name; if (json.containsKey('name')) { name = jsonDecoder.decodeString(jsonPath + '.name', json['name']); } - List typeArguments; + List? typeArguments; if (json.containsKey('typeArguments')) { typeArguments = jsonDecoder.decodeList( jsonPath + '.typeArguments', json['typeArguments'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath, json)); } - RuntimeCompletionExpressionType returnType; + RuntimeCompletionExpressionType? returnType; if (json.containsKey('returnType')) { returnType = RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath + '.returnType', json['returnType']); } - List parameterTypes; + List? parameterTypes; if (json.containsKey('parameterTypes')) { parameterTypes = jsonDecoder.decodeList( jsonPath + '.parameterTypes', json['parameterTypes'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => RuntimeCompletionExpressionType.fromJson( jsonDecoder, jsonPath, json)); } - List parameterNames; + List? parameterNames; if (json.containsKey('parameterNames')) { parameterNames = jsonDecoder.decodeList(jsonPath + '.parameterNames', json['parameterNames'], jsonDecoder.decodeString); @@ -18528,28 +14790,34 @@ class RuntimeCompletionExpressionType implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var libraryPath = this.libraryPath; if (libraryPath != null) { result['libraryPath'] = libraryPath; } result['kind'] = kind.toJson(); + var name = this.name; if (name != null) { result['name'] = name; } + var typeArguments = this.typeArguments; if (typeArguments != null) { result['typeArguments'] = typeArguments .map((RuntimeCompletionExpressionType value) => value.toJson()) .toList(); } + var returnType = this.returnType; if (returnType != null) { result['returnType'] = returnType.toJson(); } + var parameterTypes = this.parameterTypes; if (parameterTypes != null) { result['parameterTypes'] = parameterTypes .map((RuntimeCompletionExpressionType value) => value.toJson()) .toList(); } + var parameterNames = this.parameterNames; if (parameterNames != null) { result['parameterNames'] = parameterNames; } @@ -18639,7 +14907,7 @@ class RuntimeCompletionExpressionTypeKind implements Enum { } factory RuntimeCompletionExpressionTypeKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return RuntimeCompletionExpressionTypeKind(json); @@ -18666,39 +14934,18 @@ class RuntimeCompletionExpressionTypeKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class RuntimeCompletionVariable implements HasToJson { - String _name; - - RuntimeCompletionExpressionType _type; - /// The name of the variable. The name "this" has a special meaning and is /// used as an implicit target for runtime completion, and in explicit "this" /// references. - String get name => _name; - - /// The name of the variable. The name "this" has a special meaning and is - /// used as an implicit target for runtime completion, and in explicit "this" - /// references. - set name(String value) { - assert(value != null); - _name = value; - } + String name; /// The type of the variable. - RuntimeCompletionExpressionType get type => _type; + RuntimeCompletionExpressionType type; - /// The type of the variable. - set type(RuntimeCompletionExpressionType value) { - assert(value != null); - _type = value; - } - - RuntimeCompletionVariable(String name, RuntimeCompletionExpressionType type) { - this.name = name; - this.type = type; - } + RuntimeCompletionVariable(this.name, this.type); factory RuntimeCompletionVariable.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -18721,8 +14968,8 @@ class RuntimeCompletionVariable implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; result['type'] = type.toJson(); return result; @@ -18758,52 +15005,22 @@ class RuntimeCompletionVariable implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class SearchFindElementReferencesParams implements RequestParams { - String _file; - - int _offset; - - bool _includePotential; - /// The file containing the declaration of or reference to the element used /// to define the search. - String get file => _file; - - /// The file containing the declaration of or reference to the element used - /// to define the search. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset within the file of the declaration of or reference to the /// element. - int get offset => _offset; - - /// The offset within the file of the declaration of or reference to the - /// element. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// True if potential matches are to be included in the results. - bool get includePotential => _includePotential; - - /// True if potential matches are to be included in the results. - set includePotential(bool value) { - assert(value != null); - _includePotential = value; - } + bool includePotential; SearchFindElementReferencesParams( - String file, int offset, bool includePotential) { - this.file = file; - this.offset = offset; - this.includePotential = includePotential; - } + this.file, this.offset, this.includePotential); factory SearchFindElementReferencesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -18838,8 +15055,8 @@ class SearchFindElementReferencesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; result['includePotential'] = includePotential; @@ -18883,52 +15100,29 @@ class SearchFindElementReferencesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindElementReferencesResult implements ResponseResult { - String _id; - - Element _element; - /// The identifier used to associate results with this search request. /// /// If no element was found at the given location, this field will be absent, /// and no results will be reported via the search.results notification. - String get id => _id; - - /// The identifier used to associate results with this search request. - /// - /// If no element was found at the given location, this field will be absent, - /// and no results will be reported via the search.results notification. - set id(String value) { - _id = value; - } + String? id; /// The element referenced or defined at the given offset and whose /// references will be returned in the search results. /// /// If no element was found at the given location, this field will be absent. - Element get element => _element; + Element? element; - /// The element referenced or defined at the given offset and whose - /// references will be returned in the search results. - /// - /// If no element was found at the given location, this field will be absent. - set element(Element value) { - _element = value; - } - - SearchFindElementReferencesResult({String id, Element element}) { - this.id = id; - this.element = element; - } + SearchFindElementReferencesResult({this.id, this.element}); factory SearchFindElementReferencesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String id; + String? id; if (json.containsKey('id')) { id = jsonDecoder.decodeString(jsonPath + '.id', json['id']); } - Element element; + Element? element; if (json.containsKey('element')) { element = Element.fromJson( jsonDecoder, jsonPath + '.element', json['element']); @@ -18948,11 +15142,13 @@ class SearchFindElementReferencesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var id = this.id; if (id != null) { result['id'] = id; } + var element = this.element; if (element != null) { result['element'] = element.toJson(); } @@ -18992,23 +15188,13 @@ class SearchFindElementReferencesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberDeclarationsParams implements RequestParams { - String _name; - /// The name of the declarations to be found. - String get name => _name; + String name; - /// The name of the declarations to be found. - set name(String value) { - assert(value != null); - _name = value; - } - - SearchFindMemberDeclarationsParams(String name) { - this.name = name; - } + SearchFindMemberDeclarationsParams(this.name); factory SearchFindMemberDeclarationsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -19030,8 +15216,8 @@ class SearchFindMemberDeclarationsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; return result; } @@ -19068,23 +15254,13 @@ class SearchFindMemberDeclarationsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberDeclarationsResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this search request. - String get id => _id; + String id; - /// The identifier used to associate results with this search request. - set id(String value) { - assert(value != null); - _id = value; - } - - SearchFindMemberDeclarationsResult(String id) { - this.id = id; - } + SearchFindMemberDeclarationsResult(this.id); factory SearchFindMemberDeclarationsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -19108,8 +15284,8 @@ class SearchFindMemberDeclarationsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -19146,23 +15322,13 @@ class SearchFindMemberDeclarationsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberReferencesParams implements RequestParams { - String _name; - /// The name of the references to be found. - String get name => _name; + String name; - /// The name of the references to be found. - set name(String value) { - assert(value != null); - _name = value; - } - - SearchFindMemberReferencesParams(String name) { - this.name = name; - } + SearchFindMemberReferencesParams(this.name); factory SearchFindMemberReferencesParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String name; @@ -19184,8 +15350,8 @@ class SearchFindMemberReferencesParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['name'] = name; return result; } @@ -19222,23 +15388,13 @@ class SearchFindMemberReferencesParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindMemberReferencesResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this search request. - String get id => _id; + String id; - /// The identifier used to associate results with this search request. - set id(String value) { - assert(value != null); - _id = value; - } - - SearchFindMemberReferencesResult(String id) { - this.id = id; - } + SearchFindMemberReferencesResult(this.id); factory SearchFindMemberReferencesResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -19262,8 +15418,8 @@ class SearchFindMemberReferencesResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -19300,25 +15456,14 @@ class SearchFindMemberReferencesResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchFindTopLevelDeclarationsParams implements RequestParams { - String _pattern; - /// The regular expression used to match the names of the declarations to be /// found. - String get pattern => _pattern; + String pattern; - /// The regular expression used to match the names of the declarations to be - /// found. - set pattern(String value) { - assert(value != null); - _pattern = value; - } - - SearchFindTopLevelDeclarationsParams(String pattern) { - this.pattern = pattern; - } + SearchFindTopLevelDeclarationsParams(this.pattern); factory SearchFindTopLevelDeclarationsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String pattern; @@ -19341,8 +15486,8 @@ class SearchFindTopLevelDeclarationsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['pattern'] = pattern; return result; } @@ -19379,23 +15524,13 @@ class SearchFindTopLevelDeclarationsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchFindTopLevelDeclarationsResult implements ResponseResult { - String _id; - /// The identifier used to associate results with this search request. - String get id => _id; + String id; - /// The identifier used to associate results with this search request. - set id(String value) { - assert(value != null); - _id = value; - } - - SearchFindTopLevelDeclarationsResult(String id) { - this.id = id; - } + SearchFindTopLevelDeclarationsResult(this.id); factory SearchFindTopLevelDeclarationsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -19419,8 +15554,8 @@ class SearchFindTopLevelDeclarationsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; return result; } @@ -19459,63 +15594,35 @@ class SearchFindTopLevelDeclarationsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchGetElementDeclarationsParams implements RequestParams { - String _file; - - String _pattern; - - int _maxResults; - /// If this field is provided, return only declarations in this file. If this /// field is missing, return declarations in all files. - String get file => _file; - - /// If this field is provided, return only declarations in this file. If this - /// field is missing, return declarations in all files. - set file(String value) { - _file = value; - } + String? file; /// The regular expression used to match the names of declarations. If this /// field is missing, return all declarations. - String get pattern => _pattern; - - /// The regular expression used to match the names of declarations. If this - /// field is missing, return all declarations. - set pattern(String value) { - _pattern = value; - } + String? pattern; /// The maximum number of declarations to return. If this field is missing, /// return all matching declarations. - int get maxResults => _maxResults; - - /// The maximum number of declarations to return. If this field is missing, - /// return all matching declarations. - set maxResults(int value) { - _maxResults = value; - } + int? maxResults; SearchGetElementDeclarationsParams( - {String file, String pattern, int maxResults}) { - this.file = file; - this.pattern = pattern; - this.maxResults = maxResults; - } + {this.file, this.pattern, this.maxResults}); factory SearchGetElementDeclarationsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - String file; + String? file; if (json.containsKey('file')) { file = jsonDecoder.decodeString(jsonPath + '.file', json['file']); } - String pattern; + String? pattern; if (json.containsKey('pattern')) { pattern = jsonDecoder.decodeString(jsonPath + '.pattern', json['pattern']); } - int maxResults; + int? maxResults; if (json.containsKey('maxResults')) { maxResults = jsonDecoder.decodeInt(jsonPath + '.maxResults', json['maxResults']); @@ -19534,14 +15641,17 @@ class SearchGetElementDeclarationsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var file = this.file; if (file != null) { result['file'] = file; } + var pattern = this.pattern; if (pattern != null) { result['pattern'] = pattern; } + var maxResults = this.maxResults; if (maxResults != null) { result['maxResults'] = maxResults; } @@ -19585,36 +15695,16 @@ class SearchGetElementDeclarationsParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchGetElementDeclarationsResult implements ResponseResult { - List _declarations; - - List _files; - /// The list of declarations. - List get declarations => _declarations; - - /// The list of declarations. - set declarations(List value) { - assert(value != null); - _declarations = value; - } + List declarations; /// The list of the paths of files with declarations. - List get files => _files; + List files; - /// The list of the paths of files with declarations. - set files(List value) { - assert(value != null); - _files = value; - } - - SearchGetElementDeclarationsResult( - List declarations, List files) { - this.declarations = declarations; - this.files = files; - } + SearchGetElementDeclarationsResult(this.declarations, this.files); factory SearchGetElementDeclarationsResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List declarations; @@ -19622,7 +15712,7 @@ class SearchGetElementDeclarationsResult implements ResponseResult { declarations = jsonDecoder.decodeList( jsonPath + '.declarations', json['declarations'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ElementDeclaration.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'declarations'); @@ -19649,8 +15739,8 @@ class SearchGetElementDeclarationsResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['declarations'] = declarations.map((ElementDeclaration value) => value.toJson()).toList(); result['files'] = files; @@ -19694,50 +15784,21 @@ class SearchGetElementDeclarationsResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchGetTypeHierarchyParams implements RequestParams { - String _file; - - int _offset; - - bool _superOnly; - /// The file containing the declaration or reference to the type for which a /// hierarchy is being requested. - String get file => _file; - - /// The file containing the declaration or reference to the type for which a - /// hierarchy is being requested. - set file(String value) { - assert(value != null); - _file = value; - } + String file; /// The offset of the name of the type within the file. - int get offset => _offset; - - /// The offset of the name of the type within the file. - set offset(int value) { - assert(value != null); - _offset = value; - } + int offset; /// True if the client is only requesting superclasses and interfaces /// hierarchy. - bool get superOnly => _superOnly; + bool? superOnly; - /// True if the client is only requesting superclasses and interfaces - /// hierarchy. - set superOnly(bool value) { - _superOnly = value; - } - - SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) { - this.file = file; - this.offset = offset; - this.superOnly = superOnly; - } + SearchGetTypeHierarchyParams(this.file, this.offset, {this.superOnly}); factory SearchGetTypeHierarchyParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String file; @@ -19752,7 +15813,7 @@ class SearchGetTypeHierarchyParams implements RequestParams { } else { throw jsonDecoder.mismatch(jsonPath, 'offset'); } - bool superOnly; + bool? superOnly; if (json.containsKey('superOnly')) { superOnly = jsonDecoder.decodeBool(jsonPath + '.superOnly', json['superOnly']); @@ -19770,10 +15831,11 @@ class SearchGetTypeHierarchyParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['file'] = file; result['offset'] = offset; + var superOnly = this.superOnly; if (superOnly != null) { result['superOnly'] = superOnly; } @@ -19816,8 +15878,6 @@ class SearchGetTypeHierarchyParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class SearchGetTypeHierarchyResult implements ResponseResult { - List _hierarchyItems; - /// A list of the types in the requested hierarchy. The first element of the /// list is the item representing the type for which the hierarchy was /// requested. The index of other elements of the list is unspecified, but @@ -19827,35 +15887,20 @@ class SearchGetTypeHierarchyResult implements ResponseResult { /// This field will be absent if the code at the given file and offset does /// not represent a type, or if the file has not been sufficiently analyzed /// to allow a type hierarchy to be produced. - List get hierarchyItems => _hierarchyItems; + List? hierarchyItems; - /// A list of the types in the requested hierarchy. The first element of the - /// list is the item representing the type for which the hierarchy was - /// requested. The index of other elements of the list is unspecified, but - /// correspond to the integers used to reference supertype and subtype items - /// within the items. - /// - /// This field will be absent if the code at the given file and offset does - /// not represent a type, or if the file has not been sufficiently analyzed - /// to allow a type hierarchy to be produced. - set hierarchyItems(List value) { - _hierarchyItems = value; - } - - SearchGetTypeHierarchyResult({List hierarchyItems}) { - this.hierarchyItems = hierarchyItems; - } + SearchGetTypeHierarchyResult({this.hierarchyItems}); factory SearchGetTypeHierarchyResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - List hierarchyItems; + List? hierarchyItems; if (json.containsKey('hierarchyItems')) { hierarchyItems = jsonDecoder.decodeList( jsonPath + '.hierarchyItems', json['hierarchyItems'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json)); } return SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); @@ -19873,8 +15918,9 @@ class SearchGetTypeHierarchyResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var hierarchyItems = this.hierarchyItems; if (hierarchyItems != null) { result['hierarchyItems'] = hierarchyItems .map((TypeHierarchyItem value) => value.toJson()) @@ -19919,70 +15965,27 @@ class SearchGetTypeHierarchyResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class SearchResult implements HasToJson { - Location _location; - - SearchResultKind _kind; - - bool _isPotential; - - List _path; - /// The location of the code that matched the search criteria. - Location get location => _location; - - /// The location of the code that matched the search criteria. - set location(Location value) { - assert(value != null); - _location = value; - } + Location location; /// The kind of element that was found or the kind of reference that was /// found. - SearchResultKind get kind => _kind; - - /// The kind of element that was found or the kind of reference that was - /// found. - set kind(SearchResultKind value) { - assert(value != null); - _kind = value; - } + SearchResultKind kind; /// True if the result is a potential match but cannot be confirmed to be a /// match. For example, if all references to a method m defined in some class /// were requested, and a reference to a method m from an unknown class were /// found, it would be marked as being a potential match. - bool get isPotential => _isPotential; - - /// True if the result is a potential match but cannot be confirmed to be a - /// match. For example, if all references to a method m defined in some class - /// were requested, and a reference to a method m from an unknown class were - /// found, it would be marked as being a potential match. - set isPotential(bool value) { - assert(value != null); - _isPotential = value; - } + bool isPotential; /// The elements that contain the result, starting with the most immediately /// enclosing ancestor and ending with the library. - List get path => _path; + List path; - /// The elements that contain the result, starting with the most immediately - /// enclosing ancestor and ending with the library. - set path(List value) { - assert(value != null); - _path = value; - } - - SearchResult(Location location, SearchResultKind kind, bool isPotential, - List path) { - this.location = location; - this.kind = kind; - this.isPotential = isPotential; - this.path = path; - } + SearchResult(this.location, this.kind, this.isPotential, this.path); factory SearchResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Location location; @@ -20011,7 +16014,7 @@ class SearchResult implements HasToJson { path = jsonDecoder.decodeList( jsonPath + '.path', json['path'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => Element.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'path'); @@ -20023,8 +16026,8 @@ class SearchResult implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['location'] = location.toJson(); result['kind'] = kind.toJson(); result['isPotential'] = isPotential; @@ -20130,7 +16133,7 @@ class SearchResultKind implements Enum { } factory SearchResultKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return SearchResultKind(json); @@ -20157,49 +16160,20 @@ class SearchResultKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class SearchResultsParams implements HasToJson { - String _id; - - List _results; - - bool _isLast; - /// The id associated with the search. - String get id => _id; - - /// The id associated with the search. - set id(String value) { - assert(value != null); - _id = value; - } + String id; /// The search results being reported. - List get results => _results; - - /// The search results being reported. - set results(List value) { - assert(value != null); - _results = value; - } + List results; /// True if this is that last set of results that will be returned for the /// indicated search. - bool get isLast => _isLast; + bool isLast; - /// True if this is that last set of results that will be returned for the - /// indicated search. - set isLast(bool value) { - assert(value != null); - _isLast = value; - } - - SearchResultsParams(String id, List results, bool isLast) { - this.id = id; - this.results = results; - this.isLast = isLast; - } + SearchResultsParams(this.id, this.results, this.isLast); factory SearchResultsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String id; @@ -20213,7 +16187,7 @@ class SearchResultsParams implements HasToJson { results = jsonDecoder.decodeList( jsonPath + '.results', json['results'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => SearchResult.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'results'); @@ -20236,8 +16210,8 @@ class SearchResultsParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['id'] = id; result['results'] = results.map((SearchResult value) => value.toJson()).toList(); @@ -20282,35 +16256,16 @@ class SearchResultsParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ServerConnectedParams implements HasToJson { - String _version; - - int _pid; - /// The version number of the analysis server. - String get version => _version; - - /// The version number of the analysis server. - set version(String value) { - assert(value != null); - _version = value; - } + String version; /// The process id of the analysis server process. - int get pid => _pid; + int pid; - /// The process id of the analysis server process. - set pid(int value) { - assert(value != null); - _pid = value; - } - - ServerConnectedParams(String version, int pid) { - this.version = version; - this.pid = pid; - } + ServerConnectedParams(this.version, this.pid); factory ServerConnectedParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String version; @@ -20338,8 +16293,8 @@ class ServerConnectedParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['version'] = version; result['pid'] = pid; return result; @@ -20379,51 +16334,21 @@ class ServerConnectedParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class ServerErrorParams implements HasToJson { - bool _isFatal; - - String _message; - - String _stackTrace; - /// True if the error is a fatal error, meaning that the server will shutdown /// automatically after sending this notification. - bool get isFatal => _isFatal; - - /// True if the error is a fatal error, meaning that the server will shutdown - /// automatically after sending this notification. - set isFatal(bool value) { - assert(value != null); - _isFatal = value; - } + bool isFatal; /// The error message indicating what kind of error was encountered. - String get message => _message; - - /// The error message indicating what kind of error was encountered. - set message(String value) { - assert(value != null); - _message = value; - } + String message; /// The stack trace associated with the generation of the error, used for /// debugging the server. - String get stackTrace => _stackTrace; + String stackTrace; - /// The stack trace associated with the generation of the error, used for - /// debugging the server. - set stackTrace(String value) { - assert(value != null); - _stackTrace = value; - } - - ServerErrorParams(bool isFatal, String message, String stackTrace) { - this.isFatal = isFatal; - this.message = message; - this.stackTrace = stackTrace; - } + ServerErrorParams(this.isFatal, this.message, this.stackTrace); factory ServerErrorParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { bool isFatal; @@ -20459,8 +16384,8 @@ class ServerErrorParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['isFatal'] = isFatal; result['message'] = message; result['stackTrace'] = stackTrace; @@ -20499,7 +16424,7 @@ class ServerErrorParams implements HasToJson { /// Clients may not extend, implement or mix-in this class. class ServerGetVersionParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -20528,23 +16453,13 @@ class ServerGetVersionParams implements RequestParams { /// /// Clients may not extend, implement or mix-in this class. class ServerGetVersionResult implements ResponseResult { - String _version; - /// The version number of the analysis server. - String get version => _version; + String version; - /// The version number of the analysis server. - set version(String value) { - assert(value != null); - _version = value; - } - - ServerGetVersionResult(String version) { - this.version = version; - } + ServerGetVersionResult(this.version); factory ServerGetVersionResult.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { String version; @@ -20568,8 +16483,8 @@ class ServerGetVersionResult implements ResponseResult { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['version'] = version; return result; } @@ -20608,53 +16523,22 @@ class ServerGetVersionResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ServerLogEntry implements HasToJson { - int _time; - - ServerLogEntryKind _kind; - - String _data; - /// The time (milliseconds since epoch) at which the server created this log /// entry. - int get time => _time; - - /// The time (milliseconds since epoch) at which the server created this log - /// entry. - set time(int value) { - assert(value != null); - _time = value; - } + int time; /// The kind of the entry, used to determine how to interpret the "data" /// field. - ServerLogEntryKind get kind => _kind; - - /// The kind of the entry, used to determine how to interpret the "data" - /// field. - set kind(ServerLogEntryKind value) { - assert(value != null); - _kind = value; - } + ServerLogEntryKind kind; /// The payload of the entry, the actual format is determined by the "kind" /// field. - String get data => _data; + String data; - /// The payload of the entry, the actual format is determined by the "kind" - /// field. - set data(String value) { - assert(value != null); - _data = value; - } - - ServerLogEntry(int time, ServerLogEntryKind kind, String data) { - this.time = time; - this.kind = kind; - this.data = data; - } + ServerLogEntry(this.time, this.kind, this.data); factory ServerLogEntry.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { int time; @@ -20683,8 +16567,8 @@ class ServerLogEntry implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['time'] = time; result['kind'] = kind.toJson(); result['data'] = data; @@ -20782,7 +16666,7 @@ class ServerLogEntryKind implements Enum { } factory ServerLogEntryKind.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ServerLogEntryKind(json); @@ -20807,21 +16691,12 @@ class ServerLogEntryKind implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ServerLogParams implements HasToJson { - ServerLogEntry _entry; + ServerLogEntry entry; - ServerLogEntry get entry => _entry; - - set entry(ServerLogEntry value) { - assert(value != null); - _entry = value; - } - - ServerLogParams(ServerLogEntry entry) { - this.entry = entry; - } + ServerLogParams(this.entry); factory ServerLogParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { ServerLogEntry entry; @@ -20843,8 +16718,8 @@ class ServerLogParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['entry'] = entry.toJson(); return result; } @@ -20904,7 +16779,7 @@ class ServerService implements Enum { } factory ServerService.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { if (json is String) { try { return ServerService(json); @@ -20929,23 +16804,13 @@ class ServerService implements Enum { /// /// Clients may not extend, implement or mix-in this class. class ServerSetSubscriptionsParams implements RequestParams { - List _subscriptions; - /// A list of the services being subscribed to. - List get subscriptions => _subscriptions; + List subscriptions; - /// A list of the services being subscribed to. - set subscriptions(List value) { - assert(value != null); - _subscriptions = value; - } - - ServerSetSubscriptionsParams(List subscriptions) { - this.subscriptions = subscriptions; - } + ServerSetSubscriptionsParams(this.subscriptions); factory ServerSetSubscriptionsParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { List subscriptions; @@ -20953,7 +16818,7 @@ class ServerSetSubscriptionsParams implements RequestParams { subscriptions = jsonDecoder.decodeList( jsonPath + '.subscriptions', json['subscriptions'], - (String jsonPath, Object json) => + (String jsonPath, Object? json) => ServerService.fromJson(jsonDecoder, jsonPath, json)); } else { throw jsonDecoder.mismatch(jsonPath, 'subscriptions'); @@ -20971,8 +16836,8 @@ class ServerSetSubscriptionsParams implements RequestParams { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['subscriptions'] = subscriptions.map((ServerService value) => value.toJson()).toList(); return result; @@ -21008,7 +16873,7 @@ class ServerSetSubscriptionsParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ServerSetSubscriptionsResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -21034,7 +16899,7 @@ class ServerSetSubscriptionsResult implements ResponseResult { /// Clients may not extend, implement or mix-in this class. class ServerShutdownParams implements RequestParams { @override - Map toJson() => {}; + Map toJson() => {}; @override Request toRequest(String id) { @@ -21060,7 +16925,7 @@ class ServerShutdownParams implements RequestParams { /// Clients may not extend, implement or mix-in this class. class ServerShutdownResult implements ResponseResult { @override - Map toJson() => {}; + Map toJson() => {}; @override Response toResponse(String id) { @@ -21090,51 +16955,29 @@ class ServerShutdownResult implements ResponseResult { /// /// Clients may not extend, implement or mix-in this class. class ServerStatusParams implements HasToJson { - AnalysisStatus _analysis; - - PubStatus _pub; - /// The current status of analysis, including whether analysis is being /// performed and if so what is being analyzed. - AnalysisStatus get analysis => _analysis; - - /// The current status of analysis, including whether analysis is being - /// performed and if so what is being analyzed. - set analysis(AnalysisStatus value) { - _analysis = value; - } + AnalysisStatus? analysis; /// The current status of pub execution, indicating whether we are currently /// running pub. /// /// Note: this status type is deprecated, and is no longer sent by the /// server. - PubStatus get pub => _pub; + PubStatus? pub; - /// The current status of pub execution, indicating whether we are currently - /// running pub. - /// - /// Note: this status type is deprecated, and is no longer sent by the - /// server. - set pub(PubStatus value) { - _pub = value; - } - - ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) { - this.analysis = analysis; - this.pub = pub; - } + ServerStatusParams({this.analysis, this.pub}); factory ServerStatusParams.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { - AnalysisStatus analysis; + AnalysisStatus? analysis; if (json.containsKey('analysis')) { analysis = AnalysisStatus.fromJson( jsonDecoder, jsonPath + '.analysis', json['analysis']); } - PubStatus pub; + PubStatus? pub; if (json.containsKey('pub')) { pub = PubStatus.fromJson(jsonDecoder, jsonPath + '.pub', json['pub']); } @@ -21150,11 +16993,13 @@ class ServerStatusParams implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; + var analysis = this.analysis; if (analysis != null) { result['analysis'] = analysis.toJson(); } + var pub = this.pub; if (pub != null) { result['pub'] = pub.toJson(); } @@ -21199,134 +17044,52 @@ class ServerStatusParams implements HasToJson { /// /// Clients may not extend, implement or mix-in this class. class TypeHierarchyItem implements HasToJson { - Element _classElement; - - String _displayName; - - Element _memberElement; - - int _superclass; - - List _interfaces; - - List _mixins; - - List _subclasses; - /// The class element represented by this item. - Element get classElement => _classElement; - - /// The class element represented by this item. - set classElement(Element value) { - assert(value != null); - _classElement = value; - } + Element classElement; /// The name to be displayed for the class. This field will be omitted if the /// display name is the same as the name of the element. The display name is /// different if there is additional type information to be displayed, such /// as type arguments. - String get displayName => _displayName; - - /// The name to be displayed for the class. This field will be omitted if the - /// display name is the same as the name of the element. The display name is - /// different if there is additional type information to be displayed, such - /// as type arguments. - set displayName(String value) { - _displayName = value; - } + String? displayName; /// The member in the class corresponding to the member on which the /// hierarchy was requested. This field will be omitted if the hierarchy was /// not requested for a member or if the class does not have a corresponding /// member. - Element get memberElement => _memberElement; - - /// The member in the class corresponding to the member on which the - /// hierarchy was requested. This field will be omitted if the hierarchy was - /// not requested for a member or if the class does not have a corresponding - /// member. - set memberElement(Element value) { - _memberElement = value; - } + Element? memberElement; /// The index of the item representing the superclass of this class. This /// field will be omitted if this item represents the class Object. - int get superclass => _superclass; - - /// The index of the item representing the superclass of this class. This - /// field will be omitted if this item represents the class Object. - set superclass(int value) { - _superclass = value; - } + int? superclass; /// The indexes of the items representing the interfaces implemented by this /// class. The list will be empty if there are no implemented interfaces. - List get interfaces => _interfaces; - - /// The indexes of the items representing the interfaces implemented by this - /// class. The list will be empty if there are no implemented interfaces. - set interfaces(List value) { - assert(value != null); - _interfaces = value; - } + List interfaces; /// The indexes of the items representing the mixins referenced by this /// class. The list will be empty if there are no classes mixed in to this /// class. - List get mixins => _mixins; - - /// The indexes of the items representing the mixins referenced by this - /// class. The list will be empty if there are no classes mixed in to this - /// class. - set mixins(List value) { - assert(value != null); - _mixins = value; - } + List mixins; /// The indexes of the items representing the subtypes of this class. The /// list will be empty if there are no subtypes or if this item represents a /// supertype of the pivot type. - List get subclasses => _subclasses; + List subclasses; - /// The indexes of the items representing the subtypes of this class. The - /// list will be empty if there are no subtypes or if this item represents a - /// supertype of the pivot type. - set subclasses(List value) { - assert(value != null); - _subclasses = value; - } - - TypeHierarchyItem(Element classElement, - {String displayName, - Element memberElement, - int superclass, - List interfaces, - List mixins, - List subclasses}) { - this.classElement = classElement; - this.displayName = displayName; - this.memberElement = memberElement; - this.superclass = superclass; - if (interfaces == null) { - this.interfaces = []; - } else { - this.interfaces = interfaces; - } - if (mixins == null) { - this.mixins = []; - } else { - this.mixins = mixins; - } - if (subclasses == null) { - this.subclasses = []; - } else { - this.subclasses = subclasses; - } - } + TypeHierarchyItem(this.classElement, + {this.displayName, + this.memberElement, + this.superclass, + List? interfaces, + List? mixins, + List? subclasses}) + : interfaces = interfaces ?? [], + mixins = mixins ?? [], + subclasses = subclasses ?? []; factory TypeHierarchyItem.fromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json) { + JsonDecoder jsonDecoder, String jsonPath, Object? json) { json ??= {}; if (json is Map) { Element classElement; @@ -21336,17 +17099,17 @@ class TypeHierarchyItem implements HasToJson { } else { throw jsonDecoder.mismatch(jsonPath, 'classElement'); } - String displayName; + String? displayName; if (json.containsKey('displayName')) { displayName = jsonDecoder.decodeString( jsonPath + '.displayName', json['displayName']); } - Element memberElement; + Element? memberElement; if (json.containsKey('memberElement')) { memberElement = Element.fromJson( jsonDecoder, jsonPath + '.memberElement', json['memberElement']); } - int superclass; + int? superclass; if (json.containsKey('superclass')) { superclass = jsonDecoder.decodeInt(jsonPath + '.superclass', json['superclass']); @@ -21385,15 +17148,18 @@ class TypeHierarchyItem implements HasToJson { } @override - Map toJson() { - var result = {}; + Map toJson() { + var result = {}; result['classElement'] = classElement.toJson(); + var displayName = this.displayName; if (displayName != null) { result['displayName'] = displayName; } + var memberElement = this.memberElement; if (memberElement != null) { result['memberElement'] = memberElement.toJson(); } + var superclass = this.superclass; if (superclass != null) { result['superclass'] = superclass; } diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart index 4758cf6d7e6..399fb51ee44 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart @@ -2,8 +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. -// @dart = 2.9 - import 'dart:collection'; import 'dart:convert' hide JsonDecoder; @@ -61,7 +59,7 @@ String applySequenceOfEdits(String code, Iterable edits) { } /// Returns the [FileEdit] for the given [file], maybe `null`. -SourceFileEdit getChangeFileEdit(SourceChange change, String file) { +SourceFileEdit? getChangeFileEdit(SourceChange change, String file) { for (var fileEdit in change.edits) { if (fileEdit.file == file) { return fileEdit; @@ -72,8 +70,8 @@ SourceFileEdit getChangeFileEdit(SourceChange change, String file) { /// Compare the lists [listA] and [listB], using [itemEqual] to compare /// list elements. -bool listEqual( - List listA, List listB, bool Function(T1 a, T2 b) itemEqual) { +bool listEqual( + List? listA, List? listB, bool Function(T a, T b) itemEqual) { if (listA == null) { return listB == null; } @@ -94,7 +92,7 @@ bool listEqual( /// Compare the maps [mapA] and [mapB], using [valueEqual] to compare map /// values. bool mapEqual( - Map mapA, Map mapB, bool Function(V a, V b) valueEqual) { + Map? mapA, Map? mapB, bool Function(V a, V b) valueEqual) { if (mapA == null) { return mapB == null; } @@ -104,11 +102,11 @@ bool mapEqual( if (mapA.length != mapB.length) { return false; } - for (var key in mapA.keys) { - if (!mapB.containsKey(key)) { - return false; - } - if (!valueEqual(mapA[key], mapB[key])) { + for (var entryA in mapA.entries) { + var key = entryA.key; + var valueA = entryA.value; + var valueB = mapB[key]; + if (valueB == null || !valueEqual(valueA, valueB)) { return false; } } @@ -118,7 +116,7 @@ bool mapEqual( /// Translate the input [map], applying [keyCallback] to all its keys, and /// [valueCallback] to all its values. Map mapMap(Map map, - {KR Function(KP key) keyCallback, VR Function(VP value) valueCallback}) { + {KR Function(KP key)? keyCallback, VR Function(VP value)? valueCallback}) { Map result = HashMap(); map.forEach((key, value) { KR resultKey; @@ -138,8 +136,8 @@ Map mapMap(Map map, return result; } -RefactoringProblemSeverity maxRefactoringProblemSeverity( - RefactoringProblemSeverity a, RefactoringProblemSeverity b) { +RefactoringProblemSeverity? maxRefactoringProblemSeverity( + RefactoringProblemSeverity? a, RefactoringProblemSeverity? b) { if (b == null) { return a; } @@ -161,8 +159,8 @@ RefactoringProblemSeverity maxRefactoringProblemSeverity( } /// Create a [RefactoringFeedback] corresponding the given [kind]. -RefactoringFeedback refactoringFeedbackFromJson( - JsonDecoder jsonDecoder, String jsonPath, Object json, Map feedbackJson) { +RefactoringFeedback? refactoringFeedbackFromJson( + JsonDecoder jsonDecoder, String jsonPath, Object? json, Map feedbackJson) { var kind = jsonDecoder.refactoringKind; if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) { return ExtractLocalVariableFeedback.fromJson(jsonDecoder, jsonPath, json); @@ -186,8 +184,8 @@ RefactoringFeedback refactoringFeedbackFromJson( } /// Create a [RefactoringOptions] corresponding the given [kind]. -RefactoringOptions refactoringOptionsFromJson(JsonDecoder jsonDecoder, - String jsonPath, Object json, RefactoringKind kind) { +RefactoringOptions? refactoringOptionsFromJson(JsonDecoder jsonDecoder, + String jsonPath, Object? json, RefactoringKind kind) { if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) { return ExtractLocalVariableOptions.fromJson(jsonDecoder, jsonPath, json); } @@ -212,7 +210,8 @@ RefactoringOptions refactoringOptionsFromJson(JsonDecoder jsonDecoder, /// Type of callbacks used to decode parts of JSON objects. [jsonPath] is a /// string describing the part of the JSON object being decoded, and [value] is /// the part to decode. -typedef JsonDecoderCallback = E Function(String jsonPath, Object value); +typedef JsonDecoderCallback = E Function( + String jsonPath, Object? value); /// Instances of the class [HasToJson] implement [toJson] method that returns /// a JSON presentation. @@ -227,7 +226,7 @@ abstract class JsonDecoder { /// Retrieve the RefactoringKind that should be assumed when decoding /// refactoring feedback objects, or null if no refactoring feedback object is /// expected to be encountered. - RefactoringKind get refactoringKind; + RefactoringKind? get refactoringKind; /// Decode a JSON object that is expected to be a boolean. The strings "true" /// and "false" are also accepted. @@ -261,7 +260,7 @@ abstract class JsonDecoder { /// Decode a JSON object that is expected to be an integer. A string /// representation of an integer is also accepted. - int decodeInt(String jsonPath, Object json) { + int decodeInt(String jsonPath, Object? json) { if (json is int) { return json; } else if (json is String) { @@ -278,8 +277,8 @@ abstract class JsonDecoder { /// to decode the items in the list. /// /// The type parameter [E] is the expected type of the elements in the list. - List decodeList(String jsonPath, Object json, - [JsonDecoderCallback decoder]) { + List decodeList( + String jsonPath, Object? json, JsonDecoderCallback decoder) { if (json == null) { return []; } else if (json is List) { @@ -295,9 +294,10 @@ abstract class JsonDecoder { /// Decode a JSON object that is expected to be a Map. [keyDecoder] is used /// to decode the keys, and [valueDecoder] is used to decode the values. - Map decodeMap(String jsonPath, Object jsonData, - {JsonDecoderCallback keyDecoder, - JsonDecoderCallback valueDecoder}) { + Map decodeMap( + String jsonPath, Object? jsonData, + {JsonDecoderCallback? keyDecoder, + JsonDecoderCallback? valueDecoder}) { if (jsonData == null) { return {}; } else if (jsonData is Map) { @@ -321,7 +321,7 @@ abstract class JsonDecoder { } /// Decode a JSON object that is expected to be a string. - String decodeString(String jsonPath, Object json) { + String decodeString(String jsonPath, Object? json) { if (json is String) { return json; } else { @@ -333,7 +333,7 @@ abstract class JsonDecoder { /// where the choices are disambiguated by the contents of the field [field]. /// [decoders] is a map from each possible string in the field to the decoder /// that should be used to decode the JSON object. - Object decodeUnion(String jsonPath, Map jsonData, String field, + Object decodeUnion(String jsonPath, Object? jsonData, String field, Map decoders) { if (jsonData is Map) { if (!jsonData.containsKey(field)) { @@ -341,11 +341,12 @@ abstract class JsonDecoder { } var disambiguatorPath = '$jsonPath[${json.encode(field)}]'; var disambiguator = decodeString(disambiguatorPath, jsonData[field]); - if (!decoders.containsKey(disambiguator)) { + var decoder = decoders[disambiguator]; + if (decoder == null) { throw mismatch( disambiguatorPath, 'One of: ${decoders.keys.toList()}', jsonData); } - return decoders[disambiguator](jsonPath, jsonData); + return decoder(jsonPath, jsonData); } else { throw mismatch(jsonPath, 'Map', jsonData); } @@ -353,7 +354,7 @@ abstract class JsonDecoder { /// Create an exception to throw if the JSON object at [jsonPath] fails to /// match the API definition of [expected]. - dynamic mismatch(String jsonPath, String expected, [Object actual]); + dynamic mismatch(String jsonPath, String expected, [Object? actual]); /// Create an exception to throw if the JSON object at [jsonPath] is missing /// the key [key]. @@ -369,13 +370,13 @@ class RequestDecoder extends JsonDecoder { RequestDecoder(this._request); @override - RefactoringKind get refactoringKind { + RefactoringKind? get refactoringKind { // Refactoring feedback objects should never appear in requests. return null; } @override - dynamic mismatch(String jsonPath, String expected, [Object actual]) { + dynamic mismatch(String jsonPath, String expected, [Object? actual]) { var buffer = StringBuffer(); buffer.write('Expected to be '); buffer.write(expected); @@ -405,12 +406,12 @@ abstract class RequestParams implements HasToJson { /// used only for testing. Errors are reported using bare [Exception] objects. class ResponseDecoder extends JsonDecoder { @override - final RefactoringKind refactoringKind; + final RefactoringKind? refactoringKind; ResponseDecoder(this.refactoringKind); @override - dynamic mismatch(String jsonPath, String expected, [Object actual]) { + dynamic mismatch(String jsonPath, String expected, [Object? actual]) { var buffer = StringBuffer(); buffer.write('Expected '); buffer.write(expected); diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart index 95ff9e8ec25..02e8c7506c9 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_util.dart @@ -2,8 +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. -// @dart = 2.9 - /// Jenkins hash function, optimized for small integers. /// /// Static methods borrowed from sdk/lib/math/jenkins_smi_hash.dart. Non-static diff --git a/pkg/analyzer_plugin/lib/protocol/protocol.dart b/pkg/analyzer_plugin/lib/protocol/protocol.dart index 25684ffb066..f0d4f317333 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol.dart @@ -80,7 +80,7 @@ class Request { final String method; /// A table mapping the names of request parameters to their values. - final Map params; + final Map params; /// The time (milliseconds since epoch) at which the server made the request, /// or `null` if this information is not provided by the server. @@ -90,8 +90,8 @@ class Request { /// name. If [params] is supplied, it is used as the "params" map for the /// request. Otherwise an empty "params" map is allocated. Request(this.id, this.method, - [Map? params, this.serverRequestTime]) - : params = params ?? {}; + [Map? params, this.serverRequestTime]) + : params = params ?? {}; /// Return a request parsed from the given json, or `null` if the [data] is /// not a valid json representation of a request. The [data] is expected to @@ -111,19 +111,19 @@ class Request { /// The parameters can contain any number of name/value pairs. The /// clientRequestTime must be an int representing the time at which the client /// issued the request (milliseconds since epoch). - factory Request.fromJson(Map result) { + factory Request.fromJson(Map result) { var id = result[Request.ID]; var method = result[Request.METHOD]; if (id is! String || method is! String) { throw StateError('Unexpected type for id or method'); } var time = result[Request.SERVER_REQUEST_TIME]; - if (time != null && time is! int) { + if (time is! int?) { throw StateError('Unexpected type for server request time'); } var params = result[Request.PARAMS]; - if (params is Map || params == null) { - return Request(id, method, params as Map?, time as int?); + if (params is Map?) { + return Request(id, method, params, time); } else { throw StateError('Unexpected type for params'); } @@ -304,36 +304,39 @@ class Response { /// A table mapping the names of result fields to their values. Should be /// `null` if there is no result to send. - Map? result; + Map? result; /// Initialize a newly created instance to represent a response to a request - /// with the given [id]. If [_result] is provided, it will be used as the + /// 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.requestTime, {this.error, Map? result}) - : result = result; + Response(this.id, this.requestTime, {this.error, this.result}); /// Initialize a newly created instance based on the given JSON data. - factory Response.fromJson(Map json) { + factory Response.fromJson(Map json) { var id = json[ID]; if (id is! String) { throw StateError('Unexpected type for id'); } - var error = json[ERROR]; + RequestError? decodedError; + var error = json[ERROR]; if (error is Map) { decodedError = RequestError.fromJson(ResponseDecoder(null), '.error', error); } + var requestTime = json[REQUEST_TIME]; if (requestTime is! int) { throw StateError('Unexpected type for requestTime'); } - var result = json[RESULT]; - Map? decodedResult; - if (result is Map) { - decodedResult = result as Map; + + Map? decodedResult; + var result = json[Response.RESULT]; + if (result is Map) { + decodedResult = result; } + return Response(id, requestTime, error: decodedError, result: decodedResult); } diff --git a/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart b/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart index 279e58fc8cd..f7cdfcbe45c 100644 --- a/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart +++ b/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart @@ -223,7 +223,7 @@ abstract class ServerIsolateChannel implements ServerCommunicationChannel { if (input is SendPort) { _sendPort = input; channelReady.complete(null); - } else if (input is Map) { + } else if (input is Map) { if (input.containsKey('id')) { var encodedInput = json.encode(input); instrumentationService.logPluginResponse(pluginId, encodedInput); diff --git a/pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart b/pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart index bc7322c82f4..777ccda5a2a 100644 --- a/pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart +++ b/pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart @@ -136,11 +136,11 @@ bool mapEqual( if (mapA.length != mapB.length) { return false; } - for (var key in mapA.keys) { - if (!mapB.containsKey(key)) { - return false; - } - if (!valueEqual(mapA[key]!, mapB[key]!)) { + for (var entryA in mapA.entries) { + var key = entryA.key; + var valueA = entryA.value; + var valueB = mapB[key]; + if (valueB == null || !valueEqual(valueA, valueB)) { return false; } } @@ -239,7 +239,7 @@ RefactoringOptions refactoringOptionsFromJson(JsonDecoder jsonDecoder, /// string describing the part of the JSON object being decoded, and [value] is /// the part to decode. typedef JsonDecoderCallback = E Function( - String jsonPath, dynamic value); + String jsonPath, Object? value); /// Instances of the class [HasToJson] implement [toJson] method that returns /// a JSON presentation. @@ -361,7 +361,7 @@ abstract class JsonDecoder { /// where the choices are disambiguated by the contents of the field [field]. /// [decoders] is a map from each possible string in the field to the decoder /// that should be used to decode the JSON object. - Object decodeUnion(String jsonPath, Map jsonData, String field, + Object decodeUnion(String jsonPath, Object? jsonData, String field, Map decoders) { if (jsonData is Map) { if (!jsonData.containsKey(field)) { diff --git a/pkg/analyzer_plugin/tool/spec/generate_all.dart b/pkg/analyzer_plugin/tool/spec/generate_all.dart index 3ce0b3c63bf..6507475c1b6 100644 --- a/pkg/analyzer_plugin/tool/spec/generate_all.dart +++ b/pkg/analyzer_plugin/tool/spec/generate_all.dart @@ -28,9 +28,7 @@ List get allTargets { targets.add(codegen_inttest_methods.target); targets.add(codegen_matchers.target); targets.add(codegen_protocol_common.pluginTarget(true)); - // TODO(scheglov) Migrate analysis_server_client - // https://github.com/dart-lang/sdk/issues/45500 - // targets.add(codegen_protocol_common.clientTarget(true)); + targets.add(codegen_protocol_common.clientTarget(true)); targets.add(codegen_protocol_constants.target); targets.add(to_html.target); return targets;