| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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/spec/generate_files". | 7 // "pkg/analysis_server/spec/generate_files". |
| 8 | 8 |
| 9 part of protocol; | 9 part of protocol; |
| 10 /** | 10 /** |
| (...skipping 9184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9195 /** | 9195 /** |
| 9196 * extractMethod feedback | 9196 * extractMethod feedback |
| 9197 * | 9197 * |
| 9198 * { | 9198 * { |
| 9199 * "offset": int | 9199 * "offset": int |
| 9200 * "length": int | 9200 * "length": int |
| 9201 * "returnType": String | 9201 * "returnType": String |
| 9202 * "names": List<String> | 9202 * "names": List<String> |
| 9203 * "canCreateGetter": bool | 9203 * "canCreateGetter": bool |
| 9204 * "parameters": List<RefactoringMethodParameter> | 9204 * "parameters": List<RefactoringMethodParameter> |
| 9205 * "occurrences": int | |
| 9206 * "offsets": List<int> | 9205 * "offsets": List<int> |
| 9207 * "lengths": List<int> | 9206 * "lengths": List<int> |
| 9208 * } | 9207 * } |
| 9209 */ | 9208 */ |
| 9210 class ExtractMethodFeedback { | 9209 class ExtractMethodFeedback { |
| 9211 /** | 9210 /** |
| 9212 * The offset to the beginning of the expression or statements that will be | 9211 * The offset to the beginning of the expression or statements that will be |
| 9213 * extracted. | 9212 * extracted. |
| 9214 */ | 9213 */ |
| 9215 int offset; | 9214 int offset; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 9233 * True if a getter could be created rather than a method. | 9232 * True if a getter could be created rather than a method. |
| 9234 */ | 9233 */ |
| 9235 bool canCreateGetter; | 9234 bool canCreateGetter; |
| 9236 | 9235 |
| 9237 /** | 9236 /** |
| 9238 * The proposed parameters for the method. | 9237 * The proposed parameters for the method. |
| 9239 */ | 9238 */ |
| 9240 List<RefactoringMethodParameter> parameters; | 9239 List<RefactoringMethodParameter> parameters; |
| 9241 | 9240 |
| 9242 /** | 9241 /** |
| 9243 * The number of times the expression or statements occurs. | |
| 9244 */ | |
| 9245 int occurrences; | |
| 9246 | |
| 9247 /** | |
| 9248 * The offsets of the expressions or statements that would be replaced by an | 9242 * The offsets of the expressions or statements that would be replaced by an |
| 9249 * invocation of the method. | 9243 * invocation of the method. |
| 9250 */ | 9244 */ |
| 9251 List<int> offsets; | 9245 List<int> offsets; |
| 9252 | 9246 |
| 9253 /** | 9247 /** |
| 9254 * The lengths of the expressions or statements that would be replaced by an | 9248 * The lengths of the expressions or statements that would be replaced by an |
| 9255 * invocation of the method. The lengths correspond to the offsets. In other | 9249 * invocation of the method. The lengths correspond to the offsets. In other |
| 9256 * words, for a given expression (or block of statements), if the offset of | 9250 * words, for a given expression (or block of statements), if the offset of |
| 9257 * that expression is offsets[i], then the length of that expression is | 9251 * that expression is offsets[i], then the length of that expression is |
| 9258 * lengths[i]. | 9252 * lengths[i]. |
| 9259 */ | 9253 */ |
| 9260 List<int> lengths; | 9254 List<int> lengths; |
| 9261 | 9255 |
| 9262 ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, t
his.canCreateGetter, this.parameters, this.occurrences, this.offsets, this.lengt
hs); | 9256 ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, t
his.canCreateGetter, this.parameters, this.offsets, this.lengths); |
| 9263 | 9257 |
| 9264 factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | 9258 factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { |
| 9265 if (json == null) { | 9259 if (json == null) { |
| 9266 json = {}; | 9260 json = {}; |
| 9267 } | 9261 } |
| 9268 if (json is Map) { | 9262 if (json is Map) { |
| 9269 int offset; | 9263 int offset; |
| 9270 if (json.containsKey("offset")) { | 9264 if (json.containsKey("offset")) { |
| 9271 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | 9265 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); |
| 9272 } else { | 9266 } else { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 9295 canCreateGetter = jsonDecoder._decodeBool(jsonPath + ".canCreateGetter",
json["canCreateGetter"]); | 9289 canCreateGetter = jsonDecoder._decodeBool(jsonPath + ".canCreateGetter",
json["canCreateGetter"]); |
| 9296 } else { | 9290 } else { |
| 9297 throw jsonDecoder.missingKey(jsonPath, "canCreateGetter"); | 9291 throw jsonDecoder.missingKey(jsonPath, "canCreateGetter"); |
| 9298 } | 9292 } |
| 9299 List<RefactoringMethodParameter> parameters; | 9293 List<RefactoringMethodParameter> parameters; |
| 9300 if (json.containsKey("parameters")) { | 9294 if (json.containsKey("parameters")) { |
| 9301 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); | 9295 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); |
| 9302 } else { | 9296 } else { |
| 9303 throw jsonDecoder.missingKey(jsonPath, "parameters"); | 9297 throw jsonDecoder.missingKey(jsonPath, "parameters"); |
| 9304 } | 9298 } |
| 9305 int occurrences; | |
| 9306 if (json.containsKey("occurrences")) { | |
| 9307 occurrences = jsonDecoder._decodeInt(jsonPath + ".occurrences", json["oc
currences"]); | |
| 9308 } else { | |
| 9309 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | |
| 9310 } | |
| 9311 List<int> offsets; | 9299 List<int> offsets; |
| 9312 if (json.containsKey("offsets")) { | 9300 if (json.containsKey("offsets")) { |
| 9313 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | 9301 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); |
| 9314 } else { | 9302 } else { |
| 9315 throw jsonDecoder.missingKey(jsonPath, "offsets"); | 9303 throw jsonDecoder.missingKey(jsonPath, "offsets"); |
| 9316 } | 9304 } |
| 9317 List<int> lengths; | 9305 List<int> lengths; |
| 9318 if (json.containsKey("lengths")) { | 9306 if (json.containsKey("lengths")) { |
| 9319 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); | 9307 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); |
| 9320 } else { | 9308 } else { |
| 9321 throw jsonDecoder.missingKey(jsonPath, "lengths"); | 9309 throw jsonDecoder.missingKey(jsonPath, "lengths"); |
| 9322 } | 9310 } |
| 9323 return new ExtractMethodFeedback(offset, length, returnType, names, canCre
ateGetter, parameters, occurrences, offsets, lengths); | 9311 return new ExtractMethodFeedback(offset, length, returnType, names, canCre
ateGetter, parameters, offsets, lengths); |
| 9324 } else { | 9312 } else { |
| 9325 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback"); | 9313 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback"); |
| 9326 } | 9314 } |
| 9327 } | 9315 } |
| 9328 | 9316 |
| 9329 factory ExtractMethodFeedback.fromRefactoringResult(EditGetRefactoringResult r
efactoringResult) { | 9317 factory ExtractMethodFeedback.fromRefactoringResult(EditGetRefactoringResult r
efactoringResult) { |
| 9330 return new ExtractMethodFeedback.fromJson( | 9318 return new ExtractMethodFeedback.fromJson( |
| 9331 new ResponseDecoder(), "feedback", refactoringResult.feedback); | 9319 new ResponseDecoder(), "feedback", refactoringResult.feedback); |
| 9332 } | 9320 } |
| 9333 | 9321 |
| 9334 Map<String, dynamic> toJson() { | 9322 Map<String, dynamic> toJson() { |
| 9335 Map<String, dynamic> result = {}; | 9323 Map<String, dynamic> result = {}; |
| 9336 result["offset"] = offset; | 9324 result["offset"] = offset; |
| 9337 result["length"] = length; | 9325 result["length"] = length; |
| 9338 result["returnType"] = returnType; | 9326 result["returnType"] = returnType; |
| 9339 result["names"] = names; | 9327 result["names"] = names; |
| 9340 result["canCreateGetter"] = canCreateGetter; | 9328 result["canCreateGetter"] = canCreateGetter; |
| 9341 result["parameters"] = parameters.map((RefactoringMethodParameter value) =>
value.toJson()).toList(); | 9329 result["parameters"] = parameters.map((RefactoringMethodParameter value) =>
value.toJson()).toList(); |
| 9342 result["occurrences"] = occurrences; | |
| 9343 result["offsets"] = offsets; | 9330 result["offsets"] = offsets; |
| 9344 result["lengths"] = lengths; | 9331 result["lengths"] = lengths; |
| 9345 return result; | 9332 return result; |
| 9346 } | 9333 } |
| 9347 | 9334 |
| 9348 @override | 9335 @override |
| 9349 String toString() => JSON.encode(toJson()); | 9336 String toString() => JSON.encode(toJson()); |
| 9350 | 9337 |
| 9351 @override | 9338 @override |
| 9352 bool operator==(other) { | 9339 bool operator==(other) { |
| 9353 if (other is ExtractMethodFeedback) { | 9340 if (other is ExtractMethodFeedback) { |
| 9354 return offset == other.offset && | 9341 return offset == other.offset && |
| 9355 length == other.length && | 9342 length == other.length && |
| 9356 returnType == other.returnType && | 9343 returnType == other.returnType && |
| 9357 _listEqual(names, other.names, (String a, String b) => a == b) && | 9344 _listEqual(names, other.names, (String a, String b) => a == b) && |
| 9358 canCreateGetter == other.canCreateGetter && | 9345 canCreateGetter == other.canCreateGetter && |
| 9359 _listEqual(parameters, other.parameters, (RefactoringMethodParameter a
, RefactoringMethodParameter b) => a == b) && | 9346 _listEqual(parameters, other.parameters, (RefactoringMethodParameter a
, RefactoringMethodParameter b) => a == b) && |
| 9360 occurrences == other.occurrences && | |
| 9361 _listEqual(offsets, other.offsets, (int a, int b) => a == b) && | 9347 _listEqual(offsets, other.offsets, (int a, int b) => a == b) && |
| 9362 _listEqual(lengths, other.lengths, (int a, int b) => a == b); | 9348 _listEqual(lengths, other.lengths, (int a, int b) => a == b); |
| 9363 } | 9349 } |
| 9364 return false; | 9350 return false; |
| 9365 } | 9351 } |
| 9366 | 9352 |
| 9367 @override | 9353 @override |
| 9368 int get hashCode { | 9354 int get hashCode { |
| 9369 int hash = 0; | 9355 int hash = 0; |
| 9370 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | 9356 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); |
| 9371 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | 9357 hash = _JenkinsSmiHash.combine(hash, length.hashCode); |
| 9372 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | 9358 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); |
| 9373 hash = _JenkinsSmiHash.combine(hash, names.hashCode); | 9359 hash = _JenkinsSmiHash.combine(hash, names.hashCode); |
| 9374 hash = _JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); | 9360 hash = _JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); |
| 9375 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | 9361 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); |
| 9376 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
| 9377 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | 9362 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); |
| 9378 hash = _JenkinsSmiHash.combine(hash, lengths.hashCode); | 9363 hash = _JenkinsSmiHash.combine(hash, lengths.hashCode); |
| 9379 return _JenkinsSmiHash.finish(hash); | 9364 return _JenkinsSmiHash.finish(hash); |
| 9380 } | 9365 } |
| 9381 } | 9366 } |
| 9382 | 9367 |
| 9383 /** | 9368 /** |
| 9384 * extractMethod options | 9369 * extractMethod options |
| 9385 * | 9370 * |
| 9386 * { | 9371 * { |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9775 return false; | 9760 return false; |
| 9776 } | 9761 } |
| 9777 | 9762 |
| 9778 @override | 9763 @override |
| 9779 int get hashCode { | 9764 int get hashCode { |
| 9780 int hash = 0; | 9765 int hash = 0; |
| 9781 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 9766 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 9782 return _JenkinsSmiHash.finish(hash); | 9767 return _JenkinsSmiHash.finish(hash); |
| 9783 } | 9768 } |
| 9784 } | 9769 } |
| OLD | NEW |