| // 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:analyzer/src/generated/utilities_general.dart'; |
| import 'package:analyzer_plugin/protocol/protocol.dart'; |
| import 'package:analyzer_plugin/src/protocol/protocol_internal.dart'; |
| import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| |
| /// AnalysisErrorFixes |
| /// |
| /// { |
| /// "error": AnalysisError |
| /// "fixes": List<PrioritizedSourceChange> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisErrorFixes implements HasToJson { |
| AnalysisError _error; |
| |
| List<PrioritizedSourceChange> _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; |
| } |
| |
| /// The fixes associated with the error. |
| List<PrioritizedSourceChange> get fixes => _fixes; |
| |
| /// The fixes associated with the error. |
| set fixes(List<PrioritizedSourceChange> value) { |
| assert(value != null); |
| _fixes = value; |
| } |
| |
| AnalysisErrorFixes(AnalysisError error, |
| {List<PrioritizedSourceChange> fixes}) { |
| this.error = error; |
| if (fixes == null) { |
| this.fixes = <PrioritizedSourceChange>[]; |
| } else { |
| this.fixes = fixes; |
| } |
| } |
| |
| 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<PrioritizedSourceChange> fixes; |
| if (json.containsKey('fixes')) { |
| fixes = jsonDecoder.decodeList( |
| jsonPath + '.fixes', |
| json['fixes'], |
| (String jsonPath, Object json) => |
| PrioritizedSourceChange.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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['error'] = error.toJson(); |
| result['fixes'] = |
| fixes.map((PrioritizedSourceChange 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, |
| (PrioritizedSourceChange a, PrioritizedSourceChange b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, error.hashCode); |
| hash = JenkinsSmiHash.combine(hash, fixes.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.errors params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "errors": List<AnalysisError> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisErrorsParams implements HasToJson { |
| String _file; |
| |
| List<AnalysisError> _errors; |
| |
| /// The file containing the errors. |
| String get file => _file; |
| |
| /// The file containing the errors. |
| set file(String value) { |
| assert(value != null); |
| _file = value; |
| } |
| |
| /// The errors contained in the file. |
| List<AnalysisError> get errors => _errors; |
| |
| /// The errors contained in the file. |
| set errors(List<AnalysisError> value) { |
| assert(value != null); |
| _errors = value; |
| } |
| |
| AnalysisErrorsParams(String file, List<AnalysisError> errors) { |
| this.file = file; |
| this.errors = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, errors.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.folding params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "regions": List<FoldingRegion> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisFoldingParams implements HasToJson { |
| String _file; |
| |
| List<FoldingRegion> _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; |
| } |
| |
| /// The folding regions contained in the file. |
| List<FoldingRegion> get regions => _regions; |
| |
| /// The folding regions contained in the file. |
| set regions(List<FoldingRegion> value) { |
| assert(value != null); |
| _regions = value; |
| } |
| |
| AnalysisFoldingParams(String file, List<FoldingRegion> regions) { |
| this.file = file; |
| this.regions = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, regions.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.getNavigation params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "offset": int |
| /// "length": int |
| /// } |
| /// |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// The length of the region for which navigation information is being |
| /// requested. |
| int get length => _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; |
| } |
| |
| 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
| hash = JenkinsSmiHash.combine(hash, length.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// 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 { |
| List<String> _files; |
| |
| List<NavigationTarget> _targets; |
| |
| List<NavigationRegion> _regions; |
| |
| /// A list of the paths of files that are referenced by the navigation |
| /// targets. |
| List<String> get files => _files; |
| |
| /// A list of the paths of files that are referenced by the navigation |
| /// targets. |
| set files(List<String> value) { |
| assert(value != null); |
| _files = value; |
| } |
| |
| /// A list of the navigation targets that are referenced by the navigation |
| /// regions. |
| List<NavigationTarget> get targets => _targets; |
| |
| /// A list of the navigation targets that are referenced by the navigation |
| /// regions. |
| set targets(List<NavigationTarget> value) { |
| assert(value != null); |
| _targets = value; |
| } |
| |
| /// A list of the navigation regions within the requested region of the file. |
| List<NavigationRegion> get regions => _regions; |
| |
| /// A list of the navigation regions within the requested region of the file. |
| set regions(List<NavigationRegion> value) { |
| assert(value != null); |
| _regions = value; |
| } |
| |
| AnalysisGetNavigationResult(List<String> files, |
| List<NavigationTarget> targets, List<NavigationRegion> regions) { |
| this.files = files; |
| this.targets = targets; |
| this.regions = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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, int requestTime) { |
| return Response(id, requestTime, 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, files.hashCode); |
| hash = JenkinsSmiHash.combine(hash, targets.hashCode); |
| hash = JenkinsSmiHash.combine(hash, regions.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.handleWatchEvents params |
| /// |
| /// { |
| /// "events": List<WatchEvent> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisHandleWatchEventsParams implements RequestParams { |
| List<WatchEvent> _events; |
| |
| /// The watch events that the plugin should handle. |
| List<WatchEvent> get events => _events; |
| |
| /// The watch events that the plugin should handle. |
| set events(List<WatchEvent> value) { |
| assert(value != null); |
| _events = value; |
| } |
| |
| AnalysisHandleWatchEventsParams(List<WatchEvent> events) { |
| this.events = events; |
| } |
| |
| factory AnalysisHandleWatchEventsParams.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| List<WatchEvent> events; |
| if (json.containsKey('events')) { |
| events = jsonDecoder.decodeList( |
| jsonPath + '.events', |
| json['events'], |
| (String jsonPath, Object json) => |
| WatchEvent.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'events'); |
| } |
| return AnalysisHandleWatchEventsParams(events); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'analysis.handleWatchEvents params', json); |
| } |
| } |
| |
| factory AnalysisHandleWatchEventsParams.fromRequest(Request request) { |
| return AnalysisHandleWatchEventsParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['events'] = |
| events.map((WatchEvent value) => value.toJson()).toList(); |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'analysis.handleWatchEvents', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisHandleWatchEventsParams) { |
| return listEqual( |
| events, other.events, (WatchEvent a, WatchEvent b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, events.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.handleWatchEvents result |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisHandleWatchEventsResult implements ResponseResult { |
| @override |
| Map<String, dynamic> toJson() => <String, dynamic>{}; |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: null); |
| } |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisHandleWatchEventsResult) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 779767607; |
| } |
| } |
| |
| /// analysis.highlights params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "regions": List<HighlightRegion> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisHighlightsParams implements HasToJson { |
| String _file; |
| |
| List<HighlightRegion> _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; |
| } |
| |
| /// The highlight regions contained in the file. |
| List<HighlightRegion> get regions => _regions; |
| |
| /// The highlight regions contained in the file. |
| set regions(List<HighlightRegion> value) { |
| assert(value != null); |
| _regions = value; |
| } |
| |
| AnalysisHighlightsParams(String file, List<HighlightRegion> regions) { |
| this.file = file; |
| this.regions = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, regions.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// 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 { |
| String _file; |
| |
| List<NavigationRegion> _regions; |
| |
| List<NavigationTarget> _targets; |
| |
| List<String> _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; |
| } |
| |
| /// The navigation regions contained in the file. |
| List<NavigationRegion> get regions => _regions; |
| |
| /// The navigation regions contained in the file. |
| set regions(List<NavigationRegion> value) { |
| assert(value != null); |
| _regions = value; |
| } |
| |
| /// The navigation targets referenced in the file. They are referenced by |
| /// NavigationRegions by their index in this array. |
| List<NavigationTarget> get targets => _targets; |
| |
| /// The navigation targets referenced in the file. They are referenced by |
| /// NavigationRegions by their index in this array. |
| set targets(List<NavigationTarget> value) { |
| assert(value != null); |
| _targets = value; |
| } |
| |
| /// The files containing navigation targets referenced in the file. They are |
| /// referenced by NavigationTargets by their index in this array. |
| List<String> get files => _files; |
| |
| /// The files containing navigation targets referenced in the file. They are |
| /// referenced by NavigationTargets by their index in this array. |
| set files(List<String> value) { |
| assert(value != null); |
| _files = value; |
| } |
| |
| AnalysisNavigationParams(String file, List<NavigationRegion> regions, |
| List<NavigationTarget> targets, List<String> files) { |
| this.file = file; |
| this.regions = regions; |
| this.targets = targets; |
| this.files = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, regions.hashCode); |
| hash = JenkinsSmiHash.combine(hash, targets.hashCode); |
| hash = JenkinsSmiHash.combine(hash, files.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.occurrences params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "occurrences": List<Occurrences> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisOccurrencesParams implements HasToJson { |
| String _file; |
| |
| List<Occurrences> _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; |
| } |
| |
| /// The occurrences of references to elements within the file. |
| List<Occurrences> get occurrences => _occurrences; |
| |
| /// The occurrences of references to elements within the file. |
| set occurrences(List<Occurrences> value) { |
| assert(value != null); |
| _occurrences = value; |
| } |
| |
| AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) { |
| this.file = file; |
| this.occurrences = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, occurrences.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.outline params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "outline": List<Outline> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisOutlineParams implements HasToJson { |
| String _file; |
| |
| List<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; |
| } |
| |
| /// The outline fragments associated with the file. |
| List<Outline> get outline => _outline; |
| |
| /// The outline fragments associated with the file. |
| set outline(List<Outline> value) { |
| assert(value != null); |
| _outline = value; |
| } |
| |
| AnalysisOutlineParams(String file, List<Outline> outline) { |
| this.file = file; |
| this.outline = outline; |
| } |
| |
| 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'); |
| } |
| List<Outline> outline; |
| if (json.containsKey('outline')) { |
| outline = jsonDecoder.decodeList( |
| jsonPath + '.outline', |
| json['outline'], |
| (String jsonPath, Object json) => |
| Outline.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'outline'); |
| } |
| return AnalysisOutlineParams(file, outline); |
| } 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['file'] = file; |
| result['outline'] = outline.map((Outline value) => value.toJson()).toList(); |
| 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 && |
| listEqual(outline, other.outline, (Outline a, Outline b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, outline.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// AnalysisService |
| /// |
| /// enum { |
| /// FOLDING |
| /// HIGHLIGHTS |
| /// NAVIGATION |
| /// OCCURRENCES |
| /// OUTLINE |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisService implements Enum { |
| static const AnalysisService FOLDING = AnalysisService._('FOLDING'); |
| |
| static const AnalysisService HIGHLIGHTS = AnalysisService._('HIGHLIGHTS'); |
| |
| static const AnalysisService NAVIGATION = AnalysisService._('NAVIGATION'); |
| |
| static const AnalysisService OCCURRENCES = AnalysisService._('OCCURRENCES'); |
| |
| static const AnalysisService OUTLINE = AnalysisService._('OUTLINE'); |
| |
| /// A list containing all of the enum values that are defined. |
| static const List<AnalysisService> VALUES = <AnalysisService>[ |
| FOLDING, |
| HIGHLIGHTS, |
| NAVIGATION, |
| OCCURRENCES, |
| OUTLINE |
| ]; |
| |
| @override |
| final String name; |
| |
| const AnalysisService._(this.name); |
| |
| factory AnalysisService(String name) { |
| switch (name) { |
| case 'FOLDING': |
| return FOLDING; |
| case 'HIGHLIGHTS': |
| return HIGHLIGHTS; |
| case 'NAVIGATION': |
| return NAVIGATION; |
| case 'OCCURRENCES': |
| return OCCURRENCES; |
| case 'OUTLINE': |
| return OUTLINE; |
| } |
| 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.setContextRoots params |
| /// |
| /// { |
| /// "roots": List<ContextRoot> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisSetContextRootsParams implements RequestParams { |
| List<ContextRoot> _roots; |
| |
| /// A list of the context roots that should be analyzed. |
| List<ContextRoot> get roots => _roots; |
| |
| /// A list of the context roots that should be analyzed. |
| set roots(List<ContextRoot> value) { |
| assert(value != null); |
| _roots = value; |
| } |
| |
| AnalysisSetContextRootsParams(List<ContextRoot> roots) { |
| this.roots = roots; |
| } |
| |
| factory AnalysisSetContextRootsParams.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| List<ContextRoot> roots; |
| if (json.containsKey('roots')) { |
| roots = jsonDecoder.decodeList( |
| jsonPath + '.roots', |
| json['roots'], |
| (String jsonPath, Object json) => |
| ContextRoot.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'roots'); |
| } |
| return AnalysisSetContextRootsParams(roots); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'analysis.setContextRoots params', json); |
| } |
| } |
| |
| factory AnalysisSetContextRootsParams.fromRequest(Request request) { |
| return AnalysisSetContextRootsParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['roots'] = roots.map((ContextRoot value) => value.toJson()).toList(); |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'analysis.setContextRoots', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisSetContextRootsParams) { |
| return listEqual( |
| roots, other.roots, (ContextRoot a, ContextRoot b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, roots.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.setContextRoots result |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisSetContextRootsResult implements ResponseResult { |
| @override |
| Map<String, dynamic> toJson() => <String, dynamic>{}; |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: null); |
| } |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisSetContextRootsResult) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 969645618; |
| } |
| } |
| |
| /// analysis.setPriorityFiles params |
| /// |
| /// { |
| /// "files": List<FilePath> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisSetPriorityFilesParams implements RequestParams { |
| List<String> _files; |
| |
| /// The files that are to be a priority for analysis. |
| List<String> get files => _files; |
| |
| /// The files that are to be a priority for analysis. |
| set files(List<String> value) { |
| assert(value != null); |
| _files = value; |
| } |
| |
| AnalysisSetPriorityFilesParams(List<String> files) { |
| this.files = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, files.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.setPriorityFiles result |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisSetPriorityFilesResult implements ResponseResult { |
| @override |
| Map<String, dynamic> toJson() => <String, dynamic>{}; |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: null); |
| } |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisSetPriorityFilesResult) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 330050055; |
| } |
| } |
| |
| /// analysis.setSubscriptions params |
| /// |
| /// { |
| /// "subscriptions": Map<AnalysisService, List<FilePath>> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisSetSubscriptionsParams implements RequestParams { |
| Map<AnalysisService, List<String>> _subscriptions; |
| |
| /// A table mapping services to a list of the files being subscribed to the |
| /// service. |
| Map<AnalysisService, List<String>> get subscriptions => _subscriptions; |
| |
| /// A table mapping services to a list of the files being subscribed to the |
| /// service. |
| set subscriptions(Map<AnalysisService, List<String>> value) { |
| assert(value != null); |
| _subscriptions = value; |
| } |
| |
| AnalysisSetSubscriptionsParams( |
| Map<AnalysisService, List<String>> subscriptions) { |
| this.subscriptions = 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, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| 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 { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.setSubscriptions result |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisSetSubscriptionsResult implements ResponseResult { |
| @override |
| Map<String, dynamic> toJson() => <String, dynamic>{}; |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: null); |
| } |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisSetSubscriptionsResult) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 218088493; |
| } |
| } |
| |
| /// analysis.updateContent params |
| /// |
| /// { |
| /// "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisUpdateContentParams implements RequestParams { |
| Map<String, dynamic> _files; |
| |
| /// A table mapping the files whose content has changed to a description of |
| /// the content change. |
| Map<String, dynamic> get files => _files; |
| |
| /// A table mapping the files whose content has changed to a description of |
| /// the content change. |
| set files(Map<String, dynamic> value) { |
| assert(value != null); |
| _files = value; |
| } |
| |
| AnalysisUpdateContentParams(Map<String, dynamic> files) { |
| this.files = files; |
| } |
| |
| factory AnalysisUpdateContentParams.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| Map<String, dynamic> files; |
| if (json.containsKey('files')) { |
| files = jsonDecoder.decodeMap(jsonPath + '.files', json['files'], |
| valueDecoder: (String jsonPath, Object json) => |
| jsonDecoder.decodeUnion(jsonPath, json as Map, 'type', { |
| 'add': (String jsonPath, Object json) => |
| AddContentOverlay.fromJson(jsonDecoder, jsonPath, json), |
| 'change': (String jsonPath, Object json) => |
| ChangeContentOverlay.fromJson( |
| jsonDecoder, jsonPath, json), |
| 'remove': (String jsonPath, Object json) => |
| RemoveContentOverlay.fromJson(jsonDecoder, jsonPath, json) |
| })); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'files'); |
| } |
| return AnalysisUpdateContentParams(files); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'analysis.updateContent params', json); |
| } |
| } |
| |
| factory AnalysisUpdateContentParams.fromRequest(Request request) { |
| return AnalysisUpdateContentParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['files'] = |
| mapMap(files, valueCallback: (dynamic value) => value.toJson()); |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'analysis.updateContent', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisUpdateContentParams) { |
| return mapEqual(files, other.files, (dynamic a, dynamic b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, files.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// analysis.updateContent result |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class AnalysisUpdateContentResult implements ResponseResult { |
| @override |
| Map<String, dynamic> toJson() => <String, dynamic>{}; |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: null); |
| } |
| |
| @override |
| bool operator ==(other) { |
| if (other is AnalysisUpdateContentResult) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 468798730; |
| } |
| } |
| |
| /// completion.getSuggestions params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "offset": int |
| /// } |
| /// |
| /// 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; |
| } |
| |
| /// The offset within the file at which suggestions are to be made. |
| int get offset => _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; |
| } |
| |
| factory CompletionGetSuggestionsParams.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 CompletionGetSuggestionsParams(file, offset); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'completion.getSuggestions params', json); |
| } |
| } |
| |
| factory CompletionGetSuggestionsParams.fromRequest(Request request) { |
| return CompletionGetSuggestionsParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['file'] = file; |
| result['offset'] = offset; |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'completion.getSuggestions', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is CompletionGetSuggestionsParams) { |
| return file == other.file && offset == other.offset; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// completion.getSuggestions result |
| /// |
| /// { |
| /// "replacementOffset": int |
| /// "replacementLength": int |
| /// "results": List<CompletionSuggestion> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class CompletionGetSuggestionsResult implements ResponseResult { |
| int _replacementOffset; |
| |
| int _replacementLength; |
| |
| List<CompletionSuggestion> _results; |
| |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// 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<CompletionSuggestion> 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<CompletionSuggestion> value) { |
| assert(value != null); |
| _results = value; |
| } |
| |
| CompletionGetSuggestionsResult(int replacementOffset, int replacementLength, |
| List<CompletionSuggestion> results) { |
| this.replacementOffset = replacementOffset; |
| this.replacementLength = replacementLength; |
| this.results = results; |
| } |
| |
| factory CompletionGetSuggestionsResult.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| int replacementOffset; |
| if (json.containsKey('replacementOffset')) { |
| replacementOffset = jsonDecoder.decodeInt( |
| jsonPath + '.replacementOffset', json['replacementOffset']); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'replacementOffset'); |
| } |
| int replacementLength; |
| if (json.containsKey('replacementLength')) { |
| replacementLength = jsonDecoder.decodeInt( |
| jsonPath + '.replacementLength', json['replacementLength']); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'replacementLength'); |
| } |
| List<CompletionSuggestion> results; |
| if (json.containsKey('results')) { |
| results = jsonDecoder.decodeList( |
| jsonPath + '.results', |
| json['results'], |
| (String jsonPath, Object json) => |
| CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'results'); |
| } |
| return CompletionGetSuggestionsResult( |
| replacementOffset, replacementLength, results); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'completion.getSuggestions result', json); |
| } |
| } |
| |
| factory CompletionGetSuggestionsResult.fromResponse(Response response) { |
| return CompletionGetSuggestionsResult.fromJson( |
| ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 'result', |
| response.result); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['replacementOffset'] = replacementOffset; |
| result['replacementLength'] = replacementLength; |
| result['results'] = |
| results.map((CompletionSuggestion value) => value.toJson()).toList(); |
| return result; |
| } |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is CompletionGetSuggestionsResult) { |
| return replacementOffset == other.replacementOffset && |
| replacementLength == other.replacementLength && |
| listEqual(results, other.results, |
| (CompletionSuggestion a, CompletionSuggestion b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, replacementOffset.hashCode); |
| hash = JenkinsSmiHash.combine(hash, replacementLength.hashCode); |
| hash = JenkinsSmiHash.combine(hash, results.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// ContextRoot |
| /// |
| /// { |
| /// "root": FilePath |
| /// "exclude": List<FilePath> |
| /// "optionsFile": optional FilePath |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class ContextRoot implements HasToJson { |
| String _root; |
| |
| List<String> _exclude; |
| |
| String _optionsFile; |
| |
| /// The absolute path of the root directory containing the files to be |
| /// analyzed. |
| String get root => _root; |
| |
| /// The absolute path of the root directory containing the files to be |
| /// analyzed. |
| set root(String value) { |
| assert(value != null); |
| _root = value; |
| } |
| |
| /// A list of the absolute paths of files and directories within the root |
| /// directory that should not be analyzed. |
| List<String> get exclude => _exclude; |
| |
| /// A list of the absolute paths of files and directories within the root |
| /// directory that should not be analyzed. |
| set exclude(List<String> value) { |
| assert(value != null); |
| _exclude = value; |
| } |
| |
| /// The absolute path of the analysis options file that should be used to |
| /// control the analysis of the files in the context. |
| String get optionsFile => _optionsFile; |
| |
| /// The absolute path of the analysis options file that should be used to |
| /// control the analysis of the files in the context. |
| set optionsFile(String value) { |
| _optionsFile = value; |
| } |
| |
| ContextRoot(String root, List<String> exclude, {String optionsFile}) { |
| this.root = root; |
| this.exclude = exclude; |
| this.optionsFile = optionsFile; |
| } |
| |
| factory ContextRoot.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| String root; |
| if (json.containsKey('root')) { |
| root = jsonDecoder.decodeString(jsonPath + '.root', json['root']); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'root'); |
| } |
| List<String> exclude; |
| if (json.containsKey('exclude')) { |
| exclude = jsonDecoder.decodeList( |
| jsonPath + '.exclude', json['exclude'], jsonDecoder.decodeString); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'exclude'); |
| } |
| String optionsFile; |
| if (json.containsKey('optionsFile')) { |
| optionsFile = jsonDecoder.decodeString( |
| jsonPath + '.optionsFile', json['optionsFile']); |
| } |
| return ContextRoot(root, exclude, optionsFile: optionsFile); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'ContextRoot', json); |
| } |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['root'] = root; |
| result['exclude'] = exclude; |
| if (optionsFile != null) { |
| result['optionsFile'] = optionsFile; |
| } |
| return result; |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is ContextRoot) { |
| return root == other.root && |
| listEqual(exclude, other.exclude, (String a, String b) => a == b) && |
| optionsFile == other.optionsFile; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, root.hashCode); |
| hash = JenkinsSmiHash.combine(hash, exclude.hashCode); |
| hash = JenkinsSmiHash.combine(hash, optionsFile.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// convertGetterToMethod feedback |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class ConvertGetterToMethodFeedback extends RefactoringFeedback |
| implements HasToJson { |
| @override |
| bool operator ==(other) { |
| if (other is ConvertGetterToMethodFeedback) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 616032599; |
| } |
| } |
| |
| /// convertGetterToMethod options |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class ConvertGetterToMethodOptions extends RefactoringOptions |
| implements HasToJson { |
| @override |
| bool operator ==(other) { |
| if (other is ConvertGetterToMethodOptions) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 488848400; |
| } |
| } |
| |
| /// convertMethodToGetter feedback |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class ConvertMethodToGetterFeedback extends RefactoringFeedback |
| implements HasToJson { |
| @override |
| bool operator ==(other) { |
| if (other is ConvertMethodToGetterFeedback) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 165291526; |
| } |
| } |
| |
| /// convertMethodToGetter options |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class ConvertMethodToGetterOptions extends RefactoringOptions |
| implements HasToJson { |
| @override |
| bool operator ==(other) { |
| if (other is ConvertMethodToGetterOptions) { |
| return true; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| return 27952290; |
| } |
| } |
| |
| /// edit.getAssists params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "offset": int |
| /// "length": int |
| /// } |
| /// |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// The length of the code for which assists are being requested. |
| int get length => _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; |
| } |
| |
| factory EditGetAssistsParams.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 EditGetAssistsParams(file, offset, length); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'edit.getAssists params', json); |
| } |
| } |
| |
| factory EditGetAssistsParams.fromRequest(Request request) { |
| return EditGetAssistsParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['file'] = file; |
| result['offset'] = offset; |
| result['length'] = length; |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'edit.getAssists', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetAssistsParams) { |
| return file == other.file && |
| offset == other.offset && |
| length == other.length; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
| hash = JenkinsSmiHash.combine(hash, length.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getAssists result |
| /// |
| /// { |
| /// "assists": List<PrioritizedSourceChange> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class EditGetAssistsResult implements ResponseResult { |
| List<PrioritizedSourceChange> _assists; |
| |
| /// The assists that are available at the given location. |
| List<PrioritizedSourceChange> get assists => _assists; |
| |
| /// The assists that are available at the given location. |
| set assists(List<PrioritizedSourceChange> value) { |
| assert(value != null); |
| _assists = value; |
| } |
| |
| EditGetAssistsResult(List<PrioritizedSourceChange> assists) { |
| this.assists = assists; |
| } |
| |
| factory EditGetAssistsResult.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| List<PrioritizedSourceChange> assists; |
| if (json.containsKey('assists')) { |
| assists = jsonDecoder.decodeList( |
| jsonPath + '.assists', |
| json['assists'], |
| (String jsonPath, Object json) => |
| PrioritizedSourceChange.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'assists'); |
| } |
| return EditGetAssistsResult(assists); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'edit.getAssists result', json); |
| } |
| } |
| |
| factory EditGetAssistsResult.fromResponse(Response response) { |
| return EditGetAssistsResult.fromJson( |
| ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 'result', |
| response.result); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['assists'] = |
| assists.map((PrioritizedSourceChange value) => value.toJson()).toList(); |
| return result; |
| } |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetAssistsResult) { |
| return listEqual(assists, other.assists, |
| (PrioritizedSourceChange a, PrioritizedSourceChange b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, assists.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getAvailableRefactorings params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "offset": int |
| /// "length": int |
| /// } |
| /// |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// The length of the code on which the refactoring would be based. |
| int get length => _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; |
| } |
| |
| factory EditGetAvailableRefactoringsParams.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 EditGetAvailableRefactoringsParams(file, offset, length); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'edit.getAvailableRefactorings params', json); |
| } |
| } |
| |
| factory EditGetAvailableRefactoringsParams.fromRequest(Request request) { |
| return EditGetAvailableRefactoringsParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['file'] = file; |
| result['offset'] = offset; |
| result['length'] = length; |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'edit.getAvailableRefactorings', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetAvailableRefactoringsParams) { |
| return file == other.file && |
| offset == other.offset && |
| length == other.length; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
| hash = JenkinsSmiHash.combine(hash, length.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getAvailableRefactorings result |
| /// |
| /// { |
| /// "kinds": List<RefactoringKind> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class EditGetAvailableRefactoringsResult implements ResponseResult { |
| List<RefactoringKind> _kinds; |
| |
| /// The kinds of refactorings that are valid for the given selection. |
| /// |
| /// The list of refactoring kinds is currently limited to those defined by |
| /// the server API, preventing plugins from adding their own refactorings. |
| /// However, plugins can support pre-defined refactorings, such as a rename |
| /// refactoring, at locations not supported by server. |
| List<RefactoringKind> get kinds => _kinds; |
| |
| /// The kinds of refactorings that are valid for the given selection. |
| /// |
| /// The list of refactoring kinds is currently limited to those defined by |
| /// the server API, preventing plugins from adding their own refactorings. |
| /// However, plugins can support pre-defined refactorings, such as a rename |
| /// refactoring, at locations not supported by server. |
| set kinds(List<RefactoringKind> value) { |
| assert(value != null); |
| _kinds = value; |
| } |
| |
| EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) { |
| this.kinds = kinds; |
| } |
| |
| factory EditGetAvailableRefactoringsResult.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| List<RefactoringKind> kinds; |
| if (json.containsKey('kinds')) { |
| kinds = jsonDecoder.decodeList( |
| jsonPath + '.kinds', |
| json['kinds'], |
| (String jsonPath, Object json) => |
| RefactoringKind.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'kinds'); |
| } |
| return EditGetAvailableRefactoringsResult(kinds); |
| } else { |
| throw jsonDecoder.mismatch( |
| jsonPath, 'edit.getAvailableRefactorings result', json); |
| } |
| } |
| |
| factory EditGetAvailableRefactoringsResult.fromResponse(Response response) { |
| return EditGetAvailableRefactoringsResult.fromJson( |
| ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 'result', |
| response.result); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['kinds'] = |
| kinds.map((RefactoringKind value) => value.toJson()).toList(); |
| return result; |
| } |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetAvailableRefactoringsResult) { |
| return listEqual( |
| kinds, other.kinds, (RefactoringKind a, RefactoringKind b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, kinds.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getFixes params |
| /// |
| /// { |
| /// "file": FilePath |
| /// "offset": int |
| /// } |
| /// |
| /// 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; |
| } |
| |
| /// The offset used to select the errors for which fixes will be returned. |
| int get offset => _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; |
| } |
| |
| factory EditGetFixesParams.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 EditGetFixesParams(file, offset); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'edit.getFixes params', json); |
| } |
| } |
| |
| factory EditGetFixesParams.fromRequest(Request request) { |
| return EditGetFixesParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['file'] = file; |
| result['offset'] = offset; |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'edit.getFixes', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetFixesParams) { |
| return file == other.file && offset == other.offset; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getFixes result |
| /// |
| /// { |
| /// "fixes": List<AnalysisErrorFixes> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class EditGetFixesResult implements ResponseResult { |
| List<AnalysisErrorFixes> _fixes; |
| |
| /// The fixes that are available for the errors at the given offset. |
| List<AnalysisErrorFixes> get fixes => _fixes; |
| |
| /// The fixes that are available for the errors at the given offset. |
| set fixes(List<AnalysisErrorFixes> value) { |
| assert(value != null); |
| _fixes = value; |
| } |
| |
| EditGetFixesResult(List<AnalysisErrorFixes> fixes) { |
| this.fixes = fixes; |
| } |
| |
| factory EditGetFixesResult.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| List<AnalysisErrorFixes> fixes; |
| if (json.containsKey('fixes')) { |
| fixes = jsonDecoder.decodeList( |
| jsonPath + '.fixes', |
| json['fixes'], |
| (String jsonPath, Object json) => |
| AnalysisErrorFixes.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'fixes'); |
| } |
| return EditGetFixesResult(fixes); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'edit.getFixes result', json); |
| } |
| } |
| |
| factory EditGetFixesResult.fromResponse(Response response) { |
| return EditGetFixesResult.fromJson( |
| ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 'result', |
| response.result); |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['fixes'] = |
| fixes.map((AnalysisErrorFixes value) => value.toJson()).toList(); |
| return result; |
| } |
| |
| @override |
| Response toResponse(String id, int requestTime) { |
| return Response(id, requestTime, result: toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetFixesResult) { |
| return listEqual(fixes, other.fixes, |
| (AnalysisErrorFixes a, AnalysisErrorFixes b) => a == b); |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, fixes.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getRefactoring params |
| /// |
| /// { |
| /// "kind": RefactoringKind |
| /// "file": FilePath |
| /// "offset": int |
| /// "length": int |
| /// "validateOnly": bool |
| /// "options": optional RefactoringOptions |
| /// } |
| /// |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// 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; |
| } |
| |
| /// 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; |
| |
| /// 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; |
| } |
| |
| factory EditGetRefactoringParams.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| RefactoringKind kind; |
| if (json.containsKey('kind')) { |
| kind = RefactoringKind.fromJson( |
| jsonDecoder, jsonPath + '.kind', json['kind']); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'kind'); |
| } |
| 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'); |
| } |
| bool validateOnly; |
| if (json.containsKey('validateOnly')) { |
| validateOnly = jsonDecoder.decodeBool( |
| jsonPath + '.validateOnly', json['validateOnly']); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'validateOnly'); |
| } |
| RefactoringOptions options; |
| if (json.containsKey('options')) { |
| options = RefactoringOptions.fromJson( |
| jsonDecoder, jsonPath + '.options', json['options'], kind); |
| } |
| return EditGetRefactoringParams(kind, file, offset, length, validateOnly, |
| options: options); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'edit.getRefactoring params', json); |
| } |
| } |
| |
| factory EditGetRefactoringParams.fromRequest(Request request) { |
| var params = EditGetRefactoringParams.fromJson( |
| RequestDecoder(request), 'params', request.params); |
| REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind; |
| return params; |
| } |
| |
| @override |
| Map<String, dynamic> toJson() { |
| var result = <String, dynamic>{}; |
| result['kind'] = kind.toJson(); |
| result['file'] = file; |
| result['offset'] = offset; |
| result['length'] = length; |
| result['validateOnly'] = validateOnly; |
| if (options != null) { |
| result['options'] = options.toJson(); |
| } |
| return result; |
| } |
| |
| @override |
| Request toRequest(String id) { |
| return Request(id, 'edit.getRefactoring', toJson()); |
| } |
| |
| @override |
| String toString() => json.encode(toJson()); |
| |
| @override |
| bool operator ==(other) { |
| if (other is EditGetRefactoringParams) { |
| return kind == other.kind && |
| file == other.file && |
| offset == other.offset && |
| length == other.length && |
| validateOnly == other.validateOnly && |
| options == other.options; |
| } |
| return false; |
| } |
| |
| @override |
| int get hashCode { |
| var hash = 0; |
| hash = JenkinsSmiHash.combine(hash, kind.hashCode); |
| hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
| hash = JenkinsSmiHash.combine(hash, length.hashCode); |
| hash = JenkinsSmiHash.combine(hash, validateOnly.hashCode); |
| hash = JenkinsSmiHash.combine(hash, options.hashCode); |
| return JenkinsSmiHash.finish(hash); |
| } |
| } |
| |
| /// edit.getRefactoring result |
| /// |
| /// { |
| /// "initialProblems": List<RefactoringProblem> |
| /// "optionsProblems": List<RefactoringProblem> |
| /// "finalProblems": List<RefactoringProblem> |
| /// "feedback": optional RefactoringFeedback |
| /// "change": optional SourceChange |
| /// "potentialEdits": optional List<String> |
| /// } |
| /// |
| /// Clients may not extend, implement or mix-in this class. |
| class EditGetRefactoringResult implements ResponseResult { |
| List<RefactoringProblem> _initialProblems; |
| |
| List<RefactoringProblem> _optionsProblems; |
| |
| List<RefactoringProblem> _finalProblems; |
| |
| RefactoringFeedback _feedback; |
| |
| SourceChange _change; |
| |
| List<String> _potentialEdits; |
| |
| /// The initial status of the refactoring, that is, problems related to the |
| /// context in which the refactoring is requested. The list should be empty |
| /// if there are no known problems. |
| List<RefactoringProblem> get initialProblems => _initialProblems; |
| |
| /// The initial status of the refactoring, that is, problems related to the |
| /// context in which the refactoring is requested. The list should be empty |
| /// if there are no known problems. |
| set initialProblems(List<RefactoringProblem> value) { |
| assert(value != null); |
| _initialProblems = value; |
| } |
| |
| /// The options validation status, that is, problems in the given options, |
| /// such as light-weight validation of a new name, flags compatibility, etc. |
| /// The list should be empty if there are no known problems. |
| List<RefactoringProblem> get optionsProblems => _optionsProblems; |
| |
| /// The options validation status, that is, problems in the given options, |
| /// such as light-weight validation of a new name, flags compatibility, etc. |
| /// The list should be empty if there are no known problems. |
| set optionsProblems(List<RefactoringProblem> value) { |
| assert(value != null); |
| _optionsProblems = value; |
| } |
| |
| /// The final status of the refactoring, that is, problems identified in the |
| /// result of a full, potentially expensive validation and / or change |
| /// creation. The list should be empty if there are no known problems. |
| List<RefactoringProblem> get finalProblems => _finalProblems; |
| |
| /// The final status of the refactoring, that is, problems identified in the |
| /// result of a full, potentially expensive validation and / or change |
| /// creation. The list should be empty if there are no known problems. |
| set finalProblems(List<RefactoringProblem> value) { |
| assert(value != null); |
| _finalProblems = value; |
| } |
| |
| /// 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; |
| } |
| |
| /// The changes that are to be applied to affect the refactoring. This field |
| /// can 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 |
| /// can 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; |
| } |
| |
| /// 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 |
| /// plugin 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 can be omitted if the change |
| /// field is omitted or if there are no potential edits for the refactoring. |
| List<String> 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 |
| /// plugin 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 can be omitted if the change |
| /// field is omitted or if there are no potential edits for the refactoring. |
| set potentialEdits(List<String> value) { |
| _potentialEdits = value; |
| } |
| |
| EditGetRefactoringResult( |
| List<RefactoringProblem> initialProblems, |
| List<RefactoringProblem> optionsProblems, |
| List<RefactoringProblem> finalProblems, |
| {RefactoringFeedback feedback, |
| SourceChange change, |
| List<String> potentialEdits}) { |
| this.initialProblems = initialProblems; |
| this.optionsProblems = optionsProblems; |
| this.finalProblems = finalProblems; |
| this.feedback = feedback; |
| this.change = change; |
| this.potentialEdits = potentialEdits; |
| } |
| |
| factory EditGetRefactoringResult.fromJson( |
| JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| json ??= {}; |
| if (json is Map) { |
| List<RefactoringProblem> initialProblems; |
| if (json.containsKey('initialProblems')) { |
| initialProblems = jsonDecoder.decodeList( |
| jsonPath + '.initialProblems', |
| json['initialProblems'], |
| (String jsonPath, Object json) => |
| RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'initialProblems'); |
| } |
| List<RefactoringProblem> optionsProblems; |
| if (json.containsKey('optionsProblems')) { |
| optionsProblems = jsonDecoder.decodeList( |
| jsonPath + '.optionsProblems', |
| json['optionsProblems'], |
| (String jsonPath, Object json) => |
| RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); |
| } else { |
| throw jsonDecoder.mismatch(jsonPath, 'optionsProblems'); |
| } |
| List<RefactoringProblem> finalProblems; |
| if (json.containsKey('finalProblems')) { |
| finalProblems = jsonDecoder.decodeList( |
| jsonPath + '.finalProblems', |
| json['finalProblems'], |
| (String |