| 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/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
| 8 | 8 |
| 9 part of protocol; | 9 part of protocol; |
| 10 /** | 10 /** |
| (...skipping 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3570 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); | 3570 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); |
| 3571 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | 3571 hash = _JenkinsSmiHash.combine(hash, options.hashCode); |
| 3572 return _JenkinsSmiHash.finish(hash); | 3572 return _JenkinsSmiHash.finish(hash); |
| 3573 } | 3573 } |
| 3574 } | 3574 } |
| 3575 | 3575 |
| 3576 /** | 3576 /** |
| 3577 * edit.getRefactoring result | 3577 * edit.getRefactoring result |
| 3578 * | 3578 * |
| 3579 * { | 3579 * { |
| 3580 * "problems": List<RefactoringProblem> | 3580 * "initialProblems": List<RefactoringProblem> |
| 3581 * "optionsProblems": List<RefactoringProblem> |
| 3582 * "finalProblems": List<RefactoringProblem> |
| 3581 * "feedback": optional RefactoringFeedback | 3583 * "feedback": optional RefactoringFeedback |
| 3582 * "change": optional SourceChange | 3584 * "change": optional SourceChange |
| 3583 * "potentialEdits": optional List<String> | 3585 * "potentialEdits": optional List<String> |
| 3584 * } | 3586 * } |
| 3585 */ | 3587 */ |
| 3586 class EditGetRefactoringResult implements HasToJson { | 3588 class EditGetRefactoringResult implements HasToJson { |
| 3587 /** | 3589 /** |
| 3588 * The status of the refactoring. The array will be empty if there are no | 3590 * The initial status of the refactoring, i.e. problems related to the |
| 3589 * known problems. | 3591 * context in which the refactoring is requested. The array will be empty if |
| 3592 * there are no known problems. |
| 3590 */ | 3593 */ |
| 3591 List<RefactoringProblem> problems; | 3594 List<RefactoringProblem> initialProblems; |
| 3595 |
| 3596 /** |
| 3597 * The options validation status, i.e. problems in the given options, such as |
| 3598 * light-weight validation of a new name, flags compatibility, etc. The array |
| 3599 * will be empty if there are no known problems. |
| 3600 */ |
| 3601 List<RefactoringProblem> optionsProblems; |
| 3602 |
| 3603 /** |
| 3604 * The final status of the refactoring, i.e. problems identified in the |
| 3605 * result of a full, potentially expensive validation and / or change |
| 3606 * creation. The array will be empty if there are no known problems. |
| 3607 */ |
| 3608 List<RefactoringProblem> finalProblems; |
| 3592 | 3609 |
| 3593 /** | 3610 /** |
| 3594 * Data used to provide feedback to the user. The structure of the data is | 3611 * Data used to provide feedback to the user. The structure of the data is |
| 3595 * dependent on the kind of refactoring being created. The data that is | 3612 * dependent on the kind of refactoring being created. The data that is |
| 3596 * returned is documented in the section titled Refactorings, labeled as | 3613 * returned is documented in the section titled Refactorings, labeled as |
| 3597 * “Feedback”. | 3614 * “Feedback”. |
| 3598 */ | 3615 */ |
| 3599 RefactoringFeedback feedback; | 3616 RefactoringFeedback feedback; |
| 3600 | 3617 |
| 3601 /** | 3618 /** |
| 3602 * The changes that are to be applied to affect the refactoring. This field | 3619 * The changes that are to be applied to affect the refactoring. This field |
| 3603 * will be omitted if there are problems that prevent a set of changes from | 3620 * will be omitted if there are problems that prevent a set of changes from |
| 3604 * being computed, such as having no options specified for a refactoring that | 3621 * being computed, such as having no options specified for a refactoring that |
| 3605 * requires them, or if only validation was requested. | 3622 * requires them, or if only validation was requested. |
| 3606 */ | 3623 */ |
| 3607 SourceChange change; | 3624 SourceChange change; |
| 3608 | 3625 |
| 3609 /** | 3626 /** |
| 3610 * The ids of source edits that are not known to be valid. An edit is not | 3627 * The ids of source edits that are not known to be valid. An edit is not |
| 3611 * known to be valid if there was insufficient type information for the | 3628 * known to be valid if there was insufficient type information for the |
| 3612 * server to be able to determine whether or not the code needs to be | 3629 * server to be able to determine whether or not the code needs to be |
| 3613 * modified, such as when a member is being renamed and there is a reference | 3630 * modified, such as when a member is being renamed and there is a reference |
| 3614 * to a member from an unknown type. This field will be omitted if the change | 3631 * to a member from an unknown type. This field will be omitted if the change |
| 3615 * field is omitted or if there are no potential edits for the refactoring. | 3632 * field is omitted or if there are no potential edits for the refactoring. |
| 3616 */ | 3633 */ |
| 3617 List<String> potentialEdits; | 3634 List<String> potentialEdits; |
| 3618 | 3635 |
| 3619 EditGetRefactoringResult(this.problems, {this.feedback, this.change, this.pote
ntialEdits}) { | 3636 EditGetRefactoringResult(this.initialProblems, this.optionsProblems, this.fina
lProblems, {this.feedback, this.change, this.potentialEdits}) { |
| 3620 if (potentialEdits == null) { | 3637 if (potentialEdits == null) { |
| 3621 potentialEdits = <String>[]; | 3638 potentialEdits = <String>[]; |
| 3622 } | 3639 } |
| 3623 } | 3640 } |
| 3624 | 3641 |
| 3625 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | 3642 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { |
| 3626 if (json == null) { | 3643 if (json == null) { |
| 3627 json = {}; | 3644 json = {}; |
| 3628 } | 3645 } |
| 3629 if (json is Map) { | 3646 if (json is Map) { |
| 3630 List<RefactoringProblem> problems; | 3647 List<RefactoringProblem> initialProblems; |
| 3631 if (json.containsKey("problems")) { | 3648 if (json.containsKey("initialProblems")) { |
| 3632 problems = jsonDecoder._decodeList(jsonPath + ".problems", json["problem
s"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecod
er, jsonPath, json)); | 3649 initialProblems = jsonDecoder._decodeList(jsonPath + ".initialProblems",
json["initialProblems"], (String jsonPath, Object json) => new RefactoringProbl
em.fromJson(jsonDecoder, jsonPath, json)); |
| 3633 } else { | 3650 } else { |
| 3634 throw jsonDecoder.missingKey(jsonPath, "problems"); | 3651 throw jsonDecoder.missingKey(jsonPath, "initialProblems"); |
| 3652 } |
| 3653 List<RefactoringProblem> optionsProblems; |
| 3654 if (json.containsKey("optionsProblems")) { |
| 3655 optionsProblems = jsonDecoder._decodeList(jsonPath + ".optionsProblems",
json["optionsProblems"], (String jsonPath, Object json) => new RefactoringProbl
em.fromJson(jsonDecoder, jsonPath, json)); |
| 3656 } else { |
| 3657 throw jsonDecoder.missingKey(jsonPath, "optionsProblems"); |
| 3658 } |
| 3659 List<RefactoringProblem> finalProblems; |
| 3660 if (json.containsKey("finalProblems")) { |
| 3661 finalProblems = jsonDecoder._decodeList(jsonPath + ".finalProblems", jso
n["finalProblems"], (String jsonPath, Object json) => new RefactoringProblem.fro
mJson(jsonDecoder, jsonPath, json)); |
| 3662 } else { |
| 3663 throw jsonDecoder.missingKey(jsonPath, "finalProblems"); |
| 3635 } | 3664 } |
| 3636 RefactoringFeedback feedback; | 3665 RefactoringFeedback feedback; |
| 3637 if (json.containsKey("feedback")) { | 3666 if (json.containsKey("feedback")) { |
| 3638 feedback = new RefactoringFeedback.fromJson(jsonDecoder, jsonPath + ".fe
edback", json["feedback"], json); | 3667 feedback = new RefactoringFeedback.fromJson(jsonDecoder, jsonPath + ".fe
edback", json["feedback"], json); |
| 3639 } | 3668 } |
| 3640 SourceChange change; | 3669 SourceChange change; |
| 3641 if (json.containsKey("change")) { | 3670 if (json.containsKey("change")) { |
| 3642 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); | 3671 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); |
| 3643 } | 3672 } |
| 3644 List<String> potentialEdits; | 3673 List<String> potentialEdits; |
| 3645 if (json.containsKey("potentialEdits")) { | 3674 if (json.containsKey("potentialEdits")) { |
| 3646 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); | 3675 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); |
| 3647 } else { | 3676 } else { |
| 3648 potentialEdits = <String>[]; | 3677 potentialEdits = <String>[]; |
| 3649 } | 3678 } |
| 3650 return new EditGetRefactoringResult(problems, feedback: feedback, change:
change, potentialEdits: potentialEdits); | 3679 return new EditGetRefactoringResult(initialProblems, optionsProblems, fina
lProblems, feedback: feedback, change: change, potentialEdits: potentialEdits); |
| 3651 } else { | 3680 } else { |
| 3652 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result"); | 3681 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result"); |
| 3653 } | 3682 } |
| 3654 } | 3683 } |
| 3655 | 3684 |
| 3656 factory EditGetRefactoringResult.fromResponse(Response response) { | 3685 factory EditGetRefactoringResult.fromResponse(Response response) { |
| 3657 return new EditGetRefactoringResult.fromJson( | 3686 return new EditGetRefactoringResult.fromJson( |
| 3658 new ResponseDecoder(response), "result", response._result); | 3687 new ResponseDecoder(response), "result", response._result); |
| 3659 } | 3688 } |
| 3660 | 3689 |
| 3661 Map<String, dynamic> toJson() { | 3690 Map<String, dynamic> toJson() { |
| 3662 Map<String, dynamic> result = {}; | 3691 Map<String, dynamic> result = {}; |
| 3663 result["problems"] = problems.map((RefactoringProblem value) => value.toJson
()).toList(); | 3692 result["initialProblems"] = initialProblems.map((RefactoringProblem value) =
> value.toJson()).toList(); |
| 3693 result["optionsProblems"] = optionsProblems.map((RefactoringProblem value) =
> value.toJson()).toList(); |
| 3694 result["finalProblems"] = finalProblems.map((RefactoringProblem value) => va
lue.toJson()).toList(); |
| 3664 if (feedback != null) { | 3695 if (feedback != null) { |
| 3665 result["feedback"] = feedback.toJson(); | 3696 result["feedback"] = feedback.toJson(); |
| 3666 } | 3697 } |
| 3667 if (change != null) { | 3698 if (change != null) { |
| 3668 result["change"] = change.toJson(); | 3699 result["change"] = change.toJson(); |
| 3669 } | 3700 } |
| 3670 if (potentialEdits.isNotEmpty) { | 3701 if (potentialEdits.isNotEmpty) { |
| 3671 result["potentialEdits"] = potentialEdits; | 3702 result["potentialEdits"] = potentialEdits; |
| 3672 } | 3703 } |
| 3673 return result; | 3704 return result; |
| 3674 } | 3705 } |
| 3675 | 3706 |
| 3676 Response toResponse(String id) { | 3707 Response toResponse(String id) { |
| 3677 return new Response(id, result: toJson()); | 3708 return new Response(id, result: toJson()); |
| 3678 } | 3709 } |
| 3679 | 3710 |
| 3680 @override | 3711 @override |
| 3681 String toString() => JSON.encode(toJson()); | 3712 String toString() => JSON.encode(toJson()); |
| 3682 | 3713 |
| 3683 @override | 3714 @override |
| 3684 bool operator==(other) { | 3715 bool operator==(other) { |
| 3685 if (other is EditGetRefactoringResult) { | 3716 if (other is EditGetRefactoringResult) { |
| 3686 return _listEqual(problems, other.problems, (RefactoringProblem a, Refacto
ringProblem b) => a == b) && | 3717 return _listEqual(initialProblems, other.initialProblems, (RefactoringProb
lem a, RefactoringProblem b) => a == b) && |
| 3718 _listEqual(optionsProblems, other.optionsProblems, (RefactoringProblem
a, RefactoringProblem b) => a == b) && |
| 3719 _listEqual(finalProblems, other.finalProblems, (RefactoringProblem a,
RefactoringProblem b) => a == b) && |
| 3687 feedback == other.feedback && | 3720 feedback == other.feedback && |
| 3688 change == other.change && | 3721 change == other.change && |
| 3689 _listEqual(potentialEdits, other.potentialEdits, (String a, String b)
=> a == b); | 3722 _listEqual(potentialEdits, other.potentialEdits, (String a, String b)
=> a == b); |
| 3690 } | 3723 } |
| 3691 return false; | 3724 return false; |
| 3692 } | 3725 } |
| 3693 | 3726 |
| 3694 @override | 3727 @override |
| 3695 int get hashCode { | 3728 int get hashCode { |
| 3696 int hash = 0; | 3729 int hash = 0; |
| 3697 hash = _JenkinsSmiHash.combine(hash, problems.hashCode); | 3730 hash = _JenkinsSmiHash.combine(hash, initialProblems.hashCode); |
| 3731 hash = _JenkinsSmiHash.combine(hash, optionsProblems.hashCode); |
| 3732 hash = _JenkinsSmiHash.combine(hash, finalProblems.hashCode); |
| 3698 hash = _JenkinsSmiHash.combine(hash, feedback.hashCode); | 3733 hash = _JenkinsSmiHash.combine(hash, feedback.hashCode); |
| 3699 hash = _JenkinsSmiHash.combine(hash, change.hashCode); | 3734 hash = _JenkinsSmiHash.combine(hash, change.hashCode); |
| 3700 hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode); | 3735 hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode); |
| 3701 return _JenkinsSmiHash.finish(hash); | 3736 return _JenkinsSmiHash.finish(hash); |
| 3702 } | 3737 } |
| 3703 } | 3738 } |
| 3704 | 3739 |
| 3705 /** | 3740 /** |
| 3706 * execution.createContext params | 3741 * execution.createContext params |
| 3707 * | 3742 * |
| (...skipping 6322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10030 return false; | 10065 return false; |
| 10031 } | 10066 } |
| 10032 | 10067 |
| 10033 @override | 10068 @override |
| 10034 int get hashCode { | 10069 int get hashCode { |
| 10035 int hash = 0; | 10070 int hash = 0; |
| 10036 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 10071 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 10037 return _JenkinsSmiHash.finish(hash); | 10072 return _JenkinsSmiHash.finish(hash); |
| 10038 } | 10073 } |
| 10039 } | 10074 } |
| OLD | NEW |