| 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 3421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3432 | 3432 |
| 3433 /** | 3433 /** |
| 3434 * edit.getRefactoring params | 3434 * edit.getRefactoring params |
| 3435 * | 3435 * |
| 3436 * { | 3436 * { |
| 3437 * "kind": RefactoringKind | 3437 * "kind": RefactoringKind |
| 3438 * "file": FilePath | 3438 * "file": FilePath |
| 3439 * "offset": int | 3439 * "offset": int |
| 3440 * "length": int | 3440 * "length": int |
| 3441 * "validateOnly": bool | 3441 * "validateOnly": bool |
| 3442 * "options": optional object | 3442 * "options": optional RefactoringOptions |
| 3443 * } | 3443 * } |
| 3444 */ | 3444 */ |
| 3445 class EditGetRefactoringParams implements HasToJson { | 3445 class EditGetRefactoringParams implements HasToJson { |
| 3446 /** | 3446 /** |
| 3447 * The kind of refactoring to be performed. | 3447 * The kind of refactoring to be performed. |
| 3448 */ | 3448 */ |
| 3449 RefactoringKind kind; | 3449 RefactoringKind kind; |
| 3450 | 3450 |
| 3451 /** | 3451 /** |
| 3452 * The file containing the code involved in the refactoring. | 3452 * The file containing the code involved in the refactoring. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3469 */ | 3469 */ |
| 3470 bool validateOnly; | 3470 bool validateOnly; |
| 3471 | 3471 |
| 3472 /** | 3472 /** |
| 3473 * Data used to provide values provided by the user. The structure of the | 3473 * Data used to provide values provided by the user. The structure of the |
| 3474 * data is dependent on the kind of refactoring being performed. The data | 3474 * data is dependent on the kind of refactoring being performed. The data |
| 3475 * that is expected is documented in the section titled Refactorings, labeled | 3475 * that is expected is documented in the section titled Refactorings, labeled |
| 3476 * as “Options”. This field can be omitted if the refactoring does not | 3476 * as “Options”. This field can be omitted if the refactoring does not |
| 3477 * require any options or if the values of those options are not known. | 3477 * require any options or if the values of those options are not known. |
| 3478 */ | 3478 */ |
| 3479 Map options; | 3479 RefactoringOptions options; |
| 3480 | 3480 |
| 3481 EditGetRefactoringParams(this.kind, this.file, this.offset, this.length, this.
validateOnly, {this.options}); | 3481 EditGetRefactoringParams(this.kind, this.file, this.offset, this.length, this.
validateOnly, {this.options}); |
| 3482 | 3482 |
| 3483 factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | 3483 factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { |
| 3484 if (json == null) { | 3484 if (json == null) { |
| 3485 json = {}; | 3485 json = {}; |
| 3486 } | 3486 } |
| 3487 if (json is Map) { | 3487 if (json is Map) { |
| 3488 RefactoringKind kind; | 3488 RefactoringKind kind; |
| 3489 if (json.containsKey("kind")) { | 3489 if (json.containsKey("kind")) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3508 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 3508 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 3509 } else { | 3509 } else { |
| 3510 throw jsonDecoder.missingKey(jsonPath, "length"); | 3510 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 3511 } | 3511 } |
| 3512 bool validateOnly; | 3512 bool validateOnly; |
| 3513 if (json.containsKey("validateOnly")) { | 3513 if (json.containsKey("validateOnly")) { |
| 3514 validateOnly = jsonDecoder._decodeBool(jsonPath + ".validateOnly", json[
"validateOnly"]); | 3514 validateOnly = jsonDecoder._decodeBool(jsonPath + ".validateOnly", json[
"validateOnly"]); |
| 3515 } else { | 3515 } else { |
| 3516 throw jsonDecoder.missingKey(jsonPath, "validateOnly"); | 3516 throw jsonDecoder.missingKey(jsonPath, "validateOnly"); |
| 3517 } | 3517 } |
| 3518 Map options; | 3518 RefactoringOptions options; |
| 3519 if (json.containsKey("options")) { | 3519 if (json.containsKey("options")) { |
| 3520 options = json["options"]; | 3520 options = new RefactoringOptions.fromJson(jsonDecoder, jsonPath + ".opti
ons", json["options"], kind); |
| 3521 } | 3521 } |
| 3522 return new EditGetRefactoringParams(kind, file, offset, length, validateOn
ly, options: options); | 3522 return new EditGetRefactoringParams(kind, file, offset, length, validateOn
ly, options: options); |
| 3523 } else { | 3523 } else { |
| 3524 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params"); | 3524 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params"); |
| 3525 } | 3525 } |
| 3526 } | 3526 } |
| 3527 | 3527 |
| 3528 factory EditGetRefactoringParams.fromRequest(Request request) { | 3528 factory EditGetRefactoringParams.fromRequest(Request request) { |
| 3529 return new EditGetRefactoringParams.fromJson( | 3529 return new EditGetRefactoringParams.fromJson( |
| 3530 new RequestDecoder(request), "params", request._params); | 3530 new RequestDecoder(request), "params", request._params); |
| 3531 } | 3531 } |
| 3532 | 3532 |
| 3533 Map<String, dynamic> toJson() { | 3533 Map<String, dynamic> toJson() { |
| 3534 Map<String, dynamic> result = {}; | 3534 Map<String, dynamic> result = {}; |
| 3535 result["kind"] = kind.toJson(); | 3535 result["kind"] = kind.toJson(); |
| 3536 result["file"] = file; | 3536 result["file"] = file; |
| 3537 result["offset"] = offset; | 3537 result["offset"] = offset; |
| 3538 result["length"] = length; | 3538 result["length"] = length; |
| 3539 result["validateOnly"] = validateOnly; | 3539 result["validateOnly"] = validateOnly; |
| 3540 if (options != null) { | 3540 if (options != null) { |
| 3541 result["options"] = options; | 3541 result["options"] = options.toJson(); |
| 3542 } | 3542 } |
| 3543 return result; | 3543 return result; |
| 3544 } | 3544 } |
| 3545 | 3545 |
| 3546 Request toRequest(String id) { | 3546 Request toRequest(String id) { |
| 3547 return new Request(id, "edit.getRefactoring", toJson()); | 3547 return new Request(id, "edit.getRefactoring", toJson()); |
| 3548 } | 3548 } |
| 3549 | 3549 |
| 3550 @override | 3550 @override |
| 3551 String toString() => JSON.encode(toJson()); | 3551 String toString() => JSON.encode(toJson()); |
| (...skipping 4192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7744 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | 7744 hash = _JenkinsSmiHash.combine(hash, id.hashCode); |
| 7745 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | 7745 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); |
| 7746 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | 7746 hash = _JenkinsSmiHash.combine(hash, type.hashCode); |
| 7747 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | 7747 hash = _JenkinsSmiHash.combine(hash, name.hashCode); |
| 7748 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | 7748 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); |
| 7749 return _JenkinsSmiHash.finish(hash); | 7749 return _JenkinsSmiHash.finish(hash); |
| 7750 } | 7750 } |
| 7751 } | 7751 } |
| 7752 | 7752 |
| 7753 /** | 7753 /** |
| 7754 * RefactoringOptions |
| 7755 * |
| 7756 * { |
| 7757 * } |
| 7758 */ |
| 7759 class RefactoringOptions implements HasToJson { |
| 7760 RefactoringOptions(); |
| 7761 |
| 7762 factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json, RefactoringKind kind) { |
| 7763 return _refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); |
| 7764 } |
| 7765 |
| 7766 Map<String, dynamic> toJson() { |
| 7767 Map<String, dynamic> result = {}; |
| 7768 return result; |
| 7769 } |
| 7770 |
| 7771 @override |
| 7772 String toString() => JSON.encode(toJson()); |
| 7773 |
| 7774 @override |
| 7775 bool operator==(other) { |
| 7776 if (other is RefactoringOptions) { |
| 7777 return true; |
| 7778 } |
| 7779 return false; |
| 7780 } |
| 7781 |
| 7782 @override |
| 7783 int get hashCode { |
| 7784 int hash = 0; |
| 7785 return _JenkinsSmiHash.finish(hash); |
| 7786 } |
| 7787 } |
| 7788 |
| 7789 /** |
| 7754 * RefactoringMethodParameterKind | 7790 * RefactoringMethodParameterKind |
| 7755 * | 7791 * |
| 7756 * enum { | 7792 * enum { |
| 7757 * REQUIRED | 7793 * REQUIRED |
| 7758 * POSITIONAL | 7794 * POSITIONAL |
| 7759 * NAMED | 7795 * NAMED |
| 7760 * } | 7796 * } |
| 7761 */ | 7797 */ |
| 7762 class RefactoringMethodParameterKind { | 7798 class RefactoringMethodParameterKind { |
| 7763 static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED"); | 7799 static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED"); |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9117 } | 9153 } |
| 9118 | 9154 |
| 9119 /** | 9155 /** |
| 9120 * extractLocalVariable options | 9156 * extractLocalVariable options |
| 9121 * | 9157 * |
| 9122 * { | 9158 * { |
| 9123 * "name": String | 9159 * "name": String |
| 9124 * "extractAll": bool | 9160 * "extractAll": bool |
| 9125 * } | 9161 * } |
| 9126 */ | 9162 */ |
| 9127 class ExtractLocalVariableOptions implements HasToJson { | 9163 class ExtractLocalVariableOptions extends RefactoringOptions implements HasToJso
n { |
| 9128 /** | 9164 /** |
| 9129 * The name that the local variable should be given. | 9165 * The name that the local variable should be given. |
| 9130 */ | 9166 */ |
| 9131 String name; | 9167 String name; |
| 9132 | 9168 |
| 9133 /** | 9169 /** |
| 9134 * True if all occurrences of the expression within the scope in which the | 9170 * True if all occurrences of the expression within the scope in which the |
| 9135 * variable will be defined should be replaced by a reference to the local | 9171 * variable will be defined should be replaced by a reference to the local |
| 9136 * variable. The expression used to initiate the refactoring will always be | 9172 * variable. The expression used to initiate the refactoring will always be |
| 9137 * replaced. | 9173 * replaced. |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9373 * extractMethod options | 9409 * extractMethod options |
| 9374 * | 9410 * |
| 9375 * { | 9411 * { |
| 9376 * "returnType": String | 9412 * "returnType": String |
| 9377 * "createGetter": bool | 9413 * "createGetter": bool |
| 9378 * "name": String | 9414 * "name": String |
| 9379 * "parameters": List<RefactoringMethodParameter> | 9415 * "parameters": List<RefactoringMethodParameter> |
| 9380 * "extractAll": bool | 9416 * "extractAll": bool |
| 9381 * } | 9417 * } |
| 9382 */ | 9418 */ |
| 9383 class ExtractMethodOptions implements HasToJson { | 9419 class ExtractMethodOptions extends RefactoringOptions implements HasToJson { |
| 9384 /** | 9420 /** |
| 9385 * The return type that should be defined for the method. | 9421 * The return type that should be defined for the method. |
| 9386 */ | 9422 */ |
| 9387 String returnType; | 9423 String returnType; |
| 9388 | 9424 |
| 9389 /** | 9425 /** |
| 9390 * True if a getter should be created rather than a method. It is an error if | 9426 * True if a getter should be created rather than a method. It is an error if |
| 9391 * this field is true and the list of parameters is non-empty. | 9427 * this field is true and the list of parameters is non-empty. |
| 9392 */ | 9428 */ |
| 9393 bool createGetter; | 9429 bool createGetter; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9555 } | 9591 } |
| 9556 | 9592 |
| 9557 /** | 9593 /** |
| 9558 * inlineMethod options | 9594 * inlineMethod options |
| 9559 * | 9595 * |
| 9560 * { | 9596 * { |
| 9561 * "deleteSource": bool | 9597 * "deleteSource": bool |
| 9562 * "inlineAll": bool | 9598 * "inlineAll": bool |
| 9563 * } | 9599 * } |
| 9564 */ | 9600 */ |
| 9565 class InlineMethodOptions implements HasToJson { | 9601 class InlineMethodOptions extends RefactoringOptions implements HasToJson { |
| 9566 /** | 9602 /** |
| 9567 * True if the method being inlined should be removed. It is an error if this | 9603 * True if the method being inlined should be removed. It is an error if this |
| 9568 * field is true and inlineAll is false. | 9604 * field is true and inlineAll is false. |
| 9569 */ | 9605 */ |
| 9570 bool deleteSource; | 9606 bool deleteSource; |
| 9571 | 9607 |
| 9572 /** | 9608 /** |
| 9573 * True if all invocations of the method should be inlined, or false if only | 9609 * True if all invocations of the method should be inlined, or false if only |
| 9574 * the invocation site used to create this refactoring should be inlined. | 9610 * the invocation site used to create this refactoring should be inlined. |
| 9575 */ | 9611 */ |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9710 } | 9746 } |
| 9711 } | 9747 } |
| 9712 | 9748 |
| 9713 /** | 9749 /** |
| 9714 * rename options | 9750 * rename options |
| 9715 * | 9751 * |
| 9716 * { | 9752 * { |
| 9717 * "newName": String | 9753 * "newName": String |
| 9718 * } | 9754 * } |
| 9719 */ | 9755 */ |
| 9720 class RenameOptions implements HasToJson { | 9756 class RenameOptions extends RefactoringOptions implements HasToJson { |
| 9721 /** | 9757 /** |
| 9722 * The name that the element should have after the refactoring. | 9758 * The name that the element should have after the refactoring. |
| 9723 */ | 9759 */ |
| 9724 String newName; | 9760 String newName; |
| 9725 | 9761 |
| 9726 RenameOptions(this.newName); | 9762 RenameOptions(this.newName); |
| 9727 | 9763 |
| 9728 factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { | 9764 factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { |
| 9729 if (json == null) { | 9765 if (json == null) { |
| 9730 json = {}; | 9766 json = {}; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9764 return false; | 9800 return false; |
| 9765 } | 9801 } |
| 9766 | 9802 |
| 9767 @override | 9803 @override |
| 9768 int get hashCode { | 9804 int get hashCode { |
| 9769 int hash = 0; | 9805 int hash = 0; |
| 9770 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 9806 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 9771 return _JenkinsSmiHash.finish(hash); | 9807 return _JenkinsSmiHash.finish(hash); |
| 9772 } | 9808 } |
| 9773 } | 9809 } |
| OLD | NEW |