blob: 8cd904d16f859cd08484c8cff1860ae1a946dc85 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// This file has been automatically generated. Please do not edit it manually.
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
import 'dart:convert' hide JsonDecoder;
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/src/protocol/protocol_internal.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// analysis.analyzedFiles params
///
/// {
/// "directories": List<FilePath>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisAnalyzedFilesParams implements HasToJson {
/// A list of the paths of the files that are being analyzed.
List<String> directories;
AnalysisAnalyzedFilesParams(this.directories);
factory AnalysisAnalyzedFilesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<String> directories;
if (json.containsKey('directories')) {
directories = jsonDecoder.decodeList(jsonPath + '.directories',
json['directories'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'directories');
}
return AnalysisAnalyzedFilesParams(directories);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.analyzedFiles params', json);
}
}
factory AnalysisAnalyzedFilesParams.fromNotification(
Notification notification) {
return AnalysisAnalyzedFilesParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['directories'] = directories;
return result;
}
Notification toNotification() {
return Notification('analysis.analyzedFiles', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisAnalyzedFilesParams) {
return listEqual(
directories, other.directories, (String a, String b) => a == b);
}
return false;
}
@override
int get hashCode => directories.hashCode;
}
/// analysis.closingLabels params
///
/// {
/// "file": FilePath
/// "labels": List<ClosingLabel>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisClosingLabelsParams implements HasToJson {
/// The file the closing labels relate to.
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
/// 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.
List<ClosingLabel> labels;
AnalysisClosingLabelsParams(this.file, this.labels);
factory AnalysisClosingLabelsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<ClosingLabel> labels;
if (json.containsKey('labels')) {
labels = jsonDecoder.decodeList(
jsonPath + '.labels',
json['labels'],
(String jsonPath, Object? json) =>
ClosingLabel.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'labels');
}
return AnalysisClosingLabelsParams(file, labels);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.closingLabels params', json);
}
}
factory AnalysisClosingLabelsParams.fromNotification(
Notification notification) {
return AnalysisClosingLabelsParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['labels'] =
labels.map((ClosingLabel value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.closingLabels', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisClosingLabelsParams) {
return file == other.file &&
listEqual(
labels, other.labels, (ClosingLabel a, ClosingLabel b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
labels,
);
}
/// AnalysisErrorFixes
///
/// {
/// "error": AnalysisError
/// "fixes": List<SourceChange>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisErrorFixes implements HasToJson {
/// The error with which the fixes are associated.
AnalysisError error;
/// The fixes associated with the error.
List<SourceChange> fixes;
AnalysisErrorFixes(this.error, {List<SourceChange>? fixes})
: fixes = fixes ?? <SourceChange>[];
factory AnalysisErrorFixes.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
AnalysisError error;
if (json.containsKey('error')) {
error = AnalysisError.fromJson(
jsonDecoder, jsonPath + '.error', json['error']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'error');
}
List<SourceChange> fixes;
if (json.containsKey('fixes')) {
fixes = jsonDecoder.decodeList(
jsonPath + '.fixes',
json['fixes'],
(String jsonPath, Object? json) =>
SourceChange.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'fixes');
}
return AnalysisErrorFixes(error, fixes: fixes);
} else {
throw jsonDecoder.mismatch(jsonPath, 'AnalysisErrorFixes', json);
}
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['error'] = error.toJson();
result['fixes'] =
fixes.map((SourceChange value) => value.toJson()).toList();
return result;
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisErrorFixes) {
return error == other.error &&
listEqual(
fixes, other.fixes, (SourceChange a, SourceChange b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
error,
fixes,
);
}
/// analysis.errors params
///
/// {
/// "file": FilePath
/// "errors": List<AnalysisError>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisErrorsParams implements HasToJson {
/// The file containing the errors.
String file;
/// The errors contained in the file.
List<AnalysisError> errors;
AnalysisErrorsParams(this.file, this.errors);
factory AnalysisErrorsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<AnalysisError> errors;
if (json.containsKey('errors')) {
errors = jsonDecoder.decodeList(
jsonPath + '.errors',
json['errors'],
(String jsonPath, Object? json) =>
AnalysisError.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'errors');
}
return AnalysisErrorsParams(file, errors);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.errors params', json);
}
}
factory AnalysisErrorsParams.fromNotification(Notification notification) {
return AnalysisErrorsParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['errors'] =
errors.map((AnalysisError value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.errors', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisErrorsParams) {
return file == other.file &&
listEqual(errors, other.errors,
(AnalysisError a, AnalysisError b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
errors,
);
}
/// analysis.flushResults params
///
/// {
/// "files": List<FilePath>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisFlushResultsParams implements HasToJson {
/// The files that are no longer being analyzed.
List<String> files;
AnalysisFlushResultsParams(this.files);
factory AnalysisFlushResultsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<String> files;
if (json.containsKey('files')) {
files = jsonDecoder.decodeList(
jsonPath + '.files', json['files'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'files');
}
return AnalysisFlushResultsParams(files);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.flushResults params', json);
}
}
factory AnalysisFlushResultsParams.fromNotification(
Notification notification) {
return AnalysisFlushResultsParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['files'] = files;
return result;
}
Notification toNotification() {
return Notification('analysis.flushResults', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisFlushResultsParams) {
return listEqual(files, other.files, (String a, String b) => a == b);
}
return false;
}
@override
int get hashCode => files.hashCode;
}
/// analysis.folding params
///
/// {
/// "file": FilePath
/// "regions": List<FoldingRegion>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisFoldingParams implements HasToJson {
/// The file containing the folding regions.
String file;
/// The folding regions contained in the file.
List<FoldingRegion> regions;
AnalysisFoldingParams(this.file, this.regions);
factory AnalysisFoldingParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<FoldingRegion> regions;
if (json.containsKey('regions')) {
regions = jsonDecoder.decodeList(
jsonPath + '.regions',
json['regions'],
(String jsonPath, Object? json) =>
FoldingRegion.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'regions');
}
return AnalysisFoldingParams(file, regions);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.folding params', json);
}
}
factory AnalysisFoldingParams.fromNotification(Notification notification) {
return AnalysisFoldingParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['regions'] =
regions.map((FoldingRegion value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.folding', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisFoldingParams) {
return file == other.file &&
listEqual(regions, other.regions,
(FoldingRegion a, FoldingRegion b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
regions,
);
}
/// analysis.getErrors params
///
/// {
/// "file": FilePath
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetErrorsParams implements RequestParams {
/// The file for which errors are being requested.
String file;
AnalysisGetErrorsParams(this.file);
factory AnalysisGetErrorsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
return AnalysisGetErrorsParams(file);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.getErrors params', json);
}
}
factory AnalysisGetErrorsParams.fromRequest(Request request) {
return AnalysisGetErrorsParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.getErrors', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetErrorsParams) {
return file == other.file;
}
return false;
}
@override
int get hashCode => file.hashCode;
}
/// analysis.getErrors result
///
/// {
/// "errors": List<AnalysisError>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetErrorsResult implements ResponseResult {
/// The errors associated with the file.
List<AnalysisError> errors;
AnalysisGetErrorsResult(this.errors);
factory AnalysisGetErrorsResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<AnalysisError> errors;
if (json.containsKey('errors')) {
errors = jsonDecoder.decodeList(
jsonPath + '.errors',
json['errors'],
(String jsonPath, Object? json) =>
AnalysisError.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'errors');
}
return AnalysisGetErrorsResult(errors);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.getErrors result', json);
}
}
factory AnalysisGetErrorsResult.fromResponse(Response response) {
return AnalysisGetErrorsResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['errors'] =
errors.map((AnalysisError value) => value.toJson()).toList();
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetErrorsResult) {
return listEqual(
errors, other.errors, (AnalysisError a, AnalysisError b) => a == b);
}
return false;
}
@override
int get hashCode => errors.hashCode;
}
/// analysis.getHover params
///
/// {
/// "file": FilePath
/// "offset": int
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetHoverParams implements RequestParams {
/// The file in which hover information is being requested.
String file;
/// The offset for which hover information is being requested.
int offset;
AnalysisGetHoverParams(this.file, this.offset);
factory AnalysisGetHoverParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
return AnalysisGetHoverParams(file, offset);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.getHover params', json);
}
}
factory AnalysisGetHoverParams.fromRequest(Request request) {
return AnalysisGetHoverParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['offset'] = offset;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.getHover', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetHoverParams) {
return file == other.file && offset == other.offset;
}
return false;
}
@override
int get hashCode => Object.hash(
file,
offset,
);
}
/// analysis.getHover result
///
/// {
/// "hovers": List<HoverInformation>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetHoverResult implements ResponseResult {
/// 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<HoverInformation> hovers;
AnalysisGetHoverResult(this.hovers);
factory AnalysisGetHoverResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<HoverInformation> hovers;
if (json.containsKey('hovers')) {
hovers = jsonDecoder.decodeList(
jsonPath + '.hovers',
json['hovers'],
(String jsonPath, Object? json) =>
HoverInformation.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'hovers');
}
return AnalysisGetHoverResult(hovers);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.getHover result', json);
}
}
factory AnalysisGetHoverResult.fromResponse(Response response) {
return AnalysisGetHoverResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['hovers'] =
hovers.map((HoverInformation value) => value.toJson()).toList();
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetHoverResult) {
return listEqual(hovers, other.hovers,
(HoverInformation a, HoverInformation b) => a == b);
}
return false;
}
@override
int get hashCode => hovers.hashCode;
}
/// analysis.getImportedElements params
///
/// {
/// "file": FilePath
/// "offset": int
/// "length": int
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetImportedElementsParams implements RequestParams {
/// The file in which import information is being requested.
String file;
/// The offset of the region for which import information is being requested.
int offset;
/// The length of the region for which import information is being requested.
int length;
AnalysisGetImportedElementsParams(this.file, this.offset, this.length);
factory AnalysisGetImportedElementsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
int length;
if (json.containsKey('length')) {
length = jsonDecoder.decodeInt(jsonPath + '.length', json['length']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'length');
}
return AnalysisGetImportedElementsParams(file, offset, length);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getImportedElements params', json);
}
}
factory AnalysisGetImportedElementsParams.fromRequest(Request request) {
return AnalysisGetImportedElementsParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['offset'] = offset;
result['length'] = length;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.getImportedElements', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetImportedElementsParams) {
return file == other.file &&
offset == other.offset &&
length == other.length;
}
return false;
}
@override
int get hashCode => Object.hash(
file,
offset,
length,
);
}
/// analysis.getImportedElements result
///
/// {
/// "elements": List<ImportedElements>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetImportedElementsResult implements ResponseResult {
/// The information about the elements that are referenced in the specified
/// region of the specified file that come from imported libraries.
List<ImportedElements> elements;
AnalysisGetImportedElementsResult(this.elements);
factory AnalysisGetImportedElementsResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<ImportedElements> elements;
if (json.containsKey('elements')) {
elements = jsonDecoder.decodeList(
jsonPath + '.elements',
json['elements'],
(String jsonPath, Object? json) =>
ImportedElements.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'elements');
}
return AnalysisGetImportedElementsResult(elements);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getImportedElements result', json);
}
}
factory AnalysisGetImportedElementsResult.fromResponse(Response response) {
return AnalysisGetImportedElementsResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['elements'] =
elements.map((ImportedElements value) => value.toJson()).toList();
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetImportedElementsResult) {
return listEqual(elements, other.elements,
(ImportedElements a, ImportedElements b) => a == b);
}
return false;
}
@override
int get hashCode => elements.hashCode;
}
/// analysis.getLibraryDependencies params
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetLibraryDependenciesParams implements RequestParams {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Request toRequest(String id) {
return Request(id, 'analysis.getLibraryDependencies', null);
}
@override
bool operator ==(other) {
if (other is AnalysisGetLibraryDependenciesParams) {
return true;
}
return false;
}
@override
int get hashCode => 246577680;
}
/// analysis.getLibraryDependencies result
///
/// {
/// "libraries": List<FilePath>
/// "packageMap": Map<String, Map<String, List<FilePath>>>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetLibraryDependenciesResult implements ResponseResult {
/// A list of the paths of library elements referenced by files in existing
/// analysis roots.
List<String> 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<String, Map<String, List<String>>> packageMap;
AnalysisGetLibraryDependenciesResult(this.libraries, this.packageMap);
factory AnalysisGetLibraryDependenciesResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<String> libraries;
if (json.containsKey('libraries')) {
libraries = jsonDecoder.decodeList(jsonPath + '.libraries',
json['libraries'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'libraries');
}
Map<String, Map<String, List<String>>> packageMap;
if (json.containsKey('packageMap')) {
packageMap = jsonDecoder.decodeMap(
jsonPath + '.packageMap', json['packageMap'],
valueDecoder: (String jsonPath, Object? json) =>
jsonDecoder.decodeMap(jsonPath, json,
valueDecoder: (String jsonPath, Object? json) => jsonDecoder
.decodeList(jsonPath, json, jsonDecoder.decodeString)));
} else {
throw jsonDecoder.mismatch(jsonPath, 'packageMap');
}
return AnalysisGetLibraryDependenciesResult(libraries, packageMap);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getLibraryDependencies result', json);
}
}
factory AnalysisGetLibraryDependenciesResult.fromResponse(Response response) {
return AnalysisGetLibraryDependenciesResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['libraries'] = libraries;
result['packageMap'] = packageMap;
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetLibraryDependenciesResult) {
return listEqual(
libraries, other.libraries, (String a, String b) => a == b) &&
mapEqual(
packageMap,
other.packageMap,
(Map<String, List<String>> a, Map<String, List<String>> b) =>
mapEqual(
a,
b,
(List<String> a, List<String> b) =>
listEqual(a, b, (String a, String b) => a == b)));
}
return false;
}
@override
int get hashCode => Object.hash(
libraries,
packageMap,
);
}
/// analysis.getNavigation params
///
/// {
/// "file": FilePath
/// "offset": int
/// "length": int
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetNavigationParams implements RequestParams {
/// The file in which navigation information is being requested.
String file;
/// The offset of the region for which navigation information is being
/// requested.
int offset;
/// The length of the region for which navigation information is being
/// requested.
int length;
AnalysisGetNavigationParams(this.file, this.offset, this.length);
factory AnalysisGetNavigationParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
int length;
if (json.containsKey('length')) {
length = jsonDecoder.decodeInt(jsonPath + '.length', json['length']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'length');
}
return AnalysisGetNavigationParams(file, offset, length);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getNavigation params', json);
}
}
factory AnalysisGetNavigationParams.fromRequest(Request request) {
return AnalysisGetNavigationParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['offset'] = offset;
result['length'] = length;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.getNavigation', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetNavigationParams) {
return file == other.file &&
offset == other.offset &&
length == other.length;
}
return false;
}
@override
int get hashCode => Object.hash(
file,
offset,
length,
);
}
/// analysis.getNavigation result
///
/// {
/// "files": List<FilePath>
/// "targets": List<NavigationTarget>
/// "regions": List<NavigationRegion>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetNavigationResult implements ResponseResult {
/// A list of the paths of files that are referenced by the navigation
/// targets.
List<String> files;
/// A list of the navigation targets that are referenced by the navigation
/// regions.
List<NavigationTarget> targets;
/// A list of the navigation regions within the requested region of the file.
List<NavigationRegion> regions;
AnalysisGetNavigationResult(this.files, this.targets, this.regions);
factory AnalysisGetNavigationResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<String> files;
if (json.containsKey('files')) {
files = jsonDecoder.decodeList(
jsonPath + '.files', json['files'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'files');
}
List<NavigationTarget> targets;
if (json.containsKey('targets')) {
targets = jsonDecoder.decodeList(
jsonPath + '.targets',
json['targets'],
(String jsonPath, Object? json) =>
NavigationTarget.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'targets');
}
List<NavigationRegion> regions;
if (json.containsKey('regions')) {
regions = jsonDecoder.decodeList(
jsonPath + '.regions',
json['regions'],
(String jsonPath, Object? json) =>
NavigationRegion.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'regions');
}
return AnalysisGetNavigationResult(files, targets, regions);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getNavigation result', json);
}
}
factory AnalysisGetNavigationResult.fromResponse(Response response) {
return AnalysisGetNavigationResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['files'] = files;
result['targets'] =
targets.map((NavigationTarget value) => value.toJson()).toList();
result['regions'] =
regions.map((NavigationRegion value) => value.toJson()).toList();
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetNavigationResult) {
return listEqual(files, other.files, (String a, String b) => a == b) &&
listEqual(targets, other.targets,
(NavigationTarget a, NavigationTarget b) => a == b) &&
listEqual(regions, other.regions,
(NavigationRegion a, NavigationRegion b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
files,
targets,
regions,
);
}
/// analysis.getReachableSources params
///
/// {
/// "file": FilePath
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetReachableSourcesParams implements RequestParams {
/// The file for which reachable source information is being requested.
String file;
AnalysisGetReachableSourcesParams(this.file);
factory AnalysisGetReachableSourcesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
return AnalysisGetReachableSourcesParams(file);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getReachableSources params', json);
}
}
factory AnalysisGetReachableSourcesParams.fromRequest(Request request) {
return AnalysisGetReachableSourcesParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.getReachableSources', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetReachableSourcesParams) {
return file == other.file;
}
return false;
}
@override
int get hashCode => file.hashCode;
}
/// analysis.getReachableSources result
///
/// {
/// "sources": Map<String, List<String>>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetReachableSourcesResult implements ResponseResult {
/// 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.
Map<String, List<String>> sources;
AnalysisGetReachableSourcesResult(this.sources);
factory AnalysisGetReachableSourcesResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
Map<String, List<String>> sources;
if (json.containsKey('sources')) {
sources = jsonDecoder.decodeMap(jsonPath + '.sources', json['sources'],
valueDecoder: (String jsonPath, Object? json) => jsonDecoder
.decodeList(jsonPath, json, jsonDecoder.decodeString));
} else {
throw jsonDecoder.mismatch(jsonPath, 'sources');
}
return AnalysisGetReachableSourcesResult(sources);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getReachableSources result', json);
}
}
factory AnalysisGetReachableSourcesResult.fromResponse(Response response) {
return AnalysisGetReachableSourcesResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['sources'] = sources;
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetReachableSourcesResult) {
return mapEqual(
sources,
other.sources,
(List<String> a, List<String> b) =>
listEqual(a, b, (String a, String b) => a == b));
}
return false;
}
@override
int get hashCode => sources.hashCode;
}
/// analysis.getSignature params
///
/// {
/// "file": FilePath
/// "offset": int
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetSignatureParams implements RequestParams {
/// The file in which signature information is being requested.
String file;
/// The location for which signature information is being requested.
int offset;
AnalysisGetSignatureParams(this.file, this.offset);
factory AnalysisGetSignatureParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
return AnalysisGetSignatureParams(file, offset);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getSignature params', json);
}
}
factory AnalysisGetSignatureParams.fromRequest(Request request) {
return AnalysisGetSignatureParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['offset'] = offset;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.getSignature', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetSignatureParams) {
return file == other.file && offset == other.offset;
}
return false;
}
@override
int get hashCode => Object.hash(
file,
offset,
);
}
/// analysis.getSignature result
///
/// {
/// "name": String
/// "parameters": List<ParameterInfo>
/// "dartdoc": optional String
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisGetSignatureResult implements ResponseResult {
/// The name of the function being invoked at the given offset.
String name;
/// A list of information about each of the parameters of the function being
/// invoked.
List<ParameterInfo> 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? dartdoc;
AnalysisGetSignatureResult(this.name, this.parameters, {this.dartdoc});
factory AnalysisGetSignatureResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String name;
if (json.containsKey('name')) {
name = jsonDecoder.decodeString(jsonPath + '.name', json['name']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'name');
}
List<ParameterInfo> parameters;
if (json.containsKey('parameters')) {
parameters = jsonDecoder.decodeList(
jsonPath + '.parameters',
json['parameters'],
(String jsonPath, Object? json) =>
ParameterInfo.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'parameters');
}
String? dartdoc;
if (json.containsKey('dartdoc')) {
dartdoc =
jsonDecoder.decodeString(jsonPath + '.dartdoc', json['dartdoc']);
}
return AnalysisGetSignatureResult(name, parameters, dartdoc: dartdoc);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.getSignature result', json);
}
}
factory AnalysisGetSignatureResult.fromResponse(Response response) {
return AnalysisGetSignatureResult.fromJson(
ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
'result',
response.result);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['name'] = name;
result['parameters'] =
parameters.map((ParameterInfo value) => value.toJson()).toList();
var dartdoc = this.dartdoc;
if (dartdoc != null) {
result['dartdoc'] = dartdoc;
}
return result;
}
@override
Response toResponse(String id) {
return Response(id, result: toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisGetSignatureResult) {
return name == other.name &&
listEqual(parameters, other.parameters,
(ParameterInfo a, ParameterInfo b) => a == b) &&
dartdoc == other.dartdoc;
}
return false;
}
@override
int get hashCode => Object.hash(
name,
parameters,
dartdoc,
);
}
/// analysis.highlights params
///
/// {
/// "file": FilePath
/// "regions": List<HighlightRegion>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisHighlightsParams implements HasToJson {
/// The file containing the highlight regions.
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<HighlightRegion> regions;
AnalysisHighlightsParams(this.file, this.regions);
factory AnalysisHighlightsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<HighlightRegion> regions;
if (json.containsKey('regions')) {
regions = jsonDecoder.decodeList(
jsonPath + '.regions',
json['regions'],
(String jsonPath, Object? json) =>
HighlightRegion.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'regions');
}
return AnalysisHighlightsParams(file, regions);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.highlights params', json);
}
}
factory AnalysisHighlightsParams.fromNotification(Notification notification) {
return AnalysisHighlightsParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['regions'] =
regions.map((HighlightRegion value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.highlights', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisHighlightsParams) {
return file == other.file &&
listEqual(regions, other.regions,
(HighlightRegion a, HighlightRegion b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
regions,
);
}
/// analysis.implemented params
///
/// {
/// "file": FilePath
/// "classes": List<ImplementedClass>
/// "members": List<ImplementedMember>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisImplementedParams implements HasToJson {
/// The file with which the implementations are associated.
String file;
/// The classes defined in the file that are implemented or extended.
List<ImplementedClass> classes;
/// The member defined in the file that are implemented or overridden.
List<ImplementedMember> members;
AnalysisImplementedParams(this.file, this.classes, this.members);
factory AnalysisImplementedParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<ImplementedClass> classes;
if (json.containsKey('classes')) {
classes = jsonDecoder.decodeList(
jsonPath + '.classes',
json['classes'],
(String jsonPath, Object? json) =>
ImplementedClass.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'classes');
}
List<ImplementedMember> members;
if (json.containsKey('members')) {
members = jsonDecoder.decodeList(
jsonPath + '.members',
json['members'],
(String jsonPath, Object? json) =>
ImplementedMember.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'members');
}
return AnalysisImplementedParams(file, classes, members);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.implemented params', json);
}
}
factory AnalysisImplementedParams.fromNotification(
Notification notification) {
return AnalysisImplementedParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['classes'] =
classes.map((ImplementedClass value) => value.toJson()).toList();
result['members'] =
members.map((ImplementedMember value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.implemented', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisImplementedParams) {
return file == other.file &&
listEqual(classes, other.classes,
(ImplementedClass a, ImplementedClass b) => a == b) &&
listEqual(members, other.members,
(ImplementedMember a, ImplementedMember b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
classes,
members,
);
}
/// analysis.invalidate params
///
/// {
/// "file": FilePath
/// "offset": int
/// "length": int
/// "delta": int
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisInvalidateParams implements HasToJson {
/// The file whose information has been invalidated.
String file;
/// The offset of the invalidated region.
int offset;
/// The length of the invalidated region.
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 delta;
AnalysisInvalidateParams(this.file, this.offset, this.length, this.delta);
factory AnalysisInvalidateParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
int length;
if (json.containsKey('length')) {
length = jsonDecoder.decodeInt(jsonPath + '.length', json['length']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'length');
}
int delta;
if (json.containsKey('delta')) {
delta = jsonDecoder.decodeInt(jsonPath + '.delta', json['delta']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'delta');
}
return AnalysisInvalidateParams(file, offset, length, delta);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.invalidate params', json);
}
}
factory AnalysisInvalidateParams.fromNotification(Notification notification) {
return AnalysisInvalidateParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['offset'] = offset;
result['length'] = length;
result['delta'] = delta;
return result;
}
Notification toNotification() {
return Notification('analysis.invalidate', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisInvalidateParams) {
return file == other.file &&
offset == other.offset &&
length == other.length &&
delta == other.delta;
}
return false;
}
@override
int get hashCode => Object.hash(
file,
offset,
length,
delta,
);
}
/// analysis.navigation params
///
/// {
/// "file": FilePath
/// "regions": List<NavigationRegion>
/// "targets": List<NavigationTarget>
/// "files": List<FilePath>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisNavigationParams implements HasToJson {
/// The file containing the navigation regions.
String file;
/// 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.
List<NavigationRegion> regions;
/// The navigation targets referenced in the file. They are referenced by
/// NavigationRegions by their index in this array.
List<NavigationTarget> targets;
/// The files containing navigation targets referenced in the file. They are
/// referenced by NavigationTargets by their index in this array.
List<String> files;
AnalysisNavigationParams(this.file, this.regions, this.targets, this.files);
factory AnalysisNavigationParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<NavigationRegion> regions;
if (json.containsKey('regions')) {
regions = jsonDecoder.decodeList(
jsonPath + '.regions',
json['regions'],
(String jsonPath, Object? json) =>
NavigationRegion.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'regions');
}
List<NavigationTarget> targets;
if (json.containsKey('targets')) {
targets = jsonDecoder.decodeList(
jsonPath + '.targets',
json['targets'],
(String jsonPath, Object? json) =>
NavigationTarget.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'targets');
}
List<String> files;
if (json.containsKey('files')) {
files = jsonDecoder.decodeList(
jsonPath + '.files', json['files'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'files');
}
return AnalysisNavigationParams(file, regions, targets, files);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.navigation params', json);
}
}
factory AnalysisNavigationParams.fromNotification(Notification notification) {
return AnalysisNavigationParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['regions'] =
regions.map((NavigationRegion value) => value.toJson()).toList();
result['targets'] =
targets.map((NavigationTarget value) => value.toJson()).toList();
result['files'] = files;
return result;
}
Notification toNotification() {
return Notification('analysis.navigation', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisNavigationParams) {
return file == other.file &&
listEqual(regions, other.regions,
(NavigationRegion a, NavigationRegion b) => a == b) &&
listEqual(targets, other.targets,
(NavigationTarget a, NavigationTarget b) => a == b) &&
listEqual(files, other.files, (String a, String b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
regions,
targets,
files,
);
}
/// analysis.occurrences params
///
/// {
/// "file": FilePath
/// "occurrences": List<Occurrences>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisOccurrencesParams implements HasToJson {
/// The file in which the references occur.
String file;
/// The occurrences of references to elements within the file.
List<Occurrences> occurrences;
AnalysisOccurrencesParams(this.file, this.occurrences);
factory AnalysisOccurrencesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<Occurrences> occurrences;
if (json.containsKey('occurrences')) {
occurrences = jsonDecoder.decodeList(
jsonPath + '.occurrences',
json['occurrences'],
(String jsonPath, Object? json) =>
Occurrences.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'occurrences');
}
return AnalysisOccurrencesParams(file, occurrences);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.occurrences params', json);
}
}
factory AnalysisOccurrencesParams.fromNotification(
Notification notification) {
return AnalysisOccurrencesParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['occurrences'] =
occurrences.map((Occurrences value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.occurrences', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisOccurrencesParams) {
return file == other.file &&
listEqual(occurrences, other.occurrences,
(Occurrences a, Occurrences b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
occurrences,
);
}
/// AnalysisOptions
///
/// {
/// "enableAsync": optional bool
/// "enableDeferredLoading": optional bool
/// "enableEnums": optional bool
/// "enableNullAwareOperators": optional bool
/// "enableSuperMixins": optional bool
/// "generateDart2jsHints": optional bool
/// "generateHints": optional bool
/// "generateLints": optional bool
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisOptions implements HasToJson {
/// Deprecated: this feature is always enabled.
///
/// True if the client wants to enable support for the proposed async
/// feature.
bool? enableAsync;
/// Deprecated: this feature is always enabled.
///
/// True if the client wants to enable support for the proposed deferred
/// loading feature.
bool? enableDeferredLoading;
/// Deprecated: this feature is always enabled.
///
/// True if the client wants to enable support for the proposed enum feature.
bool? enableEnums;
/// Deprecated: this feature is always enabled.
///
/// True if the client wants to enable support for the proposed "null aware
/// operators" feature.
bool? enableNullAwareOperators;
/// True if the client wants to enable support for the proposed "less
/// restricted mixins" proposal (DEP 34).
bool? enableSuperMixins;
/// True if hints that are specific to dart2js should be generated. This
/// option is ignored if generateHints is false.
bool? generateDart2jsHints;
/// True if hints should be generated as part of generating errors and
/// warnings.
bool? generateHints;
/// True if lints should be generated as part of generating errors and
/// warnings.
bool? generateLints;
AnalysisOptions(
{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) {
json ??= {};
if (json is Map) {
bool? enableAsync;
if (json.containsKey('enableAsync')) {
enableAsync = jsonDecoder.decodeBool(
jsonPath + '.enableAsync', json['enableAsync']);
}
bool? enableDeferredLoading;
if (json.containsKey('enableDeferredLoading')) {
enableDeferredLoading = jsonDecoder.decodeBool(
jsonPath + '.enableDeferredLoading', json['enableDeferredLoading']);
}
bool? enableEnums;
if (json.containsKey('enableEnums')) {
enableEnums = jsonDecoder.decodeBool(
jsonPath + '.enableEnums', json['enableEnums']);
}
bool? enableNullAwareOperators;
if (json.containsKey('enableNullAwareOperators')) {
enableNullAwareOperators = jsonDecoder.decodeBool(
jsonPath + '.enableNullAwareOperators',
json['enableNullAwareOperators']);
}
bool? enableSuperMixins;
if (json.containsKey('enableSuperMixins')) {
enableSuperMixins = jsonDecoder.decodeBool(
jsonPath + '.enableSuperMixins', json['enableSuperMixins']);
}
bool? generateDart2jsHints;
if (json.containsKey('generateDart2jsHints')) {
generateDart2jsHints = jsonDecoder.decodeBool(
jsonPath + '.generateDart2jsHints', json['generateDart2jsHints']);
}
bool? generateHints;
if (json.containsKey('generateHints')) {
generateHints = jsonDecoder.decodeBool(
jsonPath + '.generateHints', json['generateHints']);
}
bool? generateLints;
if (json.containsKey('generateLints')) {
generateLints = jsonDecoder.decodeBool(
jsonPath + '.generateLints', json['generateLints']);
}
return AnalysisOptions(
enableAsync: enableAsync,
enableDeferredLoading: enableDeferredLoading,
enableEnums: enableEnums,
enableNullAwareOperators: enableNullAwareOperators,
enableSuperMixins: enableSuperMixins,
generateDart2jsHints: generateDart2jsHints,
generateHints: generateHints,
generateLints: generateLints);
} else {
throw jsonDecoder.mismatch(jsonPath, 'AnalysisOptions', json);
}
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
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;
}
return result;
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisOptions) {
return enableAsync == other.enableAsync &&
enableDeferredLoading == other.enableDeferredLoading &&
enableEnums == other.enableEnums &&
enableNullAwareOperators == other.enableNullAwareOperators &&
enableSuperMixins == other.enableSuperMixins &&
generateDart2jsHints == other.generateDart2jsHints &&
generateHints == other.generateHints &&
generateLints == other.generateLints;
}
return false;
}
@override
int get hashCode => Object.hash(
enableAsync,
enableDeferredLoading,
enableEnums,
enableNullAwareOperators,
enableSuperMixins,
generateDart2jsHints,
generateHints,
generateLints,
);
}
/// analysis.outline params
///
/// {
/// "file": FilePath
/// "kind": FileKind
/// "libraryName": optional String
/// "outline": Outline
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisOutlineParams implements HasToJson {
/// The file with which the outline is associated.
String file;
/// The kind of the file.
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? libraryName;
/// The outline associated with the file.
Outline outline;
AnalysisOutlineParams(this.file, this.kind, this.outline, {this.libraryName});
factory AnalysisOutlineParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
FileKind kind;
if (json.containsKey('kind')) {
kind = FileKind.fromJson(jsonDecoder, jsonPath + '.kind', json['kind']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'kind');
}
String? libraryName;
if (json.containsKey('libraryName')) {
libraryName = jsonDecoder.decodeString(
jsonPath + '.libraryName', json['libraryName']);
}
Outline outline;
if (json.containsKey('outline')) {
outline = Outline.fromJson(
jsonDecoder, jsonPath + '.outline', json['outline']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'outline');
}
return AnalysisOutlineParams(file, kind, outline,
libraryName: libraryName);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.outline params', json);
}
}
factory AnalysisOutlineParams.fromNotification(Notification notification) {
return AnalysisOutlineParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['kind'] = kind.toJson();
var libraryName = this.libraryName;
if (libraryName != null) {
result['libraryName'] = libraryName;
}
result['outline'] = outline.toJson();
return result;
}
Notification toNotification() {
return Notification('analysis.outline', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisOutlineParams) {
return file == other.file &&
kind == other.kind &&
libraryName == other.libraryName &&
outline == other.outline;
}
return false;
}
@override
int get hashCode => Object.hash(
file,
kind,
libraryName,
outline,
);
}
/// analysis.overrides params
///
/// {
/// "file": FilePath
/// "overrides": List<Override>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisOverridesParams implements HasToJson {
/// The file with which the overrides are associated.
String file;
/// The overrides associated with the file.
List<Override> overrides;
AnalysisOverridesParams(this.file, this.overrides);
factory AnalysisOverridesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<Override> overrides;
if (json.containsKey('overrides')) {
overrides = jsonDecoder.decodeList(
jsonPath + '.overrides',
json['overrides'],
(String jsonPath, Object? json) =>
Override.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'overrides');
}
return AnalysisOverridesParams(file, overrides);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.overrides params', json);
}
}
factory AnalysisOverridesParams.fromNotification(Notification notification) {
return AnalysisOverridesParams.fromJson(
ResponseDecoder(null), 'params', notification.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['file'] = file;
result['overrides'] =
overrides.map((Override value) => value.toJson()).toList();
return result;
}
Notification toNotification() {
return Notification('analysis.overrides', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisOverridesParams) {
return file == other.file &&
listEqual(
overrides, other.overrides, (Override a, Override b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
file,
overrides,
);
}
/// analysis.reanalyze params
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisReanalyzeParams implements RequestParams {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Request toRequest(String id) {
return Request(id, 'analysis.reanalyze', null);
}
@override
bool operator ==(other) {
if (other is AnalysisReanalyzeParams) {
return true;
}
return false;
}
@override
int get hashCode => 613039876;
}
/// analysis.reanalyze result
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisReanalyzeResult implements ResponseResult {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Response toResponse(String id) {
return Response(id, result: null);
}
@override
bool operator ==(other) {
if (other is AnalysisReanalyzeResult) {
return true;
}
return false;
}
@override
int get hashCode => 846803925;
}
/// AnalysisService
///
/// enum {
/// CLOSING_LABELS
/// FOLDING
/// HIGHLIGHTS
/// IMPLEMENTED
/// INVALIDATE
/// NAVIGATION
/// OCCURRENCES
/// OUTLINE
/// OVERRIDES
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisService implements Enum {
static const AnalysisService CLOSING_LABELS =
AnalysisService._('CLOSING_LABELS');
static const AnalysisService FOLDING = AnalysisService._('FOLDING');
static const AnalysisService HIGHLIGHTS = AnalysisService._('HIGHLIGHTS');
static const AnalysisService IMPLEMENTED = AnalysisService._('IMPLEMENTED');
/// This service is not currently implemented and will become a
/// GeneralAnalysisService in a future release.
static const AnalysisService INVALIDATE = AnalysisService._('INVALIDATE');
static const AnalysisService NAVIGATION = AnalysisService._('NAVIGATION');
static const AnalysisService OCCURRENCES = AnalysisService._('OCCURRENCES');
static const AnalysisService OUTLINE = AnalysisService._('OUTLINE');
static const AnalysisService OVERRIDES = AnalysisService._('OVERRIDES');
/// A list containing all of the enum values that are defined.
static const List<AnalysisService> VALUES = <AnalysisService>[
CLOSING_LABELS,
FOLDING,
HIGHLIGHTS,
IMPLEMENTED,
INVALIDATE,
NAVIGATION,
OCCURRENCES,
OUTLINE,
OVERRIDES
];
@override
final String name;
const AnalysisService._(this.name);
factory AnalysisService(String name) {
switch (name) {
case 'CLOSING_LABELS':
return CLOSING_LABELS;
case 'FOLDING':
return FOLDING;
case 'HIGHLIGHTS':
return HIGHLIGHTS;
case 'IMPLEMENTED':
return IMPLEMENTED;
case 'INVALIDATE':
return INVALIDATE;
case 'NAVIGATION':
return NAVIGATION;
case 'OCCURRENCES':
return OCCURRENCES;
case 'OUTLINE':
return OUTLINE;
case 'OVERRIDES':
return OVERRIDES;
}
throw Exception('Illegal enum value: $name');
}
factory AnalysisService.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
if (json is String) {
try {
return AnalysisService(json);
} catch (_) {
// Fall through
}
}
throw jsonDecoder.mismatch(jsonPath, 'AnalysisService', json);
}
@override
String toString() => 'AnalysisService.$name';
String toJson() => name;
}
/// analysis.setAnalysisRoots params
///
/// {
/// "included": List<FilePath>
/// "excluded": List<FilePath>
/// "packageRoots": optional Map<FilePath, FilePath>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetAnalysisRootsParams implements RequestParams {
/// A list of the files and directories that should be analyzed.
List<String> included;
/// A list of the files and directories within the included directories that
/// should not be analyzed.
List<String> excluded;
/// 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.
Map<String, String>? packageRoots;
AnalysisSetAnalysisRootsParams(this.included, this.excluded,
{this.packageRoots});
factory AnalysisSetAnalysisRootsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<String> included;
if (json.containsKey('included')) {
included = jsonDecoder.decodeList(
jsonPath + '.included', json['included'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'included');
}
List<String> excluded;
if (json.containsKey('excluded')) {
excluded = jsonDecoder.decodeList(
jsonPath + '.excluded', json['excluded'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'excluded');
}
Map<String, String>? packageRoots;
if (json.containsKey('packageRoots')) {
packageRoots = jsonDecoder.decodeMap(
jsonPath + '.packageRoots', json['packageRoots'],
valueDecoder: jsonDecoder.decodeString);
}
return AnalysisSetAnalysisRootsParams(included, excluded,
packageRoots: packageRoots);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.setAnalysisRoots params', json);
}
}
factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) {
return AnalysisSetAnalysisRootsParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['included'] = included;
result['excluded'] = excluded;
var packageRoots = this.packageRoots;
if (packageRoots != null) {
result['packageRoots'] = packageRoots;
}
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.setAnalysisRoots', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisSetAnalysisRootsParams) {
return listEqual(
included, other.included, (String a, String b) => a == b) &&
listEqual(excluded, other.excluded, (String a, String b) => a == b) &&
mapEqual(
packageRoots, other.packageRoots, (String a, String b) => a == b);
}
return false;
}
@override
int get hashCode => Object.hash(
included,
excluded,
packageRoots,
);
}
/// analysis.setAnalysisRoots result
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetAnalysisRootsResult implements ResponseResult {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Response toResponse(String id) {
return Response(id, result: null);
}
@override
bool operator ==(other) {
if (other is AnalysisSetAnalysisRootsResult) {
return true;
}
return false;
}
@override
int get hashCode => 866004753;
}
/// analysis.setGeneralSubscriptions params
///
/// {
/// "subscriptions": List<GeneralAnalysisService>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetGeneralSubscriptionsParams implements RequestParams {
/// A list of the services being subscribed to.
List<GeneralAnalysisService> subscriptions;
AnalysisSetGeneralSubscriptionsParams(this.subscriptions);
factory AnalysisSetGeneralSubscriptionsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<GeneralAnalysisService> subscriptions;
if (json.containsKey('subscriptions')) {
subscriptions = jsonDecoder.decodeList(
jsonPath + '.subscriptions',
json['subscriptions'],
(String jsonPath, Object? json) =>
GeneralAnalysisService.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'subscriptions');
}
return AnalysisSetGeneralSubscriptionsParams(subscriptions);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.setGeneralSubscriptions params', json);
}
}
factory AnalysisSetGeneralSubscriptionsParams.fromRequest(Request request) {
return AnalysisSetGeneralSubscriptionsParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['subscriptions'] = subscriptions
.map((GeneralAnalysisService value) => value.toJson())
.toList();
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.setGeneralSubscriptions', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisSetGeneralSubscriptionsParams) {
return listEqual(subscriptions, other.subscriptions,
(GeneralAnalysisService a, GeneralAnalysisService b) => a == b);
}
return false;
}
@override
int get hashCode => subscriptions.hashCode;
}
/// analysis.setGeneralSubscriptions result
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetGeneralSubscriptionsResult implements ResponseResult {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Response toResponse(String id) {
return Response(id, result: null);
}
@override
bool operator ==(other) {
if (other is AnalysisSetGeneralSubscriptionsResult) {
return true;
}
return false;
}
@override
int get hashCode => 386759562;
}
/// analysis.setPriorityFiles params
///
/// {
/// "files": List<FilePath>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetPriorityFilesParams implements RequestParams {
/// The files that are to be a priority for analysis.
List<String> files;
AnalysisSetPriorityFilesParams(this.files);
factory AnalysisSetPriorityFilesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<String> files;
if (json.containsKey('files')) {
files = jsonDecoder.decodeList(
jsonPath + '.files', json['files'], jsonDecoder.decodeString);
} else {
throw jsonDecoder.mismatch(jsonPath, 'files');
}
return AnalysisSetPriorityFilesParams(files);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.setPriorityFiles params', json);
}
}
factory AnalysisSetPriorityFilesParams.fromRequest(Request request) {
return AnalysisSetPriorityFilesParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['files'] = files;
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.setPriorityFiles', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisSetPriorityFilesParams) {
return listEqual(files, other.files, (String a, String b) => a == b);
}
return false;
}
@override
int get hashCode => files.hashCode;
}
/// analysis.setPriorityFiles result
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetPriorityFilesResult implements ResponseResult {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Response toResponse(String id) {
return Response(id, result: null);
}
@override
bool operator ==(other) {
if (other is AnalysisSetPriorityFilesResult) {
return true;
}
return false;
}
@override
int get hashCode => 330050055;
}
/// analysis.setSubscriptions params
///
/// {
/// "subscriptions": Map<AnalysisService, List<FilePath>>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetSubscriptionsParams implements RequestParams {
/// A table mapping services to a list of the files being subscribed to the
/// service.
Map<AnalysisService, List<String>> subscriptions;
AnalysisSetSubscriptionsParams(this.subscriptions);
factory AnalysisSetSubscriptionsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
Map<AnalysisService, List<String>> subscriptions;
if (json.containsKey('subscriptions')) {
subscriptions = jsonDecoder.decodeMap(
jsonPath + '.subscriptions', json['subscriptions'],
keyDecoder: (String jsonPath, Object? json) =>
AnalysisService.fromJson(jsonDecoder, jsonPath, json),
valueDecoder: (String jsonPath, Object? json) => jsonDecoder
.decodeList(jsonPath, json, jsonDecoder.decodeString));
} else {
throw jsonDecoder.mismatch(jsonPath, 'subscriptions');
}
return AnalysisSetSubscriptionsParams(subscriptions);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.setSubscriptions params', json);
}
}
factory AnalysisSetSubscriptionsParams.fromRequest(Request request) {
return AnalysisSetSubscriptionsParams.fromJson(
RequestDecoder(request), 'params', request.params);
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['subscriptions'] = mapMap(subscriptions,
keyCallback: (AnalysisService value) => value.toJson());
return result;
}
@override
Request toRequest(String id) {
return Request(id, 'analysis.setSubscriptions', toJson());
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisSetSubscriptionsParams) {
return mapEqual(
subscriptions,
other.subscriptions,
(List<String> a, List<String> b) =>
listEqual(a, b, (String a, String b) => a == b));
}
return false;
}
@override
int get hashCode => subscriptions.hashCode;
}
/// analysis.setSubscriptions result
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisSetSubscriptionsResult implements ResponseResult {
@override
Map<String, Object> toJson() => <String, Object>{};
@override
Response toResponse(String id) {
return Response(id, result: null);
}
@override
bool operator ==(other) {
if (other is AnalysisSetSubscriptionsResult) {
return true;
}
return false;
}
@override
int get hashCode => 218088493;
}
/// AnalysisStatus
///
/// {
/// "isAnalyzing": bool
/// "analysisTarget": optional String
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisStatus implements HasToJson {
/// True if analysis is currently being performed.
bool isAnalyzing;
/// The name of the current target of analysis. This field is omitted if
/// analyzing is false.
String? analysisTarget;
AnalysisStatus(this.isAnalyzing, {this.analysisTarget});
factory AnalysisStatus.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
bool isAnalyzing;
if (json.containsKey('isAnalyzing')) {
isAnalyzing = jsonDecoder.decodeBool(
jsonPath + '.isAnalyzing', json['isAnalyzing']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'isAnalyzing');
}
String? analysisTarget;
if (json.containsKey('analysisTarget')) {
analysisTarget = jsonDecoder.decodeString(
jsonPath + '.analysisTarget', json['analysisTarget']);
}
return AnalysisStatus(isAnalyzing, analysisTarget: analysisTarget);
} else {
throw jsonDecoder.mismatch(jsonPath, 'AnalysisStatus', json);
}
}
@override
Map<String, Object> toJson() {
var result = <String, Object>{};
result['isAnalyzing'] = isAnalyzing;
var analysisTarget = this.analysisTarget;
if (analysisTarget != null) {
result['analysisTarget'] = analysisTarget;
}
return result;
}
@override
String toString() => json.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisStatus) {
return isAnalyzing == other.isAnalyzing &&
analysisTarget == other.analysisTarget;
}
return false;
}
@override
int get hashCode => Object.hash(
isAnalyzing,
analysisTarget,
);
}
/// analysis.updateContent params
///
/// {
/// "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
/// }
///
/// Clients may not extend, implement or mix-in this class.
class AnalysisUpdateContentParams implements RequestParams {
/// A table mapping the files whose content has changed to a description of
/// the content change.
Map<String, Object> files;
AnalysisUpdateContentParams(this.files);
factory AnalysisUpdateContentParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};