| 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 protocol2; | 9 part of protocol2; |
| 10 | 10 |
| (...skipping 3253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3264 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); | 3264 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); |
| 3265 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | 3265 hash = _JenkinsSmiHash.combine(hash, options.hashCode); |
| 3266 return _JenkinsSmiHash.finish(hash); | 3266 return _JenkinsSmiHash.finish(hash); |
| 3267 } | 3267 } |
| 3268 } | 3268 } |
| 3269 | 3269 |
| 3270 /** | 3270 /** |
| 3271 * edit.getRefactoring result | 3271 * edit.getRefactoring result |
| 3272 * | 3272 * |
| 3273 * { | 3273 * { |
| 3274 * "status": List<RefactoringProblem> | 3274 * "problems": List<RefactoringProblem> |
| 3275 * "feedback": optional object | 3275 * "feedback": optional object |
| 3276 * "change": optional SourceChange | 3276 * "change": optional SourceChange |
| 3277 * "potentialEdits": optional List<String> | 3277 * "potentialEdits": optional List<String> |
| 3278 * } | 3278 * } |
| 3279 */ | 3279 */ |
| 3280 class EditGetRefactoringResult implements HasToJson { | 3280 class EditGetRefactoringResult implements HasToJson { |
| 3281 /** | 3281 /** |
| 3282 * The status of the refactoring. The array will be empty if there are no | 3282 * The status of the refactoring. The array will be empty if there are no |
| 3283 * known problems. | 3283 * known problems. |
| 3284 */ | 3284 */ |
| 3285 List<RefactoringProblem> status; | 3285 List<RefactoringProblem> problems; |
| 3286 | 3286 |
| 3287 /** | 3287 /** |
| 3288 * Data used to provide feedback to the user. The structure of the data is | 3288 * Data used to provide feedback to the user. The structure of the data is |
| 3289 * dependent on the kind of refactoring being created. The data that is | 3289 * dependent on the kind of refactoring being created. The data that is |
| 3290 * returned is documented in the section titled Refactorings, labeled as | 3290 * returned is documented in the section titled Refactorings, labeled as |
| 3291 * “Feedback”. | 3291 * “Feedback”. |
| 3292 */ | 3292 */ |
| 3293 Object feedback; | 3293 Object feedback; |
| 3294 | 3294 |
| 3295 /** | 3295 /** |
| 3296 * The changes that are to be applied to affect the refactoring. This field | 3296 * The changes that are to be applied to affect the refactoring. This field |
| 3297 * will be omitted if there are problems that prevent a set of changes from | 3297 * will be omitted if there are problems that prevent a set of changes from |
| 3298 * being computed, such as having no options specified for a refactoring that | 3298 * being computed, such as having no options specified for a refactoring that |
| 3299 * requires them, or if only validation was requested. | 3299 * requires them, or if only validation was requested. |
| 3300 */ | 3300 */ |
| 3301 SourceChange change; | 3301 SourceChange change; |
| 3302 | 3302 |
| 3303 /** | 3303 /** |
| 3304 * The ids of source edits that are not known to be valid. An edit is not | 3304 * The ids of source edits that are not known to be valid. An edit is not |
| 3305 * known to be valid if there was insufficient type information for the | 3305 * known to be valid if there was insufficient type information for the |
| 3306 * server to be able to determine whether or not the code needs to be | 3306 * server to be able to determine whether or not the code needs to be |
| 3307 * modified, such as when a member is being renamed and there is a reference | 3307 * modified, such as when a member is being renamed and there is a reference |
| 3308 * to a member from an unknown type. This field will be omitted if the change | 3308 * to a member from an unknown type. This field will be omitted if the change |
| 3309 * field is omitted or if there are no potential edits for the refactoring. | 3309 * field is omitted or if there are no potential edits for the refactoring. |
| 3310 */ | 3310 */ |
| 3311 List<String> potentialEdits; | 3311 List<String> potentialEdits; |
| 3312 | 3312 |
| 3313 EditGetRefactoringResult(this.status, {this.feedback, this.change, this.potent
ialEdits}); | 3313 EditGetRefactoringResult(this.problems, {this.feedback, this.change, this.pote
ntialEdits}); |
| 3314 | 3314 |
| 3315 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | 3315 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { |
| 3316 if (json == null) { | 3316 if (json == null) { |
| 3317 json = {}; | 3317 json = {}; |
| 3318 } | 3318 } |
| 3319 if (json is Map) { | 3319 if (json is Map) { |
| 3320 List<RefactoringProblem> status; | 3320 List<RefactoringProblem> problems; |
| 3321 if (json.containsKey("status")) { | 3321 if (json.containsKey("problems")) { |
| 3322 status = jsonDecoder._decodeList(jsonPath + ".status", json["status"], (
String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, js
onPath, json)); | 3322 problems = jsonDecoder._decodeList(jsonPath + ".problems", json["problem
s"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecod
er, jsonPath, json)); |
| 3323 } else { | 3323 } else { |
| 3324 throw jsonDecoder.missingKey(jsonPath, "status"); | 3324 throw jsonDecoder.missingKey(jsonPath, "problems"); |
| 3325 } | 3325 } |
| 3326 Object feedback; | 3326 Object feedback; |
| 3327 if (json.containsKey("feedback")) { | 3327 if (json.containsKey("feedback")) { |
| 3328 feedback = json["feedback"]; | 3328 feedback = json["feedback"]; |
| 3329 } | 3329 } |
| 3330 SourceChange change; | 3330 SourceChange change; |
| 3331 if (json.containsKey("change")) { | 3331 if (json.containsKey("change")) { |
| 3332 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); | 3332 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); |
| 3333 } | 3333 } |
| 3334 List<String> potentialEdits; | 3334 List<String> potentialEdits; |
| 3335 if (json.containsKey("potentialEdits")) { | 3335 if (json.containsKey("potentialEdits")) { |
| 3336 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); | 3336 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); |
| 3337 } | 3337 } |
| 3338 return new EditGetRefactoringResult(status, feedback: feedback, change: ch
ange, potentialEdits: potentialEdits); | 3338 return new EditGetRefactoringResult(problems, feedback: feedback, change:
change, potentialEdits: potentialEdits); |
| 3339 } else { | 3339 } else { |
| 3340 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result"); | 3340 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result"); |
| 3341 } | 3341 } |
| 3342 } | 3342 } |
| 3343 | 3343 |
| 3344 factory EditGetRefactoringResult.fromResponse(Response response) { | 3344 factory EditGetRefactoringResult.fromResponse(Response response) { |
| 3345 return new EditGetRefactoringResult.fromJson( | 3345 return new EditGetRefactoringResult.fromJson( |
| 3346 new ResponseDecoder(), "result", response.result); | 3346 new ResponseDecoder(), "result", response.result); |
| 3347 } | 3347 } |
| 3348 | 3348 |
| 3349 Map<String, dynamic> toJson() { | 3349 Map<String, dynamic> toJson() { |
| 3350 Map<String, dynamic> result = {}; | 3350 Map<String, dynamic> result = {}; |
| 3351 result["status"] = status.map((RefactoringProblem value) => value.toJson()).
toList(); | 3351 result["problems"] = problems.map((RefactoringProblem value) => value.toJson
()).toList(); |
| 3352 if (feedback != null) { | 3352 if (feedback != null) { |
| 3353 result["feedback"] = feedback; | 3353 result["feedback"] = feedback; |
| 3354 } | 3354 } |
| 3355 if (change != null) { | 3355 if (change != null) { |
| 3356 result["change"] = change.toJson(); | 3356 result["change"] = change.toJson(); |
| 3357 } | 3357 } |
| 3358 if (potentialEdits != null) { | 3358 if (potentialEdits != null) { |
| 3359 result["potentialEdits"] = potentialEdits; | 3359 result["potentialEdits"] = potentialEdits; |
| 3360 } | 3360 } |
| 3361 return result; | 3361 return result; |
| 3362 } | 3362 } |
| 3363 | 3363 |
| 3364 Response toResponse(String id) { | 3364 Response toResponse(String id) { |
| 3365 return new Response(id, result: toJson()); | 3365 return new Response(id, result: toJson()); |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 @override | 3368 @override |
| 3369 String toString() => JSON.encode(toJson()); | 3369 String toString() => JSON.encode(toJson()); |
| 3370 | 3370 |
| 3371 @override | 3371 @override |
| 3372 bool operator==(other) { | 3372 bool operator==(other) { |
| 3373 if (other is EditGetRefactoringResult) { | 3373 if (other is EditGetRefactoringResult) { |
| 3374 return _listEqual(status, other.status, (RefactoringProblem a, Refactoring
Problem b) => a == b) && | 3374 return _listEqual(problems, other.problems, (RefactoringProblem a, Refacto
ringProblem b) => a == b) && |
| 3375 feedback == other.feedback && | 3375 feedback == other.feedback && |
| 3376 change == other.change && | 3376 change == other.change && |
| 3377 _listEqual(potentialEdits, other.potentialEdits, (String a, String b)
=> a == b); | 3377 _listEqual(potentialEdits, other.potentialEdits, (String a, String b)
=> a == b); |
| 3378 } | 3378 } |
| 3379 return false; | 3379 return false; |
| 3380 } | 3380 } |
| 3381 | 3381 |
| 3382 @override | 3382 @override |
| 3383 int get hashCode { | 3383 int get hashCode { |
| 3384 int hash = 0; | 3384 int hash = 0; |
| 3385 hash = _JenkinsSmiHash.combine(hash, status.hashCode); | 3385 hash = _JenkinsSmiHash.combine(hash, problems.hashCode); |
| 3386 hash = _JenkinsSmiHash.combine(hash, feedback.hashCode); | 3386 hash = _JenkinsSmiHash.combine(hash, feedback.hashCode); |
| 3387 hash = _JenkinsSmiHash.combine(hash, change.hashCode); | 3387 hash = _JenkinsSmiHash.combine(hash, change.hashCode); |
| 3388 hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode); | 3388 hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode); |
| 3389 return _JenkinsSmiHash.finish(hash); | 3389 return _JenkinsSmiHash.finish(hash); |
| 3390 } | 3390 } |
| 3391 } | 3391 } |
| 3392 | 3392 |
| 3393 /** | 3393 /** |
| 3394 * debug.createContext params | 3394 * debug.createContext params |
| 3395 * | 3395 * |
| (...skipping 5675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9071 return false; | 9071 return false; |
| 9072 } | 9072 } |
| 9073 | 9073 |
| 9074 @override | 9074 @override |
| 9075 int get hashCode { | 9075 int get hashCode { |
| 9076 int hash = 0; | 9076 int hash = 0; |
| 9077 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 9077 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 9078 return _JenkinsSmiHash.finish(hash); | 9078 return _JenkinsSmiHash.finish(hash); |
| 9079 } | 9079 } |
| 9080 } | 9080 } |
| OLD | NEW |