| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script | 6 // To regenerate the file, use the script |
| 7 // "pkg/analysis_server/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
| 8 | 8 |
| 9 import 'dart:convert' hide JsonDecoder; | 9 import 'dart:convert' hide JsonDecoder; |
| 10 | 10 |
| (...skipping 7924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7935 hash = JenkinsSmiHash.combine(hash, file.hashCode); | 7935 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| 7936 hash = JenkinsSmiHash.combine(hash, elements.hashCode); | 7936 hash = JenkinsSmiHash.combine(hash, elements.hashCode); |
| 7937 return JenkinsSmiHash.finish(hash); | 7937 return JenkinsSmiHash.finish(hash); |
| 7938 } | 7938 } |
| 7939 } | 7939 } |
| 7940 | 7940 |
| 7941 /** | 7941 /** |
| 7942 * edit.importElements result | 7942 * edit.importElements result |
| 7943 * | 7943 * |
| 7944 * { | 7944 * { |
| 7945 * "edits": List<SourceEdit> | 7945 * "edit": SourceFileEdit |
| 7946 * } | 7946 * } |
| 7947 * | 7947 * |
| 7948 * Clients may not extend, implement or mix-in this class. | 7948 * Clients may not extend, implement or mix-in this class. |
| 7949 */ | 7949 */ |
| 7950 class EditImportElementsResult implements ResponseResult { | 7950 class EditImportElementsResult implements ResponseResult { |
| 7951 List<SourceEdit> _edits; | 7951 SourceFileEdit _edit; |
| 7952 | 7952 |
| 7953 /** | 7953 /** |
| 7954 * The edit(s) to be applied in order to make the specified elements | 7954 * The edits to be applied in order to make the specified elements |
| 7955 * accessible. | 7955 * accessible. The file to be edited will be the defining compilation unit of |
| 7956 * the library containing the file specified in the request, which can be |
| 7957 * different than the file specified in the request if the specified file is |
| 7958 * a part file. |
| 7956 */ | 7959 */ |
| 7957 List<SourceEdit> get edits => _edits; | 7960 SourceFileEdit get edit => _edit; |
| 7958 | 7961 |
| 7959 /** | 7962 /** |
| 7960 * The edit(s) to be applied in order to make the specified elements | 7963 * The edits to be applied in order to make the specified elements |
| 7961 * accessible. | 7964 * accessible. The file to be edited will be the defining compilation unit of |
| 7965 * the library containing the file specified in the request, which can be |
| 7966 * different than the file specified in the request if the specified file is |
| 7967 * a part file. |
| 7962 */ | 7968 */ |
| 7963 void set edits(List<SourceEdit> value) { | 7969 void set edit(SourceFileEdit value) { |
| 7964 assert(value != null); | 7970 assert(value != null); |
| 7965 this._edits = value; | 7971 this._edit = value; |
| 7966 } | 7972 } |
| 7967 | 7973 |
| 7968 EditImportElementsResult(List<SourceEdit> edits) { | 7974 EditImportElementsResult(SourceFileEdit edit) { |
| 7969 this.edits = edits; | 7975 this.edit = edit; |
| 7970 } | 7976 } |
| 7971 | 7977 |
| 7972 factory EditImportElementsResult.fromJson( | 7978 factory EditImportElementsResult.fromJson( |
| 7973 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 7979 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 7974 if (json == null) { | 7980 if (json == null) { |
| 7975 json = {}; | 7981 json = {}; |
| 7976 } | 7982 } |
| 7977 if (json is Map) { | 7983 if (json is Map) { |
| 7978 List<SourceEdit> edits; | 7984 SourceFileEdit edit; |
| 7979 if (json.containsKey("edits")) { | 7985 if (json.containsKey("edit")) { |
| 7980 edits = jsonDecoder.decodeList( | 7986 edit = new SourceFileEdit.fromJson( |
| 7981 jsonPath + ".edits", | 7987 jsonDecoder, jsonPath + ".edit", json["edit"]); |
| 7982 json["edits"], | |
| 7983 (String jsonPath, Object json) => | |
| 7984 new SourceEdit.fromJson(jsonDecoder, jsonPath, json)); | |
| 7985 } else { | 7988 } else { |
| 7986 throw jsonDecoder.mismatch(jsonPath, "edits"); | 7989 throw jsonDecoder.mismatch(jsonPath, "edit"); |
| 7987 } | 7990 } |
| 7988 return new EditImportElementsResult(edits); | 7991 return new EditImportElementsResult(edit); |
| 7989 } else { | 7992 } else { |
| 7990 throw jsonDecoder.mismatch(jsonPath, "edit.importElements result", json); | 7993 throw jsonDecoder.mismatch(jsonPath, "edit.importElements result", json); |
| 7991 } | 7994 } |
| 7992 } | 7995 } |
| 7993 | 7996 |
| 7994 factory EditImportElementsResult.fromResponse(Response response) { | 7997 factory EditImportElementsResult.fromResponse(Response response) { |
| 7995 return new EditImportElementsResult.fromJson( | 7998 return new EditImportElementsResult.fromJson( |
| 7996 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | 7999 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 7997 "result", | 8000 "result", |
| 7998 response.result); | 8001 response.result); |
| 7999 } | 8002 } |
| 8000 | 8003 |
| 8001 @override | 8004 @override |
| 8002 Map<String, dynamic> toJson() { | 8005 Map<String, dynamic> toJson() { |
| 8003 Map<String, dynamic> result = {}; | 8006 Map<String, dynamic> result = {}; |
| 8004 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | 8007 result["edit"] = edit.toJson(); |
| 8005 return result; | 8008 return result; |
| 8006 } | 8009 } |
| 8007 | 8010 |
| 8008 @override | 8011 @override |
| 8009 Response toResponse(String id) { | 8012 Response toResponse(String id) { |
| 8010 return new Response(id, result: toJson()); | 8013 return new Response(id, result: toJson()); |
| 8011 } | 8014 } |
| 8012 | 8015 |
| 8013 @override | 8016 @override |
| 8014 String toString() => JSON.encode(toJson()); | 8017 String toString() => JSON.encode(toJson()); |
| 8015 | 8018 |
| 8016 @override | 8019 @override |
| 8017 bool operator ==(other) { | 8020 bool operator ==(other) { |
| 8018 if (other is EditImportElementsResult) { | 8021 if (other is EditImportElementsResult) { |
| 8019 return listEqual( | 8022 return edit == other.edit; |
| 8020 edits, other.edits, (SourceEdit a, SourceEdit b) => a == b); | |
| 8021 } | 8023 } |
| 8022 return false; | 8024 return false; |
| 8023 } | 8025 } |
| 8024 | 8026 |
| 8025 @override | 8027 @override |
| 8026 int get hashCode { | 8028 int get hashCode { |
| 8027 int hash = 0; | 8029 int hash = 0; |
| 8028 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | 8030 hash = JenkinsSmiHash.combine(hash, edit.hashCode); |
| 8029 return JenkinsSmiHash.finish(hash); | 8031 return JenkinsSmiHash.finish(hash); |
| 8030 } | 8032 } |
| 8031 } | 8033 } |
| 8032 | 8034 |
| 8033 /** | 8035 /** |
| 8034 * edit.isPostfixCompletionApplicable params | 8036 * edit.isPostfixCompletionApplicable params |
| 8035 * | 8037 * |
| 8036 * { | 8038 * { |
| 8037 * "file": FilePath | 8039 * "file": FilePath |
| 8038 * "key": String | 8040 * "key": String |
| (...skipping 7752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15791 hash = JenkinsSmiHash.combine(hash, classElement.hashCode); | 15793 hash = JenkinsSmiHash.combine(hash, classElement.hashCode); |
| 15792 hash = JenkinsSmiHash.combine(hash, displayName.hashCode); | 15794 hash = JenkinsSmiHash.combine(hash, displayName.hashCode); |
| 15793 hash = JenkinsSmiHash.combine(hash, memberElement.hashCode); | 15795 hash = JenkinsSmiHash.combine(hash, memberElement.hashCode); |
| 15794 hash = JenkinsSmiHash.combine(hash, superclass.hashCode); | 15796 hash = JenkinsSmiHash.combine(hash, superclass.hashCode); |
| 15795 hash = JenkinsSmiHash.combine(hash, interfaces.hashCode); | 15797 hash = JenkinsSmiHash.combine(hash, interfaces.hashCode); |
| 15796 hash = JenkinsSmiHash.combine(hash, mixins.hashCode); | 15798 hash = JenkinsSmiHash.combine(hash, mixins.hashCode); |
| 15797 hash = JenkinsSmiHash.combine(hash, subclasses.hashCode); | 15799 hash = JenkinsSmiHash.combine(hash, subclasses.hashCode); |
| 15798 return JenkinsSmiHash.finish(hash); | 15800 return JenkinsSmiHash.finish(hash); |
| 15799 } | 15801 } |
| 15800 } | 15802 } |
| OLD | NEW |