| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 int hash = 0; | 71 int hash = 0; |
| 72 hash = _JenkinsSmiHash.combine(hash, version.hashCode); | 72 hash = _JenkinsSmiHash.combine(hash, version.hashCode); |
| 73 return _JenkinsSmiHash.finish(hash); | 73 return _JenkinsSmiHash.finish(hash); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * server.setSubscriptions params | 78 * server.setSubscriptions params |
| 79 * | 79 * |
| 80 * { | 80 * { |
| 81 * "subscriptions": List<ServerService> | 81 * "subscriptions": optional List<ServerService> |
| 82 * } | 82 * } |
| 83 */ | 83 */ |
| 84 class ServerSetSubscriptionsParams implements HasToJson { | 84 class ServerSetSubscriptionsParams implements HasToJson { |
| 85 /** | 85 /** |
| 86 * A list of the services being subscribed to. | 86 * A list of the services being subscribed to. |
| 87 */ | 87 */ |
| 88 List<ServerService> subscriptions; | 88 List<ServerService> subscriptions; |
| 89 | 89 |
| 90 ServerSetSubscriptionsParams(this.subscriptions); | 90 ServerSetSubscriptionsParams({this.subscriptions}) { |
| 91 if (subscriptions == null) { |
| 92 subscriptions = <ServerService>[]; |
| 93 } |
| 94 } |
| 91 | 95 |
| 92 factory ServerSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | 96 factory ServerSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { |
| 93 if (json == null) { | 97 if (json == null) { |
| 94 json = {}; | 98 json = {}; |
| 95 } | 99 } |
| 96 if (json is Map) { | 100 if (json is Map) { |
| 97 List<ServerService> subscriptions; | 101 List<ServerService> subscriptions; |
| 98 if (json.containsKey("subscriptions")) { | 102 if (json.containsKey("subscriptions")) { |
| 99 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new ServerService.fromJson
(jsonDecoder, jsonPath, json)); | 103 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new ServerService.fromJson
(jsonDecoder, jsonPath, json)); |
| 100 } else { | 104 } else { |
| 101 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | 105 subscriptions = <ServerService>[]; |
| 102 } | 106 } |
| 103 return new ServerSetSubscriptionsParams(subscriptions); | 107 return new ServerSetSubscriptionsParams(subscriptions: subscriptions); |
| 104 } else { | 108 } else { |
| 105 throw jsonDecoder.mismatch(jsonPath, "server.setSubscriptions params"); | 109 throw jsonDecoder.mismatch(jsonPath, "server.setSubscriptions params"); |
| 106 } | 110 } |
| 107 } | 111 } |
| 108 | 112 |
| 109 factory ServerSetSubscriptionsParams.fromRequest(Request request) { | 113 factory ServerSetSubscriptionsParams.fromRequest(Request request) { |
| 110 return new ServerSetSubscriptionsParams.fromJson( | 114 return new ServerSetSubscriptionsParams.fromJson( |
| 111 new RequestDecoder(request), "params", request.params); | 115 new RequestDecoder(request), "params", request.params); |
| 112 } | 116 } |
| 113 | 117 |
| 114 Map<String, dynamic> toJson() { | 118 Map<String, dynamic> toJson() { |
| 115 Map<String, dynamic> result = {}; | 119 Map<String, dynamic> result = {}; |
| 116 result["subscriptions"] = subscriptions.map((ServerService value) => value.t
oJson()).toList(); | 120 if (subscriptions.isNotEmpty) { |
| 121 result["subscriptions"] = subscriptions.map((ServerService value) => value
.toJson()).toList(); |
| 122 } |
| 117 return result; | 123 return result; |
| 118 } | 124 } |
| 119 | 125 |
| 120 Request toRequest(String id) { | 126 Request toRequest(String id) { |
| 121 return new Request(id, "server.setSubscriptions", toJson()); | 127 return new Request(id, "server.setSubscriptions", toJson()); |
| 122 } | 128 } |
| 123 | 129 |
| 124 @override | 130 @override |
| 125 String toString() => JSON.encode(toJson()); | 131 String toString() => JSON.encode(toJson()); |
| 126 | 132 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 int hash = 0; | 366 int hash = 0; |
| 361 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 367 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 362 return _JenkinsSmiHash.finish(hash); | 368 return _JenkinsSmiHash.finish(hash); |
| 363 } | 369 } |
| 364 } | 370 } |
| 365 | 371 |
| 366 /** | 372 /** |
| 367 * analysis.getErrors result | 373 * analysis.getErrors result |
| 368 * | 374 * |
| 369 * { | 375 * { |
| 370 * "errors": List<AnalysisError> | 376 * "errors": optional List<AnalysisError> |
| 371 * } | 377 * } |
| 372 */ | 378 */ |
| 373 class AnalysisGetErrorsResult implements HasToJson { | 379 class AnalysisGetErrorsResult implements HasToJson { |
| 374 /** | 380 /** |
| 375 * The errors associated with the file. | 381 * The errors associated with the file. |
| 376 */ | 382 */ |
| 377 List<AnalysisError> errors; | 383 List<AnalysisError> errors; |
| 378 | 384 |
| 379 AnalysisGetErrorsResult(this.errors); | 385 AnalysisGetErrorsResult({this.errors}) { |
| 386 if (errors == null) { |
| 387 errors = <AnalysisError>[]; |
| 388 } |
| 389 } |
| 380 | 390 |
| 381 factory AnalysisGetErrorsResult.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | 391 factory AnalysisGetErrorsResult.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { |
| 382 if (json == null) { | 392 if (json == null) { |
| 383 json = {}; | 393 json = {}; |
| 384 } | 394 } |
| 385 if (json is Map) { | 395 if (json is Map) { |
| 386 List<AnalysisError> errors; | 396 List<AnalysisError> errors; |
| 387 if (json.containsKey("errors")) { | 397 if (json.containsKey("errors")) { |
| 388 errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (
String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPat
h, json)); | 398 errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (
String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPat
h, json)); |
| 389 } else { | 399 } else { |
| 390 throw jsonDecoder.missingKey(jsonPath, "errors"); | 400 errors = <AnalysisError>[]; |
| 391 } | 401 } |
| 392 return new AnalysisGetErrorsResult(errors); | 402 return new AnalysisGetErrorsResult(errors: errors); |
| 393 } else { | 403 } else { |
| 394 throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors result"); | 404 throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors result"); |
| 395 } | 405 } |
| 396 } | 406 } |
| 397 | 407 |
| 398 factory AnalysisGetErrorsResult.fromResponse(Response response) { | 408 factory AnalysisGetErrorsResult.fromResponse(Response response) { |
| 399 return new AnalysisGetErrorsResult.fromJson( | 409 return new AnalysisGetErrorsResult.fromJson( |
| 400 new ResponseDecoder(), "result", response.result); | 410 new ResponseDecoder(), "result", response.result); |
| 401 } | 411 } |
| 402 | 412 |
| 403 Map<String, dynamic> toJson() { | 413 Map<String, dynamic> toJson() { |
| 404 Map<String, dynamic> result = {}; | 414 Map<String, dynamic> result = {}; |
| 405 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toLis
t(); | 415 if (errors.isNotEmpty) { |
| 416 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toL
ist(); |
| 417 } |
| 406 return result; | 418 return result; |
| 407 } | 419 } |
| 408 | 420 |
| 409 Response toResponse(String id) { | 421 Response toResponse(String id) { |
| 410 return new Response(id, result: toJson()); | 422 return new Response(id, result: toJson()); |
| 411 } | 423 } |
| 412 | 424 |
| 413 @override | 425 @override |
| 414 String toString() => JSON.encode(toJson()); | 426 String toString() => JSON.encode(toJson()); |
| 415 | 427 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 519 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 508 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | 520 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); |
| 509 return _JenkinsSmiHash.finish(hash); | 521 return _JenkinsSmiHash.finish(hash); |
| 510 } | 522 } |
| 511 } | 523 } |
| 512 | 524 |
| 513 /** | 525 /** |
| 514 * analysis.getHover result | 526 * analysis.getHover result |
| 515 * | 527 * |
| 516 * { | 528 * { |
| 517 * "hovers": List<HoverInformation> | 529 * "hovers": optional List<HoverInformation> |
| 518 * } | 530 * } |
| 519 */ | 531 */ |
| 520 class AnalysisGetHoverResult implements HasToJson { | 532 class AnalysisGetHoverResult implements HasToJson { |
| 521 /** | 533 /** |
| 522 * The hover information associated with the location. The list will be empty | 534 * The hover information associated with the location. The list will be |
| 523 * if no information could be determined for the location. The list can | 535 * omitted if no information could be determined for the location. The list |
| 524 * contain multiple items if the file is being analyzed in multiple contexts | 536 * can contain multiple items if the file is being analyzed in multiple |
| 525 * in conflicting ways (such as a part that is included in multiple | 537 * contexts in conflicting ways (such as a part that is included in multiple |
| 526 * libraries). | 538 * libraries). |
| 527 */ | 539 */ |
| 528 List<HoverInformation> hovers; | 540 List<HoverInformation> hovers; |
| 529 | 541 |
| 530 AnalysisGetHoverResult(this.hovers); | 542 AnalysisGetHoverResult({this.hovers}) { |
| 543 if (hovers == null) { |
| 544 hovers = <HoverInformation>[]; |
| 545 } |
| 546 } |
| 531 | 547 |
| 532 factory AnalysisGetHoverResult.fromJson(JsonDecoder jsonDecoder, String jsonPa
th, Object json) { | 548 factory AnalysisGetHoverResult.fromJson(JsonDecoder jsonDecoder, String jsonPa
th, Object json) { |
| 533 if (json == null) { | 549 if (json == null) { |
| 534 json = {}; | 550 json = {}; |
| 535 } | 551 } |
| 536 if (json is Map) { | 552 if (json is Map) { |
| 537 List<HoverInformation> hovers; | 553 List<HoverInformation> hovers; |
| 538 if (json.containsKey("hovers")) { | 554 if (json.containsKey("hovers")) { |
| 539 hovers = jsonDecoder._decodeList(jsonPath + ".hovers", json["hovers"], (
String jsonPath, Object json) => new HoverInformation.fromJson(jsonDecoder, json
Path, json)); | 555 hovers = jsonDecoder._decodeList(jsonPath + ".hovers", json["hovers"], (
String jsonPath, Object json) => new HoverInformation.fromJson(jsonDecoder, json
Path, json)); |
| 540 } else { | 556 } else { |
| 541 throw jsonDecoder.missingKey(jsonPath, "hovers"); | 557 hovers = <HoverInformation>[]; |
| 542 } | 558 } |
| 543 return new AnalysisGetHoverResult(hovers); | 559 return new AnalysisGetHoverResult(hovers: hovers); |
| 544 } else { | 560 } else { |
| 545 throw jsonDecoder.mismatch(jsonPath, "analysis.getHover result"); | 561 throw jsonDecoder.mismatch(jsonPath, "analysis.getHover result"); |
| 546 } | 562 } |
| 547 } | 563 } |
| 548 | 564 |
| 549 factory AnalysisGetHoverResult.fromResponse(Response response) { | 565 factory AnalysisGetHoverResult.fromResponse(Response response) { |
| 550 return new AnalysisGetHoverResult.fromJson( | 566 return new AnalysisGetHoverResult.fromJson( |
| 551 new ResponseDecoder(), "result", response.result); | 567 new ResponseDecoder(), "result", response.result); |
| 552 } | 568 } |
| 553 | 569 |
| 554 Map<String, dynamic> toJson() { | 570 Map<String, dynamic> toJson() { |
| 555 Map<String, dynamic> result = {}; | 571 Map<String, dynamic> result = {}; |
| 556 result["hovers"] = hovers.map((HoverInformation value) => value.toJson()).to
List(); | 572 if (hovers.isNotEmpty) { |
| 573 result["hovers"] = hovers.map((HoverInformation value) => value.toJson()).
toList(); |
| 574 } |
| 557 return result; | 575 return result; |
| 558 } | 576 } |
| 559 | 577 |
| 560 Response toResponse(String id) { | 578 Response toResponse(String id) { |
| 561 return new Response(id, result: toJson()); | 579 return new Response(id, result: toJson()); |
| 562 } | 580 } |
| 563 | 581 |
| 564 @override | 582 @override |
| 565 String toString() => JSON.encode(toJson()); | 583 String toString() => JSON.encode(toJson()); |
| 566 | 584 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 577 int hash = 0; | 595 int hash = 0; |
| 578 hash = _JenkinsSmiHash.combine(hash, hovers.hashCode); | 596 hash = _JenkinsSmiHash.combine(hash, hovers.hashCode); |
| 579 return _JenkinsSmiHash.finish(hash); | 597 return _JenkinsSmiHash.finish(hash); |
| 580 } | 598 } |
| 581 } | 599 } |
| 582 | 600 |
| 583 /** | 601 /** |
| 584 * analysis.setAnalysisRoots params | 602 * analysis.setAnalysisRoots params |
| 585 * | 603 * |
| 586 * { | 604 * { |
| 587 * "included": List<FilePath> | 605 * "included": optional List<FilePath> |
| 588 * "excluded": List<FilePath> | 606 * "excluded": optional List<FilePath> |
| 589 * } | 607 * } |
| 590 */ | 608 */ |
| 591 class AnalysisSetAnalysisRootsParams implements HasToJson { | 609 class AnalysisSetAnalysisRootsParams implements HasToJson { |
| 592 /** | 610 /** |
| 593 * A list of the files and directories that should be analyzed. | 611 * A list of the files and directories that should be analyzed. |
| 594 */ | 612 */ |
| 595 List<String> included; | 613 List<String> included; |
| 596 | 614 |
| 597 /** | 615 /** |
| 598 * A list of the files and directories within the included directories that | 616 * A list of the files and directories within the included directories that |
| 599 * should not be analyzed. | 617 * should not be analyzed. |
| 600 */ | 618 */ |
| 601 List<String> excluded; | 619 List<String> excluded; |
| 602 | 620 |
| 603 AnalysisSetAnalysisRootsParams(this.included, this.excluded); | 621 AnalysisSetAnalysisRootsParams({this.included, this.excluded}) { |
| 622 if (included == null) { |
| 623 included = <String>[]; |
| 624 } |
| 625 if (excluded == null) { |
| 626 excluded = <String>[]; |
| 627 } |
| 628 } |
| 604 | 629 |
| 605 factory AnalysisSetAnalysisRootsParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | 630 factory AnalysisSetAnalysisRootsParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { |
| 606 if (json == null) { | 631 if (json == null) { |
| 607 json = {}; | 632 json = {}; |
| 608 } | 633 } |
| 609 if (json is Map) { | 634 if (json is Map) { |
| 610 List<String> included; | 635 List<String> included; |
| 611 if (json.containsKey("included")) { | 636 if (json.containsKey("included")) { |
| 612 included = jsonDecoder._decodeList(jsonPath + ".included", json["include
d"], jsonDecoder._decodeString); | 637 included = jsonDecoder._decodeList(jsonPath + ".included", json["include
d"], jsonDecoder._decodeString); |
| 613 } else { | 638 } else { |
| 614 throw jsonDecoder.missingKey(jsonPath, "included"); | 639 included = <String>[]; |
| 615 } | 640 } |
| 616 List<String> excluded; | 641 List<String> excluded; |
| 617 if (json.containsKey("excluded")) { | 642 if (json.containsKey("excluded")) { |
| 618 excluded = jsonDecoder._decodeList(jsonPath + ".excluded", json["exclude
d"], jsonDecoder._decodeString); | 643 excluded = jsonDecoder._decodeList(jsonPath + ".excluded", json["exclude
d"], jsonDecoder._decodeString); |
| 619 } else { | 644 } else { |
| 620 throw jsonDecoder.missingKey(jsonPath, "excluded"); | 645 excluded = <String>[]; |
| 621 } | 646 } |
| 622 return new AnalysisSetAnalysisRootsParams(included, excluded); | 647 return new AnalysisSetAnalysisRootsParams(included: included, excluded: ex
cluded); |
| 623 } else { | 648 } else { |
| 624 throw jsonDecoder.mismatch(jsonPath, "analysis.setAnalysisRoots params"); | 649 throw jsonDecoder.mismatch(jsonPath, "analysis.setAnalysisRoots params"); |
| 625 } | 650 } |
| 626 } | 651 } |
| 627 | 652 |
| 628 factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) { | 653 factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) { |
| 629 return new AnalysisSetAnalysisRootsParams.fromJson( | 654 return new AnalysisSetAnalysisRootsParams.fromJson( |
| 630 new RequestDecoder(request), "params", request.params); | 655 new RequestDecoder(request), "params", request.params); |
| 631 } | 656 } |
| 632 | 657 |
| 633 Map<String, dynamic> toJson() { | 658 Map<String, dynamic> toJson() { |
| 634 Map<String, dynamic> result = {}; | 659 Map<String, dynamic> result = {}; |
| 635 result["included"] = included; | 660 if (included.isNotEmpty) { |
| 636 result["excluded"] = excluded; | 661 result["included"] = included; |
| 662 } |
| 663 if (excluded.isNotEmpty) { |
| 664 result["excluded"] = excluded; |
| 665 } |
| 637 return result; | 666 return result; |
| 638 } | 667 } |
| 639 | 668 |
| 640 Request toRequest(String id) { | 669 Request toRequest(String id) { |
| 641 return new Request(id, "analysis.setAnalysisRoots", toJson()); | 670 return new Request(id, "analysis.setAnalysisRoots", toJson()); |
| 642 } | 671 } |
| 643 | 672 |
| 644 @override | 673 @override |
| 645 String toString() => JSON.encode(toJson()); | 674 String toString() => JSON.encode(toJson()); |
| 646 | 675 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 659 hash = _JenkinsSmiHash.combine(hash, included.hashCode); | 688 hash = _JenkinsSmiHash.combine(hash, included.hashCode); |
| 660 hash = _JenkinsSmiHash.combine(hash, excluded.hashCode); | 689 hash = _JenkinsSmiHash.combine(hash, excluded.hashCode); |
| 661 return _JenkinsSmiHash.finish(hash); | 690 return _JenkinsSmiHash.finish(hash); |
| 662 } | 691 } |
| 663 } | 692 } |
| 664 | 693 |
| 665 /** | 694 /** |
| 666 * analysis.setPriorityFiles params | 695 * analysis.setPriorityFiles params |
| 667 * | 696 * |
| 668 * { | 697 * { |
| 669 * "files": List<FilePath> | 698 * "files": optional List<FilePath> |
| 670 * } | 699 * } |
| 671 */ | 700 */ |
| 672 class AnalysisSetPriorityFilesParams implements HasToJson { | 701 class AnalysisSetPriorityFilesParams implements HasToJson { |
| 673 /** | 702 /** |
| 674 * The files that are to be a priority for analysis. | 703 * The files that are to be a priority for analysis. |
| 675 */ | 704 */ |
| 676 List<String> files; | 705 List<String> files; |
| 677 | 706 |
| 678 AnalysisSetPriorityFilesParams(this.files); | 707 AnalysisSetPriorityFilesParams({this.files}) { |
| 708 if (files == null) { |
| 709 files = <String>[]; |
| 710 } |
| 711 } |
| 679 | 712 |
| 680 factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | 713 factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { |
| 681 if (json == null) { | 714 if (json == null) { |
| 682 json = {}; | 715 json = {}; |
| 683 } | 716 } |
| 684 if (json is Map) { | 717 if (json is Map) { |
| 685 List<String> files; | 718 List<String> files; |
| 686 if (json.containsKey("files")) { | 719 if (json.containsKey("files")) { |
| 687 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); | 720 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); |
| 688 } else { | 721 } else { |
| 689 throw jsonDecoder.missingKey(jsonPath, "files"); | 722 files = <String>[]; |
| 690 } | 723 } |
| 691 return new AnalysisSetPriorityFilesParams(files); | 724 return new AnalysisSetPriorityFilesParams(files: files); |
| 692 } else { | 725 } else { |
| 693 throw jsonDecoder.mismatch(jsonPath, "analysis.setPriorityFiles params"); | 726 throw jsonDecoder.mismatch(jsonPath, "analysis.setPriorityFiles params"); |
| 694 } | 727 } |
| 695 } | 728 } |
| 696 | 729 |
| 697 factory AnalysisSetPriorityFilesParams.fromRequest(Request request) { | 730 factory AnalysisSetPriorityFilesParams.fromRequest(Request request) { |
| 698 return new AnalysisSetPriorityFilesParams.fromJson( | 731 return new AnalysisSetPriorityFilesParams.fromJson( |
| 699 new RequestDecoder(request), "params", request.params); | 732 new RequestDecoder(request), "params", request.params); |
| 700 } | 733 } |
| 701 | 734 |
| 702 Map<String, dynamic> toJson() { | 735 Map<String, dynamic> toJson() { |
| 703 Map<String, dynamic> result = {}; | 736 Map<String, dynamic> result = {}; |
| 704 result["files"] = files; | 737 if (files.isNotEmpty) { |
| 738 result["files"] = files; |
| 739 } |
| 705 return result; | 740 return result; |
| 706 } | 741 } |
| 707 | 742 |
| 708 Request toRequest(String id) { | 743 Request toRequest(String id) { |
| 709 return new Request(id, "analysis.setPriorityFiles", toJson()); | 744 return new Request(id, "analysis.setPriorityFiles", toJson()); |
| 710 } | 745 } |
| 711 | 746 |
| 712 @override | 747 @override |
| 713 String toString() => JSON.encode(toJson()); | 748 String toString() => JSON.encode(toJson()); |
| 714 | 749 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | 961 hash = _JenkinsSmiHash.combine(hash, options.hashCode); |
| 927 return _JenkinsSmiHash.finish(hash); | 962 return _JenkinsSmiHash.finish(hash); |
| 928 } | 963 } |
| 929 } | 964 } |
| 930 | 965 |
| 931 /** | 966 /** |
| 932 * analysis.errors params | 967 * analysis.errors params |
| 933 * | 968 * |
| 934 * { | 969 * { |
| 935 * "file": FilePath | 970 * "file": FilePath |
| 936 * "errors": List<AnalysisError> | 971 * "errors": optional List<AnalysisError> |
| 937 * } | 972 * } |
| 938 */ | 973 */ |
| 939 class AnalysisErrorsParams implements HasToJson { | 974 class AnalysisErrorsParams implements HasToJson { |
| 940 /** | 975 /** |
| 941 * The file containing the errors. | 976 * The file containing the errors. |
| 942 */ | 977 */ |
| 943 String file; | 978 String file; |
| 944 | 979 |
| 945 /** | 980 /** |
| 946 * The errors contained in the file. | 981 * The errors contained in the file. |
| 947 */ | 982 */ |
| 948 List<AnalysisError> errors; | 983 List<AnalysisError> errors; |
| 949 | 984 |
| 950 AnalysisErrorsParams(this.file, this.errors); | 985 AnalysisErrorsParams(this.file, {this.errors}) { |
| 986 if (errors == null) { |
| 987 errors = <AnalysisError>[]; |
| 988 } |
| 989 } |
| 951 | 990 |
| 952 factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | 991 factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { |
| 953 if (json == null) { | 992 if (json == null) { |
| 954 json = {}; | 993 json = {}; |
| 955 } | 994 } |
| 956 if (json is Map) { | 995 if (json is Map) { |
| 957 String file; | 996 String file; |
| 958 if (json.containsKey("file")) { | 997 if (json.containsKey("file")) { |
| 959 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 998 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 960 } else { | 999 } else { |
| 961 throw jsonDecoder.missingKey(jsonPath, "file"); | 1000 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 962 } | 1001 } |
| 963 List<AnalysisError> errors; | 1002 List<AnalysisError> errors; |
| 964 if (json.containsKey("errors")) { | 1003 if (json.containsKey("errors")) { |
| 965 errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (
String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPat
h, json)); | 1004 errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (
String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPat
h, json)); |
| 966 } else { | 1005 } else { |
| 967 throw jsonDecoder.missingKey(jsonPath, "errors"); | 1006 errors = <AnalysisError>[]; |
| 968 } | 1007 } |
| 969 return new AnalysisErrorsParams(file, errors); | 1008 return new AnalysisErrorsParams(file, errors: errors); |
| 970 } else { | 1009 } else { |
| 971 throw jsonDecoder.mismatch(jsonPath, "analysis.errors params"); | 1010 throw jsonDecoder.mismatch(jsonPath, "analysis.errors params"); |
| 972 } | 1011 } |
| 973 } | 1012 } |
| 974 | 1013 |
| 975 factory AnalysisErrorsParams.fromNotification(Notification notification) { | 1014 factory AnalysisErrorsParams.fromNotification(Notification notification) { |
| 976 return new AnalysisErrorsParams.fromJson( | 1015 return new AnalysisErrorsParams.fromJson( |
| 977 new ResponseDecoder(), "params", notification.params); | 1016 new ResponseDecoder(), "params", notification.params); |
| 978 } | 1017 } |
| 979 | 1018 |
| 980 Map<String, dynamic> toJson() { | 1019 Map<String, dynamic> toJson() { |
| 981 Map<String, dynamic> result = {}; | 1020 Map<String, dynamic> result = {}; |
| 982 result["file"] = file; | 1021 result["file"] = file; |
| 983 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toLis
t(); | 1022 if (errors.isNotEmpty) { |
| 1023 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toL
ist(); |
| 1024 } |
| 984 return result; | 1025 return result; |
| 985 } | 1026 } |
| 986 | 1027 |
| 987 @override | 1028 @override |
| 988 String toString() => JSON.encode(toJson()); | 1029 String toString() => JSON.encode(toJson()); |
| 989 | 1030 |
| 990 @override | 1031 @override |
| 991 bool operator==(other) { | 1032 bool operator==(other) { |
| 992 if (other is AnalysisErrorsParams) { | 1033 if (other is AnalysisErrorsParams) { |
| 993 return file == other.file && | 1034 return file == other.file && |
| 994 _listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) =>
a == b); | 1035 _listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) =>
a == b); |
| 995 } | 1036 } |
| 996 return false; | 1037 return false; |
| 997 } | 1038 } |
| 998 | 1039 |
| 999 @override | 1040 @override |
| 1000 int get hashCode { | 1041 int get hashCode { |
| 1001 int hash = 0; | 1042 int hash = 0; |
| 1002 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 1043 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 1003 hash = _JenkinsSmiHash.combine(hash, errors.hashCode); | 1044 hash = _JenkinsSmiHash.combine(hash, errors.hashCode); |
| 1004 return _JenkinsSmiHash.finish(hash); | 1045 return _JenkinsSmiHash.finish(hash); |
| 1005 } | 1046 } |
| 1006 } | 1047 } |
| 1007 | 1048 |
| 1008 /** | 1049 /** |
| 1009 * analysis.flushResults params | 1050 * analysis.flushResults params |
| 1010 * | 1051 * |
| 1011 * { | 1052 * { |
| 1012 * "files": List<FilePath> | 1053 * "files": optional List<FilePath> |
| 1013 * } | 1054 * } |
| 1014 */ | 1055 */ |
| 1015 class AnalysisFlushResultsParams implements HasToJson { | 1056 class AnalysisFlushResultsParams implements HasToJson { |
| 1016 /** | 1057 /** |
| 1017 * The files that are no longer being analyzed. | 1058 * The files that are no longer being analyzed. |
| 1018 */ | 1059 */ |
| 1019 List<String> files; | 1060 List<String> files; |
| 1020 | 1061 |
| 1021 AnalysisFlushResultsParams(this.files); | 1062 AnalysisFlushResultsParams({this.files}) { |
| 1063 if (files == null) { |
| 1064 files = <String>[]; |
| 1065 } |
| 1066 } |
| 1022 | 1067 |
| 1023 factory AnalysisFlushResultsParams.fromJson(JsonDecoder jsonDecoder, String js
onPath, Object json) { | 1068 factory AnalysisFlushResultsParams.fromJson(JsonDecoder jsonDecoder, String js
onPath, Object json) { |
| 1024 if (json == null) { | 1069 if (json == null) { |
| 1025 json = {}; | 1070 json = {}; |
| 1026 } | 1071 } |
| 1027 if (json is Map) { | 1072 if (json is Map) { |
| 1028 List<String> files; | 1073 List<String> files; |
| 1029 if (json.containsKey("files")) { | 1074 if (json.containsKey("files")) { |
| 1030 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); | 1075 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); |
| 1031 } else { | 1076 } else { |
| 1032 throw jsonDecoder.missingKey(jsonPath, "files"); | 1077 files = <String>[]; |
| 1033 } | 1078 } |
| 1034 return new AnalysisFlushResultsParams(files); | 1079 return new AnalysisFlushResultsParams(files: files); |
| 1035 } else { | 1080 } else { |
| 1036 throw jsonDecoder.mismatch(jsonPath, "analysis.flushResults params"); | 1081 throw jsonDecoder.mismatch(jsonPath, "analysis.flushResults params"); |
| 1037 } | 1082 } |
| 1038 } | 1083 } |
| 1039 | 1084 |
| 1040 factory AnalysisFlushResultsParams.fromNotification(Notification notification)
{ | 1085 factory AnalysisFlushResultsParams.fromNotification(Notification notification)
{ |
| 1041 return new AnalysisFlushResultsParams.fromJson( | 1086 return new AnalysisFlushResultsParams.fromJson( |
| 1042 new ResponseDecoder(), "params", notification.params); | 1087 new ResponseDecoder(), "params", notification.params); |
| 1043 } | 1088 } |
| 1044 | 1089 |
| 1045 Map<String, dynamic> toJson() { | 1090 Map<String, dynamic> toJson() { |
| 1046 Map<String, dynamic> result = {}; | 1091 Map<String, dynamic> result = {}; |
| 1047 result["files"] = files; | 1092 if (files.isNotEmpty) { |
| 1093 result["files"] = files; |
| 1094 } |
| 1048 return result; | 1095 return result; |
| 1049 } | 1096 } |
| 1050 | 1097 |
| 1051 @override | 1098 @override |
| 1052 String toString() => JSON.encode(toJson()); | 1099 String toString() => JSON.encode(toJson()); |
| 1053 | 1100 |
| 1054 @override | 1101 @override |
| 1055 bool operator==(other) { | 1102 bool operator==(other) { |
| 1056 if (other is AnalysisFlushResultsParams) { | 1103 if (other is AnalysisFlushResultsParams) { |
| 1057 return _listEqual(files, other.files, (String a, String b) => a == b); | 1104 return _listEqual(files, other.files, (String a, String b) => a == b); |
| 1058 } | 1105 } |
| 1059 return false; | 1106 return false; |
| 1060 } | 1107 } |
| 1061 | 1108 |
| 1062 @override | 1109 @override |
| 1063 int get hashCode { | 1110 int get hashCode { |
| 1064 int hash = 0; | 1111 int hash = 0; |
| 1065 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | 1112 hash = _JenkinsSmiHash.combine(hash, files.hashCode); |
| 1066 return _JenkinsSmiHash.finish(hash); | 1113 return _JenkinsSmiHash.finish(hash); |
| 1067 } | 1114 } |
| 1068 } | 1115 } |
| 1069 | 1116 |
| 1070 /** | 1117 /** |
| 1071 * analysis.folding params | 1118 * analysis.folding params |
| 1072 * | 1119 * |
| 1073 * { | 1120 * { |
| 1074 * "file": FilePath | 1121 * "file": FilePath |
| 1075 * "regions": List<FoldingRegion> | 1122 * "regions": optional List<FoldingRegion> |
| 1076 * } | 1123 * } |
| 1077 */ | 1124 */ |
| 1078 class AnalysisFoldingParams implements HasToJson { | 1125 class AnalysisFoldingParams implements HasToJson { |
| 1079 /** | 1126 /** |
| 1080 * The file containing the folding regions. | 1127 * The file containing the folding regions. |
| 1081 */ | 1128 */ |
| 1082 String file; | 1129 String file; |
| 1083 | 1130 |
| 1084 /** | 1131 /** |
| 1085 * The folding regions contained in the file. | 1132 * The folding regions contained in the file. |
| 1086 */ | 1133 */ |
| 1087 List<FoldingRegion> regions; | 1134 List<FoldingRegion> regions; |
| 1088 | 1135 |
| 1089 AnalysisFoldingParams(this.file, this.regions); | 1136 AnalysisFoldingParams(this.file, {this.regions}) { |
| 1137 if (regions == null) { |
| 1138 regions = <FoldingRegion>[]; |
| 1139 } |
| 1140 } |
| 1090 | 1141 |
| 1091 factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | 1142 factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { |
| 1092 if (json == null) { | 1143 if (json == null) { |
| 1093 json = {}; | 1144 json = {}; |
| 1094 } | 1145 } |
| 1095 if (json is Map) { | 1146 if (json is Map) { |
| 1096 String file; | 1147 String file; |
| 1097 if (json.containsKey("file")) { | 1148 if (json.containsKey("file")) { |
| 1098 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 1149 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 1099 } else { | 1150 } else { |
| 1100 throw jsonDecoder.missingKey(jsonPath, "file"); | 1151 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 1101 } | 1152 } |
| 1102 List<FoldingRegion> regions; | 1153 List<FoldingRegion> regions; |
| 1103 if (json.containsKey("regions")) { | 1154 if (json.containsKey("regions")) { |
| 1104 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new FoldingRegion.fromJson(jsonDecoder, json
Path, json)); | 1155 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new FoldingRegion.fromJson(jsonDecoder, json
Path, json)); |
| 1105 } else { | 1156 } else { |
| 1106 throw jsonDecoder.missingKey(jsonPath, "regions"); | 1157 regions = <FoldingRegion>[]; |
| 1107 } | 1158 } |
| 1108 return new AnalysisFoldingParams(file, regions); | 1159 return new AnalysisFoldingParams(file, regions: regions); |
| 1109 } else { | 1160 } else { |
| 1110 throw jsonDecoder.mismatch(jsonPath, "analysis.folding params"); | 1161 throw jsonDecoder.mismatch(jsonPath, "analysis.folding params"); |
| 1111 } | 1162 } |
| 1112 } | 1163 } |
| 1113 | 1164 |
| 1114 factory AnalysisFoldingParams.fromNotification(Notification notification) { | 1165 factory AnalysisFoldingParams.fromNotification(Notification notification) { |
| 1115 return new AnalysisFoldingParams.fromJson( | 1166 return new AnalysisFoldingParams.fromJson( |
| 1116 new ResponseDecoder(), "params", notification.params); | 1167 new ResponseDecoder(), "params", notification.params); |
| 1117 } | 1168 } |
| 1118 | 1169 |
| 1119 Map<String, dynamic> toJson() { | 1170 Map<String, dynamic> toJson() { |
| 1120 Map<String, dynamic> result = {}; | 1171 Map<String, dynamic> result = {}; |
| 1121 result["file"] = file; | 1172 result["file"] = file; |
| 1122 result["regions"] = regions.map((FoldingRegion value) => value.toJson()).toL
ist(); | 1173 if (regions.isNotEmpty) { |
| 1174 result["regions"] = regions.map((FoldingRegion value) => value.toJson()).t
oList(); |
| 1175 } |
| 1123 return result; | 1176 return result; |
| 1124 } | 1177 } |
| 1125 | 1178 |
| 1126 @override | 1179 @override |
| 1127 String toString() => JSON.encode(toJson()); | 1180 String toString() => JSON.encode(toJson()); |
| 1128 | 1181 |
| 1129 @override | 1182 @override |
| 1130 bool operator==(other) { | 1183 bool operator==(other) { |
| 1131 if (other is AnalysisFoldingParams) { | 1184 if (other is AnalysisFoldingParams) { |
| 1132 return file == other.file && | 1185 return file == other.file && |
| 1133 _listEqual(regions, other.regions, (FoldingRegion a, FoldingRegion b)
=> a == b); | 1186 _listEqual(regions, other.regions, (FoldingRegion a, FoldingRegion b)
=> a == b); |
| 1134 } | 1187 } |
| 1135 return false; | 1188 return false; |
| 1136 } | 1189 } |
| 1137 | 1190 |
| 1138 @override | 1191 @override |
| 1139 int get hashCode { | 1192 int get hashCode { |
| 1140 int hash = 0; | 1193 int hash = 0; |
| 1141 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 1194 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 1142 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | 1195 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); |
| 1143 return _JenkinsSmiHash.finish(hash); | 1196 return _JenkinsSmiHash.finish(hash); |
| 1144 } | 1197 } |
| 1145 } | 1198 } |
| 1146 | 1199 |
| 1147 /** | 1200 /** |
| 1148 * analysis.highlights params | 1201 * analysis.highlights params |
| 1149 * | 1202 * |
| 1150 * { | 1203 * { |
| 1151 * "file": FilePath | 1204 * "file": FilePath |
| 1152 * "regions": List<HighlightRegion> | 1205 * "regions": optional List<HighlightRegion> |
| 1153 * } | 1206 * } |
| 1154 */ | 1207 */ |
| 1155 class AnalysisHighlightsParams implements HasToJson { | 1208 class AnalysisHighlightsParams implements HasToJson { |
| 1156 /** | 1209 /** |
| 1157 * The file containing the highlight regions. | 1210 * The file containing the highlight regions. |
| 1158 */ | 1211 */ |
| 1159 String file; | 1212 String file; |
| 1160 | 1213 |
| 1161 /** | 1214 /** |
| 1162 * The highlight regions contained in the file. Each highlight region | 1215 * The highlight regions contained in the file. Each highlight region |
| 1163 * represents a particular syntactic or semantic meaning associated with some | 1216 * represents a particular syntactic or semantic meaning associated with some |
| 1164 * range. Note that the highlight regions that are returned can overlap other | 1217 * range. Note that the highlight regions that are returned can overlap other |
| 1165 * highlight regions if there is more than one meaning associated with a | 1218 * highlight regions if there is more than one meaning associated with a |
| 1166 * particular region. | 1219 * particular region. |
| 1167 */ | 1220 */ |
| 1168 List<HighlightRegion> regions; | 1221 List<HighlightRegion> regions; |
| 1169 | 1222 |
| 1170 AnalysisHighlightsParams(this.file, this.regions); | 1223 AnalysisHighlightsParams(this.file, {this.regions}) { |
| 1224 if (regions == null) { |
| 1225 regions = <HighlightRegion>[]; |
| 1226 } |
| 1227 } |
| 1171 | 1228 |
| 1172 factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | 1229 factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { |
| 1173 if (json == null) { | 1230 if (json == null) { |
| 1174 json = {}; | 1231 json = {}; |
| 1175 } | 1232 } |
| 1176 if (json is Map) { | 1233 if (json is Map) { |
| 1177 String file; | 1234 String file; |
| 1178 if (json.containsKey("file")) { | 1235 if (json.containsKey("file")) { |
| 1179 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 1236 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 1180 } else { | 1237 } else { |
| 1181 throw jsonDecoder.missingKey(jsonPath, "file"); | 1238 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 1182 } | 1239 } |
| 1183 List<HighlightRegion> regions; | 1240 List<HighlightRegion> regions; |
| 1184 if (json.containsKey("regions")) { | 1241 if (json.containsKey("regions")) { |
| 1185 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new HighlightRegion.fromJson(jsonDecoder, js
onPath, json)); | 1242 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new HighlightRegion.fromJson(jsonDecoder, js
onPath, json)); |
| 1186 } else { | 1243 } else { |
| 1187 throw jsonDecoder.missingKey(jsonPath, "regions"); | 1244 regions = <HighlightRegion>[]; |
| 1188 } | 1245 } |
| 1189 return new AnalysisHighlightsParams(file, regions); | 1246 return new AnalysisHighlightsParams(file, regions: regions); |
| 1190 } else { | 1247 } else { |
| 1191 throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params"); | 1248 throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params"); |
| 1192 } | 1249 } |
| 1193 } | 1250 } |
| 1194 | 1251 |
| 1195 factory AnalysisHighlightsParams.fromNotification(Notification notification) { | 1252 factory AnalysisHighlightsParams.fromNotification(Notification notification) { |
| 1196 return new AnalysisHighlightsParams.fromJson( | 1253 return new AnalysisHighlightsParams.fromJson( |
| 1197 new ResponseDecoder(), "params", notification.params); | 1254 new ResponseDecoder(), "params", notification.params); |
| 1198 } | 1255 } |
| 1199 | 1256 |
| 1200 Map<String, dynamic> toJson() { | 1257 Map<String, dynamic> toJson() { |
| 1201 Map<String, dynamic> result = {}; | 1258 Map<String, dynamic> result = {}; |
| 1202 result["file"] = file; | 1259 result["file"] = file; |
| 1203 result["regions"] = regions.map((HighlightRegion value) => value.toJson()).t
oList(); | 1260 if (regions.isNotEmpty) { |
| 1261 result["regions"] = regions.map((HighlightRegion value) => value.toJson())
.toList(); |
| 1262 } |
| 1204 return result; | 1263 return result; |
| 1205 } | 1264 } |
| 1206 | 1265 |
| 1207 @override | 1266 @override |
| 1208 String toString() => JSON.encode(toJson()); | 1267 String toString() => JSON.encode(toJson()); |
| 1209 | 1268 |
| 1210 @override | 1269 @override |
| 1211 bool operator==(other) { | 1270 bool operator==(other) { |
| 1212 if (other is AnalysisHighlightsParams) { | 1271 if (other is AnalysisHighlightsParams) { |
| 1213 return file == other.file && | 1272 return file == other.file && |
| 1214 _listEqual(regions, other.regions, (HighlightRegion a, HighlightRegion
b) => a == b); | 1273 _listEqual(regions, other.regions, (HighlightRegion a, HighlightRegion
b) => a == b); |
| 1215 } | 1274 } |
| 1216 return false; | 1275 return false; |
| 1217 } | 1276 } |
| 1218 | 1277 |
| 1219 @override | 1278 @override |
| 1220 int get hashCode { | 1279 int get hashCode { |
| 1221 int hash = 0; | 1280 int hash = 0; |
| 1222 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 1281 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 1223 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | 1282 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); |
| 1224 return _JenkinsSmiHash.finish(hash); | 1283 return _JenkinsSmiHash.finish(hash); |
| 1225 } | 1284 } |
| 1226 } | 1285 } |
| 1227 | 1286 |
| 1228 /** | 1287 /** |
| 1229 * analysis.navigation params | 1288 * analysis.navigation params |
| 1230 * | 1289 * |
| 1231 * { | 1290 * { |
| 1232 * "file": FilePath | 1291 * "file": FilePath |
| 1233 * "regions": List<NavigationRegion> | 1292 * "regions": optional List<NavigationRegion> |
| 1234 * } | 1293 * } |
| 1235 */ | 1294 */ |
| 1236 class AnalysisNavigationParams implements HasToJson { | 1295 class AnalysisNavigationParams implements HasToJson { |
| 1237 /** | 1296 /** |
| 1238 * The file containing the navigation regions. | 1297 * The file containing the navigation regions. |
| 1239 */ | 1298 */ |
| 1240 String file; | 1299 String file; |
| 1241 | 1300 |
| 1242 /** | 1301 /** |
| 1243 * The navigation regions contained in the file. Each navigation region | 1302 * The navigation regions contained in the file. Each navigation region |
| 1244 * represents a list of targets associated with some range. The lists will | 1303 * represents a list of targets associated with some range. The lists will |
| 1245 * usually contain a single target, but can contain more in the case of a | 1304 * usually contain a single target, but can contain more in the case of a |
| 1246 * part that is included in multiple libraries or in Dart code that is | 1305 * part that is included in multiple libraries or in Dart code that is |
| 1247 * compiled against multiple versions of a package. Note that the navigation | 1306 * compiled against multiple versions of a package. Note that the navigation |
| 1248 * regions that are returned do not overlap other navigation regions. | 1307 * regions that are returned do not overlap other navigation regions. |
| 1249 */ | 1308 */ |
| 1250 List<NavigationRegion> regions; | 1309 List<NavigationRegion> regions; |
| 1251 | 1310 |
| 1252 AnalysisNavigationParams(this.file, this.regions); | 1311 AnalysisNavigationParams(this.file, {this.regions}) { |
| 1312 if (regions == null) { |
| 1313 regions = <NavigationRegion>[]; |
| 1314 } |
| 1315 } |
| 1253 | 1316 |
| 1254 factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | 1317 factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { |
| 1255 if (json == null) { | 1318 if (json == null) { |
| 1256 json = {}; | 1319 json = {}; |
| 1257 } | 1320 } |
| 1258 if (json is Map) { | 1321 if (json is Map) { |
| 1259 String file; | 1322 String file; |
| 1260 if (json.containsKey("file")) { | 1323 if (json.containsKey("file")) { |
| 1261 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 1324 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 1262 } else { | 1325 } else { |
| 1263 throw jsonDecoder.missingKey(jsonPath, "file"); | 1326 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 1264 } | 1327 } |
| 1265 List<NavigationRegion> regions; | 1328 List<NavigationRegion> regions; |
| 1266 if (json.containsKey("regions")) { | 1329 if (json.containsKey("regions")) { |
| 1267 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, j
sonPath, json)); | 1330 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, j
sonPath, json)); |
| 1268 } else { | 1331 } else { |
| 1269 throw jsonDecoder.missingKey(jsonPath, "regions"); | 1332 regions = <NavigationRegion>[]; |
| 1270 } | 1333 } |
| 1271 return new AnalysisNavigationParams(file, regions); | 1334 return new AnalysisNavigationParams(file, regions: regions); |
| 1272 } else { | 1335 } else { |
| 1273 throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params"); | 1336 throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params"); |
| 1274 } | 1337 } |
| 1275 } | 1338 } |
| 1276 | 1339 |
| 1277 factory AnalysisNavigationParams.fromNotification(Notification notification) { | 1340 factory AnalysisNavigationParams.fromNotification(Notification notification) { |
| 1278 return new AnalysisNavigationParams.fromJson( | 1341 return new AnalysisNavigationParams.fromJson( |
| 1279 new ResponseDecoder(), "params", notification.params); | 1342 new ResponseDecoder(), "params", notification.params); |
| 1280 } | 1343 } |
| 1281 | 1344 |
| 1282 Map<String, dynamic> toJson() { | 1345 Map<String, dynamic> toJson() { |
| 1283 Map<String, dynamic> result = {}; | 1346 Map<String, dynamic> result = {}; |
| 1284 result["file"] = file; | 1347 result["file"] = file; |
| 1285 result["regions"] = regions.map((NavigationRegion value) => value.toJson()).
toList(); | 1348 if (regions.isNotEmpty) { |
| 1349 result["regions"] = regions.map((NavigationRegion value) => value.toJson()
).toList(); |
| 1350 } |
| 1286 return result; | 1351 return result; |
| 1287 } | 1352 } |
| 1288 | 1353 |
| 1289 @override | 1354 @override |
| 1290 String toString() => JSON.encode(toJson()); | 1355 String toString() => JSON.encode(toJson()); |
| 1291 | 1356 |
| 1292 @override | 1357 @override |
| 1293 bool operator==(other) { | 1358 bool operator==(other) { |
| 1294 if (other is AnalysisNavigationParams) { | 1359 if (other is AnalysisNavigationParams) { |
| 1295 return file == other.file && | 1360 return file == other.file && |
| 1296 _listEqual(regions, other.regions, (NavigationRegion a, NavigationRegi
on b) => a == b); | 1361 _listEqual(regions, other.regions, (NavigationRegion a, NavigationRegi
on b) => a == b); |
| 1297 } | 1362 } |
| 1298 return false; | 1363 return false; |
| 1299 } | 1364 } |
| 1300 | 1365 |
| 1301 @override | 1366 @override |
| 1302 int get hashCode { | 1367 int get hashCode { |
| 1303 int hash = 0; | 1368 int hash = 0; |
| 1304 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 1369 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 1305 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | 1370 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); |
| 1306 return _JenkinsSmiHash.finish(hash); | 1371 return _JenkinsSmiHash.finish(hash); |
| 1307 } | 1372 } |
| 1308 } | 1373 } |
| 1309 | 1374 |
| 1310 /** | 1375 /** |
| 1311 * analysis.occurrences params | 1376 * analysis.occurrences params |
| 1312 * | 1377 * |
| 1313 * { | 1378 * { |
| 1314 * "file": FilePath | 1379 * "file": FilePath |
| 1315 * "occurrences": List<Occurrences> | 1380 * "occurrences": optional List<Occurrences> |
| 1316 * } | 1381 * } |
| 1317 */ | 1382 */ |
| 1318 class AnalysisOccurrencesParams implements HasToJson { | 1383 class AnalysisOccurrencesParams implements HasToJson { |
| 1319 /** | 1384 /** |
| 1320 * The file in which the references occur. | 1385 * The file in which the references occur. |
| 1321 */ | 1386 */ |
| 1322 String file; | 1387 String file; |
| 1323 | 1388 |
| 1324 /** | 1389 /** |
| 1325 * The occurrences of references to elements within the file. | 1390 * The occurrences of references to elements within the file. |
| 1326 */ | 1391 */ |
| 1327 List<Occurrences> occurrences; | 1392 List<Occurrences> occurrences; |
| 1328 | 1393 |
| 1329 AnalysisOccurrencesParams(this.file, this.occurrences); | 1394 AnalysisOccurrencesParams(this.file, {this.occurrences}) { |
| 1395 if (occurrences == null) { |
| 1396 occurrences = <Occurrences>[]; |
| 1397 } |
| 1398 } |
| 1330 | 1399 |
| 1331 factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jso
nPath, Object json) { | 1400 factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jso
nPath, Object json) { |
| 1332 if (json == null) { | 1401 if (json == null) { |
| 1333 json = {}; | 1402 json = {}; |
| 1334 } | 1403 } |
| 1335 if (json is Map) { | 1404 if (json is Map) { |
| 1336 String file; | 1405 String file; |
| 1337 if (json.containsKey("file")) { | 1406 if (json.containsKey("file")) { |
| 1338 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 1407 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 1339 } else { | 1408 } else { |
| 1340 throw jsonDecoder.missingKey(jsonPath, "file"); | 1409 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 1341 } | 1410 } |
| 1342 List<Occurrences> occurrences; | 1411 List<Occurrences> occurrences; |
| 1343 if (json.containsKey("occurrences")) { | 1412 if (json.containsKey("occurrences")) { |
| 1344 occurrences = jsonDecoder._decodeList(jsonPath + ".occurrences", json["o
ccurrences"], (String jsonPath, Object json) => new Occurrences.fromJson(jsonDec
oder, jsonPath, json)); | 1413 occurrences = jsonDecoder._decodeList(jsonPath + ".occurrences", json["o
ccurrences"], (String jsonPath, Object json) => new Occurrences.fromJson(jsonDec
oder, jsonPath, json)); |
| 1345 } else { | 1414 } else { |
| 1346 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | 1415 occurrences = <Occurrences>[]; |
| 1347 } | 1416 } |
| 1348 return new AnalysisOccurrencesParams(file, occurrences); | 1417 return new AnalysisOccurrencesParams(file, occurrences: occurrences); |
| 1349 } else { | 1418 } else { |
| 1350 throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params"); | 1419 throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params"); |
| 1351 } | 1420 } |
| 1352 } | 1421 } |
| 1353 | 1422 |
| 1354 factory AnalysisOccurrencesParams.fromNotification(Notification notification)
{ | 1423 factory AnalysisOccurrencesParams.fromNotification(Notification notification)
{ |
| 1355 return new AnalysisOccurrencesParams.fromJson( | 1424 return new AnalysisOccurrencesParams.fromJson( |
| 1356 new ResponseDecoder(), "params", notification.params); | 1425 new ResponseDecoder(), "params", notification.params); |
| 1357 } | 1426 } |
| 1358 | 1427 |
| 1359 Map<String, dynamic> toJson() { | 1428 Map<String, dynamic> toJson() { |
| 1360 Map<String, dynamic> result = {}; | 1429 Map<String, dynamic> result = {}; |
| 1361 result["file"] = file; | 1430 result["file"] = file; |
| 1362 result["occurrences"] = occurrences.map((Occurrences value) => value.toJson(
)).toList(); | 1431 if (occurrences.isNotEmpty) { |
| 1432 result["occurrences"] = occurrences.map((Occurrences value) => value.toJso
n()).toList(); |
| 1433 } |
| 1363 return result; | 1434 return result; |
| 1364 } | 1435 } |
| 1365 | 1436 |
| 1366 @override | 1437 @override |
| 1367 String toString() => JSON.encode(toJson()); | 1438 String toString() => JSON.encode(toJson()); |
| 1368 | 1439 |
| 1369 @override | 1440 @override |
| 1370 bool operator==(other) { | 1441 bool operator==(other) { |
| 1371 if (other is AnalysisOccurrencesParams) { | 1442 if (other is AnalysisOccurrencesParams) { |
| 1372 return file == other.file && | 1443 return file == other.file && |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 hash = _JenkinsSmiHash.combine(hash, outline.hashCode); | 1530 hash = _JenkinsSmiHash.combine(hash, outline.hashCode); |
| 1460 return _JenkinsSmiHash.finish(hash); | 1531 return _JenkinsSmiHash.finish(hash); |
| 1461 } | 1532 } |
| 1462 } | 1533 } |
| 1463 | 1534 |
| 1464 /** | 1535 /** |
| 1465 * analysis.overrides params | 1536 * analysis.overrides params |
| 1466 * | 1537 * |
| 1467 * { | 1538 * { |
| 1468 * "file": FilePath | 1539 * "file": FilePath |
| 1469 * "overrides": List<Override> | 1540 * "overrides": optional List<Override> |
| 1470 * } | 1541 * } |
| 1471 */ | 1542 */ |
| 1472 class AnalysisOverridesParams implements HasToJson { | 1543 class AnalysisOverridesParams implements HasToJson { |
| 1473 /** | 1544 /** |
| 1474 * The file with which the overrides are associated. | 1545 * The file with which the overrides are associated. |
| 1475 */ | 1546 */ |
| 1476 String file; | 1547 String file; |
| 1477 | 1548 |
| 1478 /** | 1549 /** |
| 1479 * The overrides associated with the file. | 1550 * The overrides associated with the file. |
| 1480 */ | 1551 */ |
| 1481 List<Override> overrides; | 1552 List<Override> overrides; |
| 1482 | 1553 |
| 1483 AnalysisOverridesParams(this.file, this.overrides); | 1554 AnalysisOverridesParams(this.file, {this.overrides}) { |
| 1555 if (overrides == null) { |
| 1556 overrides = <Override>[]; |
| 1557 } |
| 1558 } |
| 1484 | 1559 |
| 1485 factory AnalysisOverridesParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | 1560 factory AnalysisOverridesParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { |
| 1486 if (json == null) { | 1561 if (json == null) { |
| 1487 json = {}; | 1562 json = {}; |
| 1488 } | 1563 } |
| 1489 if (json is Map) { | 1564 if (json is Map) { |
| 1490 String file; | 1565 String file; |
| 1491 if (json.containsKey("file")) { | 1566 if (json.containsKey("file")) { |
| 1492 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 1567 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 1493 } else { | 1568 } else { |
| 1494 throw jsonDecoder.missingKey(jsonPath, "file"); | 1569 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 1495 } | 1570 } |
| 1496 List<Override> overrides; | 1571 List<Override> overrides; |
| 1497 if (json.containsKey("overrides")) { | 1572 if (json.containsKey("overrides")) { |
| 1498 overrides = jsonDecoder._decodeList(jsonPath + ".overrides", json["overr
ides"], (String jsonPath, Object json) => new Override.fromJson(jsonDecoder, jso
nPath, json)); | 1573 overrides = jsonDecoder._decodeList(jsonPath + ".overrides", json["overr
ides"], (String jsonPath, Object json) => new Override.fromJson(jsonDecoder, jso
nPath, json)); |
| 1499 } else { | 1574 } else { |
| 1500 throw jsonDecoder.missingKey(jsonPath, "overrides"); | 1575 overrides = <Override>[]; |
| 1501 } | 1576 } |
| 1502 return new AnalysisOverridesParams(file, overrides); | 1577 return new AnalysisOverridesParams(file, overrides: overrides); |
| 1503 } else { | 1578 } else { |
| 1504 throw jsonDecoder.mismatch(jsonPath, "analysis.overrides params"); | 1579 throw jsonDecoder.mismatch(jsonPath, "analysis.overrides params"); |
| 1505 } | 1580 } |
| 1506 } | 1581 } |
| 1507 | 1582 |
| 1508 factory AnalysisOverridesParams.fromNotification(Notification notification) { | 1583 factory AnalysisOverridesParams.fromNotification(Notification notification) { |
| 1509 return new AnalysisOverridesParams.fromJson( | 1584 return new AnalysisOverridesParams.fromJson( |
| 1510 new ResponseDecoder(), "params", notification.params); | 1585 new ResponseDecoder(), "params", notification.params); |
| 1511 } | 1586 } |
| 1512 | 1587 |
| 1513 Map<String, dynamic> toJson() { | 1588 Map<String, dynamic> toJson() { |
| 1514 Map<String, dynamic> result = {}; | 1589 Map<String, dynamic> result = {}; |
| 1515 result["file"] = file; | 1590 result["file"] = file; |
| 1516 result["overrides"] = overrides.map((Override value) => value.toJson()).toLi
st(); | 1591 if (overrides.isNotEmpty) { |
| 1592 result["overrides"] = overrides.map((Override value) => value.toJson()).to
List(); |
| 1593 } |
| 1517 return result; | 1594 return result; |
| 1518 } | 1595 } |
| 1519 | 1596 |
| 1520 @override | 1597 @override |
| 1521 String toString() => JSON.encode(toJson()); | 1598 String toString() => JSON.encode(toJson()); |
| 1522 | 1599 |
| 1523 @override | 1600 @override |
| 1524 bool operator==(other) { | 1601 bool operator==(other) { |
| 1525 if (other is AnalysisOverridesParams) { | 1602 if (other is AnalysisOverridesParams) { |
| 1526 return file == other.file && | 1603 return file == other.file && |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 } | 1762 } |
| 1686 } | 1763 } |
| 1687 | 1764 |
| 1688 /** | 1765 /** |
| 1689 * completion.results params | 1766 * completion.results params |
| 1690 * | 1767 * |
| 1691 * { | 1768 * { |
| 1692 * "id": CompletionId | 1769 * "id": CompletionId |
| 1693 * "replacementOffset": int | 1770 * "replacementOffset": int |
| 1694 * "replacementLength": int | 1771 * "replacementLength": int |
| 1695 * "results": List<CompletionSuggestion> | 1772 * "results": optional List<CompletionSuggestion> |
| 1696 * "last": bool | 1773 * "last": bool |
| 1697 * } | 1774 * } |
| 1698 */ | 1775 */ |
| 1699 class CompletionResultsParams implements HasToJson { | 1776 class CompletionResultsParams implements HasToJson { |
| 1700 /** | 1777 /** |
| 1701 * The id associated with the completion. | 1778 * The id associated with the completion. |
| 1702 */ | 1779 */ |
| 1703 String id; | 1780 String id; |
| 1704 | 1781 |
| 1705 /** | 1782 /** |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1725 * make additional requests. | 1802 * make additional requests. |
| 1726 */ | 1803 */ |
| 1727 List<CompletionSuggestion> results; | 1804 List<CompletionSuggestion> results; |
| 1728 | 1805 |
| 1729 /** | 1806 /** |
| 1730 * True if this is that last set of results that will be returned for the | 1807 * True if this is that last set of results that will be returned for the |
| 1731 * indicated completion. | 1808 * indicated completion. |
| 1732 */ | 1809 */ |
| 1733 bool last; | 1810 bool last; |
| 1734 | 1811 |
| 1735 CompletionResultsParams(this.id, this.replacementOffset, this.replacementLengt
h, this.results, this.last); | 1812 CompletionResultsParams(this.id, this.replacementOffset, this.replacementLengt
h, this.last, {this.results}) { |
| 1813 if (results == null) { |
| 1814 results = <CompletionSuggestion>[]; |
| 1815 } |
| 1816 } |
| 1736 | 1817 |
| 1737 factory CompletionResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | 1818 factory CompletionResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { |
| 1738 if (json == null) { | 1819 if (json == null) { |
| 1739 json = {}; | 1820 json = {}; |
| 1740 } | 1821 } |
| 1741 if (json is Map) { | 1822 if (json is Map) { |
| 1742 String id; | 1823 String id; |
| 1743 if (json.containsKey("id")) { | 1824 if (json.containsKey("id")) { |
| 1744 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | 1825 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); |
| 1745 } else { | 1826 } else { |
| 1746 throw jsonDecoder.missingKey(jsonPath, "id"); | 1827 throw jsonDecoder.missingKey(jsonPath, "id"); |
| 1747 } | 1828 } |
| 1748 int replacementOffset; | 1829 int replacementOffset; |
| 1749 if (json.containsKey("replacementOffset")) { | 1830 if (json.containsKey("replacementOffset")) { |
| 1750 replacementOffset = jsonDecoder._decodeInt(jsonPath + ".replacementOffse
t", json["replacementOffset"]); | 1831 replacementOffset = jsonDecoder._decodeInt(jsonPath + ".replacementOffse
t", json["replacementOffset"]); |
| 1751 } else { | 1832 } else { |
| 1752 throw jsonDecoder.missingKey(jsonPath, "replacementOffset"); | 1833 throw jsonDecoder.missingKey(jsonPath, "replacementOffset"); |
| 1753 } | 1834 } |
| 1754 int replacementLength; | 1835 int replacementLength; |
| 1755 if (json.containsKey("replacementLength")) { | 1836 if (json.containsKey("replacementLength")) { |
| 1756 replacementLength = jsonDecoder._decodeInt(jsonPath + ".replacementLengt
h", json["replacementLength"]); | 1837 replacementLength = jsonDecoder._decodeInt(jsonPath + ".replacementLengt
h", json["replacementLength"]); |
| 1757 } else { | 1838 } else { |
| 1758 throw jsonDecoder.missingKey(jsonPath, "replacementLength"); | 1839 throw jsonDecoder.missingKey(jsonPath, "replacementLength"); |
| 1759 } | 1840 } |
| 1760 List<CompletionSuggestion> results; | 1841 List<CompletionSuggestion> results; |
| 1761 if (json.containsKey("results")) { | 1842 if (json.containsKey("results")) { |
| 1762 results = jsonDecoder._decodeList(jsonPath + ".results", json["results"]
, (String jsonPath, Object json) => new CompletionSuggestion.fromJson(jsonDecode
r, jsonPath, json)); | 1843 results = jsonDecoder._decodeList(jsonPath + ".results", json["results"]
, (String jsonPath, Object json) => new CompletionSuggestion.fromJson(jsonDecode
r, jsonPath, json)); |
| 1763 } else { | 1844 } else { |
| 1764 throw jsonDecoder.missingKey(jsonPath, "results"); | 1845 results = <CompletionSuggestion>[]; |
| 1765 } | 1846 } |
| 1766 bool last; | 1847 bool last; |
| 1767 if (json.containsKey("last")) { | 1848 if (json.containsKey("last")) { |
| 1768 last = jsonDecoder._decodeBool(jsonPath + ".last", json["last"]); | 1849 last = jsonDecoder._decodeBool(jsonPath + ".last", json["last"]); |
| 1769 } else { | 1850 } else { |
| 1770 throw jsonDecoder.missingKey(jsonPath, "last"); | 1851 throw jsonDecoder.missingKey(jsonPath, "last"); |
| 1771 } | 1852 } |
| 1772 return new CompletionResultsParams(id, replacementOffset, replacementLengt
h, results, last); | 1853 return new CompletionResultsParams(id, replacementOffset, replacementLengt
h, last, results: results); |
| 1773 } else { | 1854 } else { |
| 1774 throw jsonDecoder.mismatch(jsonPath, "completion.results params"); | 1855 throw jsonDecoder.mismatch(jsonPath, "completion.results params"); |
| 1775 } | 1856 } |
| 1776 } | 1857 } |
| 1777 | 1858 |
| 1778 factory CompletionResultsParams.fromNotification(Notification notification) { | 1859 factory CompletionResultsParams.fromNotification(Notification notification) { |
| 1779 return new CompletionResultsParams.fromJson( | 1860 return new CompletionResultsParams.fromJson( |
| 1780 new ResponseDecoder(), "params", notification.params); | 1861 new ResponseDecoder(), "params", notification.params); |
| 1781 } | 1862 } |
| 1782 | 1863 |
| 1783 Map<String, dynamic> toJson() { | 1864 Map<String, dynamic> toJson() { |
| 1784 Map<String, dynamic> result = {}; | 1865 Map<String, dynamic> result = {}; |
| 1785 result["id"] = id; | 1866 result["id"] = id; |
| 1786 result["replacementOffset"] = replacementOffset; | 1867 result["replacementOffset"] = replacementOffset; |
| 1787 result["replacementLength"] = replacementLength; | 1868 result["replacementLength"] = replacementLength; |
| 1788 result["results"] = results.map((CompletionSuggestion value) => value.toJson
()).toList(); | 1869 if (results.isNotEmpty) { |
| 1870 result["results"] = results.map((CompletionSuggestion value) => value.toJs
on()).toList(); |
| 1871 } |
| 1789 result["last"] = last; | 1872 result["last"] = last; |
| 1790 return result; | 1873 return result; |
| 1791 } | 1874 } |
| 1792 | 1875 |
| 1793 @override | 1876 @override |
| 1794 String toString() => JSON.encode(toJson()); | 1877 String toString() => JSON.encode(toJson()); |
| 1795 | 1878 |
| 1796 @override | 1879 @override |
| 1797 bool operator==(other) { | 1880 bool operator==(other) { |
| 1798 if (other is CompletionResultsParams) { | 1881 if (other is CompletionResultsParams) { |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 * requested. The index of other elements of the list is unspecified, but | 2575 * requested. The index of other elements of the list is unspecified, but |
| 2493 * correspond to the integers used to reference supertype and subtype items | 2576 * correspond to the integers used to reference supertype and subtype items |
| 2494 * within the items. | 2577 * within the items. |
| 2495 * | 2578 * |
| 2496 * This field will be absent if the code at the given file and offset does | 2579 * This field will be absent if the code at the given file and offset does |
| 2497 * not represent a type, or if the file has not been sufficiently analyzed to | 2580 * not represent a type, or if the file has not been sufficiently analyzed to |
| 2498 * allow a type hierarchy to be produced. | 2581 * allow a type hierarchy to be produced. |
| 2499 */ | 2582 */ |
| 2500 List<TypeHierarchyItem> hierarchyItems; | 2583 List<TypeHierarchyItem> hierarchyItems; |
| 2501 | 2584 |
| 2502 SearchGetTypeHierarchyResult({this.hierarchyItems}); | 2585 SearchGetTypeHierarchyResult({this.hierarchyItems}) { |
| 2586 if (hierarchyItems == null) { |
| 2587 hierarchyItems = <TypeHierarchyItem>[]; |
| 2588 } |
| 2589 } |
| 2503 | 2590 |
| 2504 factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | 2591 factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { |
| 2505 if (json == null) { | 2592 if (json == null) { |
| 2506 json = {}; | 2593 json = {}; |
| 2507 } | 2594 } |
| 2508 if (json is Map) { | 2595 if (json is Map) { |
| 2509 List<TypeHierarchyItem> hierarchyItems; | 2596 List<TypeHierarchyItem> hierarchyItems; |
| 2510 if (json.containsKey("hierarchyItems")) { | 2597 if (json.containsKey("hierarchyItems")) { |
| 2511 hierarchyItems = jsonDecoder._decodeList(jsonPath + ".hierarchyItems", j
son["hierarchyItems"], (String jsonPath, Object json) => new TypeHierarchyItem.f
romJson(jsonDecoder, jsonPath, json)); | 2598 hierarchyItems = jsonDecoder._decodeList(jsonPath + ".hierarchyItems", j
son["hierarchyItems"], (String jsonPath, Object json) => new TypeHierarchyItem.f
romJson(jsonDecoder, jsonPath, json)); |
| 2599 } else { |
| 2600 hierarchyItems = <TypeHierarchyItem>[]; |
| 2512 } | 2601 } |
| 2513 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); | 2602 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); |
| 2514 } else { | 2603 } else { |
| 2515 throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy result"); | 2604 throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy result"); |
| 2516 } | 2605 } |
| 2517 } | 2606 } |
| 2518 | 2607 |
| 2519 factory SearchGetTypeHierarchyResult.fromResponse(Response response) { | 2608 factory SearchGetTypeHierarchyResult.fromResponse(Response response) { |
| 2520 return new SearchGetTypeHierarchyResult.fromJson( | 2609 return new SearchGetTypeHierarchyResult.fromJson( |
| 2521 new ResponseDecoder(), "result", response.result); | 2610 new ResponseDecoder(), "result", response.result); |
| 2522 } | 2611 } |
| 2523 | 2612 |
| 2524 Map<String, dynamic> toJson() { | 2613 Map<String, dynamic> toJson() { |
| 2525 Map<String, dynamic> result = {}; | 2614 Map<String, dynamic> result = {}; |
| 2526 if (hierarchyItems != null) { | 2615 if (hierarchyItems.isNotEmpty) { |
| 2527 result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) =>
value.toJson()).toList(); | 2616 result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) =>
value.toJson()).toList(); |
| 2528 } | 2617 } |
| 2529 return result; | 2618 return result; |
| 2530 } | 2619 } |
| 2531 | 2620 |
| 2532 Response toResponse(String id) { | 2621 Response toResponse(String id) { |
| 2533 return new Response(id, result: toJson()); | 2622 return new Response(id, result: toJson()); |
| 2534 } | 2623 } |
| 2535 | 2624 |
| 2536 @override | 2625 @override |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2550 hash = _JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); | 2639 hash = _JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); |
| 2551 return _JenkinsSmiHash.finish(hash); | 2640 return _JenkinsSmiHash.finish(hash); |
| 2552 } | 2641 } |
| 2553 } | 2642 } |
| 2554 | 2643 |
| 2555 /** | 2644 /** |
| 2556 * search.results params | 2645 * search.results params |
| 2557 * | 2646 * |
| 2558 * { | 2647 * { |
| 2559 * "id": SearchId | 2648 * "id": SearchId |
| 2560 * "results": List<SearchResult> | 2649 * "results": optional List<SearchResult> |
| 2561 * "last": bool | 2650 * "last": bool |
| 2562 * } | 2651 * } |
| 2563 */ | 2652 */ |
| 2564 class SearchResultsParams implements HasToJson { | 2653 class SearchResultsParams implements HasToJson { |
| 2565 /** | 2654 /** |
| 2566 * The id associated with the search. | 2655 * The id associated with the search. |
| 2567 */ | 2656 */ |
| 2568 String id; | 2657 String id; |
| 2569 | 2658 |
| 2570 /** | 2659 /** |
| 2571 * The search results being reported. | 2660 * The search results being reported. |
| 2572 */ | 2661 */ |
| 2573 List<SearchResult> results; | 2662 List<SearchResult> results; |
| 2574 | 2663 |
| 2575 /** | 2664 /** |
| 2576 * True if this is that last set of results that will be returned for the | 2665 * True if this is that last set of results that will be returned for the |
| 2577 * indicated search. | 2666 * indicated search. |
| 2578 */ | 2667 */ |
| 2579 bool last; | 2668 bool last; |
| 2580 | 2669 |
| 2581 SearchResultsParams(this.id, this.results, this.last); | 2670 SearchResultsParams(this.id, this.last, {this.results}) { |
| 2671 if (results == null) { |
| 2672 results = <SearchResult>[]; |
| 2673 } |
| 2674 } |
| 2582 | 2675 |
| 2583 factory SearchResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | 2676 factory SearchResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { |
| 2584 if (json == null) { | 2677 if (json == null) { |
| 2585 json = {}; | 2678 json = {}; |
| 2586 } | 2679 } |
| 2587 if (json is Map) { | 2680 if (json is Map) { |
| 2588 String id; | 2681 String id; |
| 2589 if (json.containsKey("id")) { | 2682 if (json.containsKey("id")) { |
| 2590 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | 2683 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); |
| 2591 } else { | 2684 } else { |
| 2592 throw jsonDecoder.missingKey(jsonPath, "id"); | 2685 throw jsonDecoder.missingKey(jsonPath, "id"); |
| 2593 } | 2686 } |
| 2594 List<SearchResult> results; | 2687 List<SearchResult> results; |
| 2595 if (json.containsKey("results")) { | 2688 if (json.containsKey("results")) { |
| 2596 results = jsonDecoder._decodeList(jsonPath + ".results", json["results"]
, (String jsonPath, Object json) => new SearchResult.fromJson(jsonDecoder, jsonP
ath, json)); | 2689 results = jsonDecoder._decodeList(jsonPath + ".results", json["results"]
, (String jsonPath, Object json) => new SearchResult.fromJson(jsonDecoder, jsonP
ath, json)); |
| 2597 } else { | 2690 } else { |
| 2598 throw jsonDecoder.missingKey(jsonPath, "results"); | 2691 results = <SearchResult>[]; |
| 2599 } | 2692 } |
| 2600 bool last; | 2693 bool last; |
| 2601 if (json.containsKey("last")) { | 2694 if (json.containsKey("last")) { |
| 2602 last = jsonDecoder._decodeBool(jsonPath + ".last", json["last"]); | 2695 last = jsonDecoder._decodeBool(jsonPath + ".last", json["last"]); |
| 2603 } else { | 2696 } else { |
| 2604 throw jsonDecoder.missingKey(jsonPath, "last"); | 2697 throw jsonDecoder.missingKey(jsonPath, "last"); |
| 2605 } | 2698 } |
| 2606 return new SearchResultsParams(id, results, last); | 2699 return new SearchResultsParams(id, last, results: results); |
| 2607 } else { | 2700 } else { |
| 2608 throw jsonDecoder.mismatch(jsonPath, "search.results params"); | 2701 throw jsonDecoder.mismatch(jsonPath, "search.results params"); |
| 2609 } | 2702 } |
| 2610 } | 2703 } |
| 2611 | 2704 |
| 2612 factory SearchResultsParams.fromNotification(Notification notification) { | 2705 factory SearchResultsParams.fromNotification(Notification notification) { |
| 2613 return new SearchResultsParams.fromJson( | 2706 return new SearchResultsParams.fromJson( |
| 2614 new ResponseDecoder(), "params", notification.params); | 2707 new ResponseDecoder(), "params", notification.params); |
| 2615 } | 2708 } |
| 2616 | 2709 |
| 2617 Map<String, dynamic> toJson() { | 2710 Map<String, dynamic> toJson() { |
| 2618 Map<String, dynamic> result = {}; | 2711 Map<String, dynamic> result = {}; |
| 2619 result["id"] = id; | 2712 result["id"] = id; |
| 2620 result["results"] = results.map((SearchResult value) => value.toJson()).toLi
st(); | 2713 if (results.isNotEmpty) { |
| 2714 result["results"] = results.map((SearchResult value) => value.toJson()).to
List(); |
| 2715 } |
| 2621 result["last"] = last; | 2716 result["last"] = last; |
| 2622 return result; | 2717 return result; |
| 2623 } | 2718 } |
| 2624 | 2719 |
| 2625 @override | 2720 @override |
| 2626 String toString() => JSON.encode(toJson()); | 2721 String toString() => JSON.encode(toJson()); |
| 2627 | 2722 |
| 2628 @override | 2723 @override |
| 2629 bool operator==(other) { | 2724 bool operator==(other) { |
| 2630 if (other is SearchResultsParams) { | 2725 if (other is SearchResultsParams) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2738 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | 2833 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); |
| 2739 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | 2834 hash = _JenkinsSmiHash.combine(hash, length.hashCode); |
| 2740 return _JenkinsSmiHash.finish(hash); | 2835 return _JenkinsSmiHash.finish(hash); |
| 2741 } | 2836 } |
| 2742 } | 2837 } |
| 2743 | 2838 |
| 2744 /** | 2839 /** |
| 2745 * edit.getAssists result | 2840 * edit.getAssists result |
| 2746 * | 2841 * |
| 2747 * { | 2842 * { |
| 2748 * "assists": List<SourceChange> | 2843 * "assists": optional List<SourceChange> |
| 2749 * } | 2844 * } |
| 2750 */ | 2845 */ |
| 2751 class EditGetAssistsResult implements HasToJson { | 2846 class EditGetAssistsResult implements HasToJson { |
| 2752 /** | 2847 /** |
| 2753 * The assists that are available at the given location. | 2848 * The assists that are available at the given location. |
| 2754 */ | 2849 */ |
| 2755 List<SourceChange> assists; | 2850 List<SourceChange> assists; |
| 2756 | 2851 |
| 2757 EditGetAssistsResult(this.assists); | 2852 EditGetAssistsResult({this.assists}) { |
| 2853 if (assists == null) { |
| 2854 assists = <SourceChange>[]; |
| 2855 } |
| 2856 } |
| 2758 | 2857 |
| 2759 factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | 2858 factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { |
| 2760 if (json == null) { | 2859 if (json == null) { |
| 2761 json = {}; | 2860 json = {}; |
| 2762 } | 2861 } |
| 2763 if (json is Map) { | 2862 if (json is Map) { |
| 2764 List<SourceChange> assists; | 2863 List<SourceChange> assists; |
| 2765 if (json.containsKey("assists")) { | 2864 if (json.containsKey("assists")) { |
| 2766 assists = jsonDecoder._decodeList(jsonPath + ".assists", json["assists"]
, (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonP
ath, json)); | 2865 assists = jsonDecoder._decodeList(jsonPath + ".assists", json["assists"]
, (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonP
ath, json)); |
| 2767 } else { | 2866 } else { |
| 2768 throw jsonDecoder.missingKey(jsonPath, "assists"); | 2867 assists = <SourceChange>[]; |
| 2769 } | 2868 } |
| 2770 return new EditGetAssistsResult(assists); | 2869 return new EditGetAssistsResult(assists: assists); |
| 2771 } else { | 2870 } else { |
| 2772 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result"); | 2871 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result"); |
| 2773 } | 2872 } |
| 2774 } | 2873 } |
| 2775 | 2874 |
| 2776 factory EditGetAssistsResult.fromResponse(Response response) { | 2875 factory EditGetAssistsResult.fromResponse(Response response) { |
| 2777 return new EditGetAssistsResult.fromJson( | 2876 return new EditGetAssistsResult.fromJson( |
| 2778 new ResponseDecoder(), "result", response.result); | 2877 new ResponseDecoder(), "result", response.result); |
| 2779 } | 2878 } |
| 2780 | 2879 |
| 2781 Map<String, dynamic> toJson() { | 2880 Map<String, dynamic> toJson() { |
| 2782 Map<String, dynamic> result = {}; | 2881 Map<String, dynamic> result = {}; |
| 2783 result["assists"] = assists.map((SourceChange value) => value.toJson()).toLi
st(); | 2882 if (assists.isNotEmpty) { |
| 2883 result["assists"] = assists.map((SourceChange value) => value.toJson()).to
List(); |
| 2884 } |
| 2784 return result; | 2885 return result; |
| 2785 } | 2886 } |
| 2786 | 2887 |
| 2787 Response toResponse(String id) { | 2888 Response toResponse(String id) { |
| 2788 return new Response(id, result: toJson()); | 2889 return new Response(id, result: toJson()); |
| 2789 } | 2890 } |
| 2790 | 2891 |
| 2791 @override | 2892 @override |
| 2792 String toString() => JSON.encode(toJson()); | 2893 String toString() => JSON.encode(toJson()); |
| 2793 | 2894 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2900 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | 3001 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); |
| 2901 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | 3002 hash = _JenkinsSmiHash.combine(hash, length.hashCode); |
| 2902 return _JenkinsSmiHash.finish(hash); | 3003 return _JenkinsSmiHash.finish(hash); |
| 2903 } | 3004 } |
| 2904 } | 3005 } |
| 2905 | 3006 |
| 2906 /** | 3007 /** |
| 2907 * edit.getAvailableRefactorings result | 3008 * edit.getAvailableRefactorings result |
| 2908 * | 3009 * |
| 2909 * { | 3010 * { |
| 2910 * "kinds": List<RefactoringKind> | 3011 * "kinds": optional List<RefactoringKind> |
| 2911 * } | 3012 * } |
| 2912 */ | 3013 */ |
| 2913 class EditGetAvailableRefactoringsResult implements HasToJson { | 3014 class EditGetAvailableRefactoringsResult implements HasToJson { |
| 2914 /** | 3015 /** |
| 2915 * The kinds of refactorings that are valid for the given selection. | 3016 * The kinds of refactorings that are valid for the given selection. |
| 2916 */ | 3017 */ |
| 2917 List<RefactoringKind> kinds; | 3018 List<RefactoringKind> kinds; |
| 2918 | 3019 |
| 2919 EditGetAvailableRefactoringsResult(this.kinds); | 3020 EditGetAvailableRefactoringsResult({this.kinds}) { |
| 3021 if (kinds == null) { |
| 3022 kinds = <RefactoringKind>[]; |
| 3023 } |
| 3024 } |
| 2920 | 3025 |
| 2921 factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, S
tring jsonPath, Object json) { | 3026 factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, S
tring jsonPath, Object json) { |
| 2922 if (json == null) { | 3027 if (json == null) { |
| 2923 json = {}; | 3028 json = {}; |
| 2924 } | 3029 } |
| 2925 if (json is Map) { | 3030 if (json is Map) { |
| 2926 List<RefactoringKind> kinds; | 3031 List<RefactoringKind> kinds; |
| 2927 if (json.containsKey("kinds")) { | 3032 if (json.containsKey("kinds")) { |
| 2928 kinds = jsonDecoder._decodeList(jsonPath + ".kinds", json["kinds"], (Str
ing jsonPath, Object json) => new RefactoringKind.fromJson(jsonDecoder, jsonPath
, json)); | 3033 kinds = jsonDecoder._decodeList(jsonPath + ".kinds", json["kinds"], (Str
ing jsonPath, Object json) => new RefactoringKind.fromJson(jsonDecoder, jsonPath
, json)); |
| 2929 } else { | 3034 } else { |
| 2930 throw jsonDecoder.missingKey(jsonPath, "kinds"); | 3035 kinds = <RefactoringKind>[]; |
| 2931 } | 3036 } |
| 2932 return new EditGetAvailableRefactoringsResult(kinds); | 3037 return new EditGetAvailableRefactoringsResult(kinds: kinds); |
| 2933 } else { | 3038 } else { |
| 2934 throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings result
"); | 3039 throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings result
"); |
| 2935 } | 3040 } |
| 2936 } | 3041 } |
| 2937 | 3042 |
| 2938 factory EditGetAvailableRefactoringsResult.fromResponse(Response response) { | 3043 factory EditGetAvailableRefactoringsResult.fromResponse(Response response) { |
| 2939 return new EditGetAvailableRefactoringsResult.fromJson( | 3044 return new EditGetAvailableRefactoringsResult.fromJson( |
| 2940 new ResponseDecoder(), "result", response.result); | 3045 new ResponseDecoder(), "result", response.result); |
| 2941 } | 3046 } |
| 2942 | 3047 |
| 2943 Map<String, dynamic> toJson() { | 3048 Map<String, dynamic> toJson() { |
| 2944 Map<String, dynamic> result = {}; | 3049 Map<String, dynamic> result = {}; |
| 2945 result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()).toLis
t(); | 3050 if (kinds.isNotEmpty) { |
| 3051 result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()).toL
ist(); |
| 3052 } |
| 2946 return result; | 3053 return result; |
| 2947 } | 3054 } |
| 2948 | 3055 |
| 2949 Response toResponse(String id) { | 3056 Response toResponse(String id) { |
| 2950 return new Response(id, result: toJson()); | 3057 return new Response(id, result: toJson()); |
| 2951 } | 3058 } |
| 2952 | 3059 |
| 2953 @override | 3060 @override |
| 2954 String toString() => JSON.encode(toJson()); | 3061 String toString() => JSON.encode(toJson()); |
| 2955 | 3062 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3047 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 3154 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 3048 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | 3155 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); |
| 3049 return _JenkinsSmiHash.finish(hash); | 3156 return _JenkinsSmiHash.finish(hash); |
| 3050 } | 3157 } |
| 3051 } | 3158 } |
| 3052 | 3159 |
| 3053 /** | 3160 /** |
| 3054 * edit.getFixes result | 3161 * edit.getFixes result |
| 3055 * | 3162 * |
| 3056 * { | 3163 * { |
| 3057 * "fixes": List<ErrorFixes> | 3164 * "fixes": optional List<ErrorFixes> |
| 3058 * } | 3165 * } |
| 3059 */ | 3166 */ |
| 3060 class EditGetFixesResult implements HasToJson { | 3167 class EditGetFixesResult implements HasToJson { |
| 3061 /** | 3168 /** |
| 3062 * The fixes that are available for each of the analysis errors. There is a | 3169 * The fixes that are available for each of the analysis errors. There is a |
| 3063 * one-to-one correspondence between the analysis errors in the request and | 3170 * one-to-one correspondence between the analysis errors in the request and |
| 3064 * the lists of changes in the response. In particular, it is always the case | 3171 * the lists of changes in the response. In particular, it is always the case |
| 3065 * that errors.length == fixes.length and that fixes[i] is the list of fixes | 3172 * that errors.length == fixes.length and that fixes[i] is the list of fixes |
| 3066 * for the error in errors[i]. The list of changes corresponding to an error | 3173 * for the error in errors[i]. The list of changes corresponding to an error |
| 3067 * can be empty if there are no fixes available for that error. | 3174 * can be empty if there are no fixes available for that error. |
| 3068 */ | 3175 */ |
| 3069 List<ErrorFixes> fixes; | 3176 List<ErrorFixes> fixes; |
| 3070 | 3177 |
| 3071 EditGetFixesResult(this.fixes); | 3178 EditGetFixesResult({this.fixes}) { |
| 3179 if (fixes == null) { |
| 3180 fixes = <ErrorFixes>[]; |
| 3181 } |
| 3182 } |
| 3072 | 3183 |
| 3073 factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | 3184 factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { |
| 3074 if (json == null) { | 3185 if (json == null) { |
| 3075 json = {}; | 3186 json = {}; |
| 3076 } | 3187 } |
| 3077 if (json is Map) { | 3188 if (json is Map) { |
| 3078 List<ErrorFixes> fixes; | 3189 List<ErrorFixes> fixes; |
| 3079 if (json.containsKey("fixes")) { | 3190 if (json.containsKey("fixes")) { |
| 3080 fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (Str
ing jsonPath, Object json) => new ErrorFixes.fromJson(jsonDecoder, jsonPath, jso
n)); | 3191 fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (Str
ing jsonPath, Object json) => new ErrorFixes.fromJson(jsonDecoder, jsonPath, jso
n)); |
| 3081 } else { | 3192 } else { |
| 3082 throw jsonDecoder.missingKey(jsonPath, "fixes"); | 3193 fixes = <ErrorFixes>[]; |
| 3083 } | 3194 } |
| 3084 return new EditGetFixesResult(fixes); | 3195 return new EditGetFixesResult(fixes: fixes); |
| 3085 } else { | 3196 } else { |
| 3086 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result"); | 3197 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result"); |
| 3087 } | 3198 } |
| 3088 } | 3199 } |
| 3089 | 3200 |
| 3090 factory EditGetFixesResult.fromResponse(Response response) { | 3201 factory EditGetFixesResult.fromResponse(Response response) { |
| 3091 return new EditGetFixesResult.fromJson( | 3202 return new EditGetFixesResult.fromJson( |
| 3092 new ResponseDecoder(), "result", response.result); | 3203 new ResponseDecoder(), "result", response.result); |
| 3093 } | 3204 } |
| 3094 | 3205 |
| 3095 Map<String, dynamic> toJson() { | 3206 Map<String, dynamic> toJson() { |
| 3096 Map<String, dynamic> result = {}; | 3207 Map<String, dynamic> result = {}; |
| 3097 result["fixes"] = fixes.map((ErrorFixes value) => value.toJson()).toList(); | 3208 if (fixes.isNotEmpty) { |
| 3209 result["fixes"] = fixes.map((ErrorFixes value) => value.toJson()).toList()
; |
| 3210 } |
| 3098 return result; | 3211 return result; |
| 3099 } | 3212 } |
| 3100 | 3213 |
| 3101 Response toResponse(String id) { | 3214 Response toResponse(String id) { |
| 3102 return new Response(id, result: toJson()); | 3215 return new Response(id, result: toJson()); |
| 3103 } | 3216 } |
| 3104 | 3217 |
| 3105 @override | 3218 @override |
| 3106 String toString() => JSON.encode(toJson()); | 3219 String toString() => JSON.encode(toJson()); |
| 3107 | 3220 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3264 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); | 3377 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); |
| 3265 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | 3378 hash = _JenkinsSmiHash.combine(hash, options.hashCode); |
| 3266 return _JenkinsSmiHash.finish(hash); | 3379 return _JenkinsSmiHash.finish(hash); |
| 3267 } | 3380 } |
| 3268 } | 3381 } |
| 3269 | 3382 |
| 3270 /** | 3383 /** |
| 3271 * edit.getRefactoring result | 3384 * edit.getRefactoring result |
| 3272 * | 3385 * |
| 3273 * { | 3386 * { |
| 3274 * "status": List<RefactoringProblem> | 3387 * "status": optional List<RefactoringProblem> |
| 3275 * "feedback": optional object | 3388 * "feedback": optional object |
| 3276 * "change": optional SourceChange | 3389 * "change": optional SourceChange |
| 3277 * "potentialEdits": optional List<String> | 3390 * "potentialEdits": optional List<String> |
| 3278 * } | 3391 * } |
| 3279 */ | 3392 */ |
| 3280 class EditGetRefactoringResult implements HasToJson { | 3393 class EditGetRefactoringResult implements HasToJson { |
| 3281 /** | 3394 /** |
| 3282 * The status of the refactoring. The array will be empty if there are no | 3395 * The status of the refactoring. The array will be empty if there are no |
| 3283 * known problems. | 3396 * known problems. |
| 3284 */ | 3397 */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3303 /** | 3416 /** |
| 3304 * The ids of source edits that are not known to be valid. An edit is not | 3417 * 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 | 3418 * 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 | 3419 * 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 | 3420 * 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 | 3421 * 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. | 3422 * field is omitted or if there are no potential edits for the refactoring. |
| 3310 */ | 3423 */ |
| 3311 List<String> potentialEdits; | 3424 List<String> potentialEdits; |
| 3312 | 3425 |
| 3313 EditGetRefactoringResult(this.status, {this.feedback, this.change, this.potent
ialEdits}); | 3426 EditGetRefactoringResult({this.status, this.feedback, this.change, this.potent
ialEdits}) { |
| 3427 if (status == null) { |
| 3428 status = <RefactoringProblem>[]; |
| 3429 } |
| 3430 if (potentialEdits == null) { |
| 3431 potentialEdits = <String>[]; |
| 3432 } |
| 3433 } |
| 3314 | 3434 |
| 3315 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | 3435 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { |
| 3316 if (json == null) { | 3436 if (json == null) { |
| 3317 json = {}; | 3437 json = {}; |
| 3318 } | 3438 } |
| 3319 if (json is Map) { | 3439 if (json is Map) { |
| 3320 List<RefactoringProblem> status; | 3440 List<RefactoringProblem> status; |
| 3321 if (json.containsKey("status")) { | 3441 if (json.containsKey("status")) { |
| 3322 status = jsonDecoder._decodeList(jsonPath + ".status", json["status"], (
String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, js
onPath, json)); | 3442 status = jsonDecoder._decodeList(jsonPath + ".status", json["status"], (
String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, js
onPath, json)); |
| 3323 } else { | 3443 } else { |
| 3324 throw jsonDecoder.missingKey(jsonPath, "status"); | 3444 status = <RefactoringProblem>[]; |
| 3325 } | 3445 } |
| 3326 Object feedback; | 3446 Object feedback; |
| 3327 if (json.containsKey("feedback")) { | 3447 if (json.containsKey("feedback")) { |
| 3328 feedback = json["feedback"]; | 3448 feedback = json["feedback"]; |
| 3329 } | 3449 } |
| 3330 SourceChange change; | 3450 SourceChange change; |
| 3331 if (json.containsKey("change")) { | 3451 if (json.containsKey("change")) { |
| 3332 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); | 3452 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); |
| 3333 } | 3453 } |
| 3334 List<String> potentialEdits; | 3454 List<String> potentialEdits; |
| 3335 if (json.containsKey("potentialEdits")) { | 3455 if (json.containsKey("potentialEdits")) { |
| 3336 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); | 3456 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); |
| 3457 } else { |
| 3458 potentialEdits = <String>[]; |
| 3337 } | 3459 } |
| 3338 return new EditGetRefactoringResult(status, feedback: feedback, change: ch
ange, potentialEdits: potentialEdits); | 3460 return new EditGetRefactoringResult(status: status, feedback: feedback, ch
ange: change, potentialEdits: potentialEdits); |
| 3339 } else { | 3461 } else { |
| 3340 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result"); | 3462 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result"); |
| 3341 } | 3463 } |
| 3342 } | 3464 } |
| 3343 | 3465 |
| 3344 factory EditGetRefactoringResult.fromResponse(Response response) { | 3466 factory EditGetRefactoringResult.fromResponse(Response response) { |
| 3345 return new EditGetRefactoringResult.fromJson( | 3467 return new EditGetRefactoringResult.fromJson( |
| 3346 new ResponseDecoder(), "result", response.result); | 3468 new ResponseDecoder(), "result", response.result); |
| 3347 } | 3469 } |
| 3348 | 3470 |
| 3349 Map<String, dynamic> toJson() { | 3471 Map<String, dynamic> toJson() { |
| 3350 Map<String, dynamic> result = {}; | 3472 Map<String, dynamic> result = {}; |
| 3351 result["status"] = status.map((RefactoringProblem value) => value.toJson()).
toList(); | 3473 if (status.isNotEmpty) { |
| 3474 result["status"] = status.map((RefactoringProblem value) => value.toJson()
).toList(); |
| 3475 } |
| 3352 if (feedback != null) { | 3476 if (feedback != null) { |
| 3353 result["feedback"] = feedback; | 3477 result["feedback"] = feedback; |
| 3354 } | 3478 } |
| 3355 if (change != null) { | 3479 if (change != null) { |
| 3356 result["change"] = change.toJson(); | 3480 result["change"] = change.toJson(); |
| 3357 } | 3481 } |
| 3358 if (potentialEdits != null) { | 3482 if (potentialEdits.isNotEmpty) { |
| 3359 result["potentialEdits"] = potentialEdits; | 3483 result["potentialEdits"] = potentialEdits; |
| 3360 } | 3484 } |
| 3361 return result; | 3485 return result; |
| 3362 } | 3486 } |
| 3363 | 3487 |
| 3364 Response toResponse(String id) { | 3488 Response toResponse(String id) { |
| 3365 return new Response(id, result: toJson()); | 3489 return new Response(id, result: toJson()); |
| 3366 } | 3490 } |
| 3367 | 3491 |
| 3368 @override | 3492 @override |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3764 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 3888 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 3765 hash = _JenkinsSmiHash.combine(hash, uri.hashCode); | 3889 hash = _JenkinsSmiHash.combine(hash, uri.hashCode); |
| 3766 return _JenkinsSmiHash.finish(hash); | 3890 return _JenkinsSmiHash.finish(hash); |
| 3767 } | 3891 } |
| 3768 } | 3892 } |
| 3769 | 3893 |
| 3770 /** | 3894 /** |
| 3771 * debug.setSubscriptions params | 3895 * debug.setSubscriptions params |
| 3772 * | 3896 * |
| 3773 * { | 3897 * { |
| 3774 * "subscriptions": List<DebugService> | 3898 * "subscriptions": optional List<DebugService> |
| 3775 * } | 3899 * } |
| 3776 */ | 3900 */ |
| 3777 class DebugSetSubscriptionsParams implements HasToJson { | 3901 class DebugSetSubscriptionsParams implements HasToJson { |
| 3778 /** | 3902 /** |
| 3779 * A list of the services being subscribed to. | 3903 * A list of the services being subscribed to. |
| 3780 */ | 3904 */ |
| 3781 List<DebugService> subscriptions; | 3905 List<DebugService> subscriptions; |
| 3782 | 3906 |
| 3783 DebugSetSubscriptionsParams(this.subscriptions); | 3907 DebugSetSubscriptionsParams({this.subscriptions}) { |
| 3908 if (subscriptions == null) { |
| 3909 subscriptions = <DebugService>[]; |
| 3910 } |
| 3911 } |
| 3784 | 3912 |
| 3785 factory DebugSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | 3913 factory DebugSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { |
| 3786 if (json == null) { | 3914 if (json == null) { |
| 3787 json = {}; | 3915 json = {}; |
| 3788 } | 3916 } |
| 3789 if (json is Map) { | 3917 if (json is Map) { |
| 3790 List<DebugService> subscriptions; | 3918 List<DebugService> subscriptions; |
| 3791 if (json.containsKey("subscriptions")) { | 3919 if (json.containsKey("subscriptions")) { |
| 3792 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new DebugService.fromJson(
jsonDecoder, jsonPath, json)); | 3920 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new DebugService.fromJson(
jsonDecoder, jsonPath, json)); |
| 3793 } else { | 3921 } else { |
| 3794 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | 3922 subscriptions = <DebugService>[]; |
| 3795 } | 3923 } |
| 3796 return new DebugSetSubscriptionsParams(subscriptions); | 3924 return new DebugSetSubscriptionsParams(subscriptions: subscriptions); |
| 3797 } else { | 3925 } else { |
| 3798 throw jsonDecoder.mismatch(jsonPath, "debug.setSubscriptions params"); | 3926 throw jsonDecoder.mismatch(jsonPath, "debug.setSubscriptions params"); |
| 3799 } | 3927 } |
| 3800 } | 3928 } |
| 3801 | 3929 |
| 3802 factory DebugSetSubscriptionsParams.fromRequest(Request request) { | 3930 factory DebugSetSubscriptionsParams.fromRequest(Request request) { |
| 3803 return new DebugSetSubscriptionsParams.fromJson( | 3931 return new DebugSetSubscriptionsParams.fromJson( |
| 3804 new RequestDecoder(request), "params", request.params); | 3932 new RequestDecoder(request), "params", request.params); |
| 3805 } | 3933 } |
| 3806 | 3934 |
| 3807 Map<String, dynamic> toJson() { | 3935 Map<String, dynamic> toJson() { |
| 3808 Map<String, dynamic> result = {}; | 3936 Map<String, dynamic> result = {}; |
| 3809 result["subscriptions"] = subscriptions.map((DebugService value) => value.to
Json()).toList(); | 3937 if (subscriptions.isNotEmpty) { |
| 3938 result["subscriptions"] = subscriptions.map((DebugService value) => value.
toJson()).toList(); |
| 3939 } |
| 3810 return result; | 3940 return result; |
| 3811 } | 3941 } |
| 3812 | 3942 |
| 3813 Request toRequest(String id) { | 3943 Request toRequest(String id) { |
| 3814 return new Request(id, "debug.setSubscriptions", toJson()); | 3944 return new Request(id, "debug.setSubscriptions", toJson()); |
| 3815 } | 3945 } |
| 3816 | 3946 |
| 3817 @override | 3947 @override |
| 3818 String toString() => JSON.encode(toJson()); | 3948 String toString() => JSON.encode(toJson()); |
| 3819 | 3949 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3830 int hash = 0; | 3960 int hash = 0; |
| 3831 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | 3961 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); |
| 3832 return _JenkinsSmiHash.finish(hash); | 3962 return _JenkinsSmiHash.finish(hash); |
| 3833 } | 3963 } |
| 3834 } | 3964 } |
| 3835 | 3965 |
| 3836 /** | 3966 /** |
| 3837 * debug.launchData params | 3967 * debug.launchData params |
| 3838 * | 3968 * |
| 3839 * { | 3969 * { |
| 3840 * "executables": List<ExecutableFile> | 3970 * "executables": optional List<ExecutableFile> |
| 3841 * "dartToHtml": Map<FilePath, List<FilePath>> | 3971 * "dartToHtml": Map<FilePath, List<FilePath>> |
| 3842 * "htmlToDart": Map<FilePath, List<FilePath>> | 3972 * "htmlToDart": Map<FilePath, List<FilePath>> |
| 3843 * } | 3973 * } |
| 3844 */ | 3974 */ |
| 3845 class DebugLaunchDataParams implements HasToJson { | 3975 class DebugLaunchDataParams implements HasToJson { |
| 3846 /** | 3976 /** |
| 3847 * A list of the files that are executable in the given context. This list | 3977 * A list of the files that are executable in the given context. This list |
| 3848 * replaces any previous list provided for the given context. | 3978 * replaces any previous list provided for the given context. |
| 3849 */ | 3979 */ |
| 3850 List<ExecutableFile> executables; | 3980 List<ExecutableFile> executables; |
| 3851 | 3981 |
| 3852 /** | 3982 /** |
| 3853 * A mapping from the paths of Dart files that are referenced by HTML files | 3983 * A mapping from the paths of Dart files that are referenced by HTML files |
| 3854 * to a list of the HTML files that reference the Dart files. | 3984 * to a list of the HTML files that reference the Dart files. |
| 3855 */ | 3985 */ |
| 3856 Map<String, List<String>> dartToHtml; | 3986 Map<String, List<String>> dartToHtml; |
| 3857 | 3987 |
| 3858 /** | 3988 /** |
| 3859 * A mapping from the paths of HTML files that reference Dart files to a list | 3989 * A mapping from the paths of HTML files that reference Dart files to a list |
| 3860 * of the Dart files they reference. | 3990 * of the Dart files they reference. |
| 3861 */ | 3991 */ |
| 3862 Map<String, List<String>> htmlToDart; | 3992 Map<String, List<String>> htmlToDart; |
| 3863 | 3993 |
| 3864 DebugLaunchDataParams(this.executables, this.dartToHtml, this.htmlToDart); | 3994 DebugLaunchDataParams(this.dartToHtml, this.htmlToDart, {this.executables}) { |
| 3995 if (executables == null) { |
| 3996 executables = <ExecutableFile>[]; |
| 3997 } |
| 3998 } |
| 3865 | 3999 |
| 3866 factory DebugLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | 4000 factory DebugLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { |
| 3867 if (json == null) { | 4001 if (json == null) { |
| 3868 json = {}; | 4002 json = {}; |
| 3869 } | 4003 } |
| 3870 if (json is Map) { | 4004 if (json is Map) { |
| 3871 List<ExecutableFile> executables; | 4005 List<ExecutableFile> executables; |
| 3872 if (json.containsKey("executables")) { | 4006 if (json.containsKey("executables")) { |
| 3873 executables = jsonDecoder._decodeList(jsonPath + ".executables", json["e
xecutables"], (String jsonPath, Object json) => new ExecutableFile.fromJson(json
Decoder, jsonPath, json)); | 4007 executables = jsonDecoder._decodeList(jsonPath + ".executables", json["e
xecutables"], (String jsonPath, Object json) => new ExecutableFile.fromJson(json
Decoder, jsonPath, json)); |
| 3874 } else { | 4008 } else { |
| 3875 throw jsonDecoder.missingKey(jsonPath, "executables"); | 4009 executables = <ExecutableFile>[]; |
| 3876 } | 4010 } |
| 3877 Map<String, List<String>> dartToHtml; | 4011 Map<String, List<String>> dartToHtml; |
| 3878 if (json.containsKey("dartToHtml")) { | 4012 if (json.containsKey("dartToHtml")) { |
| 3879 dartToHtml = jsonDecoder._decodeMap(jsonPath + ".dartToHtml", json["dart
ToHtml"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeLis
t(jsonPath, json, jsonDecoder._decodeString)); | 4013 dartToHtml = jsonDecoder._decodeMap(jsonPath + ".dartToHtml", json["dart
ToHtml"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeLis
t(jsonPath, json, jsonDecoder._decodeString)); |
| 3880 } else { | 4014 } else { |
| 3881 throw jsonDecoder.missingKey(jsonPath, "dartToHtml"); | 4015 throw jsonDecoder.missingKey(jsonPath, "dartToHtml"); |
| 3882 } | 4016 } |
| 3883 Map<String, List<String>> htmlToDart; | 4017 Map<String, List<String>> htmlToDart; |
| 3884 if (json.containsKey("htmlToDart")) { | 4018 if (json.containsKey("htmlToDart")) { |
| 3885 htmlToDart = jsonDecoder._decodeMap(jsonPath + ".htmlToDart", json["html
ToDart"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeLis
t(jsonPath, json, jsonDecoder._decodeString)); | 4019 htmlToDart = jsonDecoder._decodeMap(jsonPath + ".htmlToDart", json["html
ToDart"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeLis
t(jsonPath, json, jsonDecoder._decodeString)); |
| 3886 } else { | 4020 } else { |
| 3887 throw jsonDecoder.missingKey(jsonPath, "htmlToDart"); | 4021 throw jsonDecoder.missingKey(jsonPath, "htmlToDart"); |
| 3888 } | 4022 } |
| 3889 return new DebugLaunchDataParams(executables, dartToHtml, htmlToDart); | 4023 return new DebugLaunchDataParams(dartToHtml, htmlToDart, executables: exec
utables); |
| 3890 } else { | 4024 } else { |
| 3891 throw jsonDecoder.mismatch(jsonPath, "debug.launchData params"); | 4025 throw jsonDecoder.mismatch(jsonPath, "debug.launchData params"); |
| 3892 } | 4026 } |
| 3893 } | 4027 } |
| 3894 | 4028 |
| 3895 factory DebugLaunchDataParams.fromNotification(Notification notification) { | 4029 factory DebugLaunchDataParams.fromNotification(Notification notification) { |
| 3896 return new DebugLaunchDataParams.fromJson( | 4030 return new DebugLaunchDataParams.fromJson( |
| 3897 new ResponseDecoder(), "params", notification.params); | 4031 new ResponseDecoder(), "params", notification.params); |
| 3898 } | 4032 } |
| 3899 | 4033 |
| 3900 Map<String, dynamic> toJson() { | 4034 Map<String, dynamic> toJson() { |
| 3901 Map<String, dynamic> result = {}; | 4035 Map<String, dynamic> result = {}; |
| 3902 result["executables"] = executables.map((ExecutableFile value) => value.toJs
on()).toList(); | 4036 if (executables.isNotEmpty) { |
| 4037 result["executables"] = executables.map((ExecutableFile value) => value.to
Json()).toList(); |
| 4038 } |
| 3903 result["dartToHtml"] = dartToHtml; | 4039 result["dartToHtml"] = dartToHtml; |
| 3904 result["htmlToDart"] = htmlToDart; | 4040 result["htmlToDart"] = htmlToDart; |
| 3905 return result; | 4041 return result; |
| 3906 } | 4042 } |
| 3907 | 4043 |
| 3908 @override | 4044 @override |
| 3909 String toString() => JSON.encode(toJson()); | 4045 String toString() => JSON.encode(toJson()); |
| 3910 | 4046 |
| 3911 @override | 4047 @override |
| 3912 bool operator==(other) { | 4048 bool operator==(other) { |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4372 hash = _JenkinsSmiHash.combine(hash, analysisTarget.hashCode); | 4508 hash = _JenkinsSmiHash.combine(hash, analysisTarget.hashCode); |
| 4373 return _JenkinsSmiHash.finish(hash); | 4509 return _JenkinsSmiHash.finish(hash); |
| 4374 } | 4510 } |
| 4375 } | 4511 } |
| 4376 | 4512 |
| 4377 /** | 4513 /** |
| 4378 * ChangeContentOverlay | 4514 * ChangeContentOverlay |
| 4379 * | 4515 * |
| 4380 * { | 4516 * { |
| 4381 * "type": "change" | 4517 * "type": "change" |
| 4382 * "edits": List<SourceEdit> | 4518 * "edits": optional List<SourceEdit> |
| 4383 * } | 4519 * } |
| 4384 */ | 4520 */ |
| 4385 class ChangeContentOverlay implements HasToJson { | 4521 class ChangeContentOverlay implements HasToJson { |
| 4386 /** | 4522 /** |
| 4387 * The edits to be applied to the file. | 4523 * The edits to be applied to the file. |
| 4388 */ | 4524 */ |
| 4389 List<SourceEdit> edits; | 4525 List<SourceEdit> edits; |
| 4390 | 4526 |
| 4391 ChangeContentOverlay(this.edits); | 4527 ChangeContentOverlay({this.edits}) { |
| 4528 if (edits == null) { |
| 4529 edits = <SourceEdit>[]; |
| 4530 } |
| 4531 } |
| 4392 | 4532 |
| 4393 factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | 4533 factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { |
| 4394 if (json == null) { | 4534 if (json == null) { |
| 4395 json = {}; | 4535 json = {}; |
| 4396 } | 4536 } |
| 4397 if (json is Map) { | 4537 if (json is Map) { |
| 4398 if (json["type"] != "change") { | 4538 if (json["type"] != "change") { |
| 4399 throw jsonDecoder.mismatch(jsonPath, "equal " + "change"); | 4539 throw jsonDecoder.mismatch(jsonPath, "equal " + "change"); |
| 4400 } | 4540 } |
| 4401 List<SourceEdit> edits; | 4541 List<SourceEdit> edits; |
| 4402 if (json.containsKey("edits")) { | 4542 if (json.containsKey("edits")) { |
| 4403 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); | 4543 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); |
| 4404 } else { | 4544 } else { |
| 4405 throw jsonDecoder.missingKey(jsonPath, "edits"); | 4545 edits = <SourceEdit>[]; |
| 4406 } | 4546 } |
| 4407 return new ChangeContentOverlay(edits); | 4547 return new ChangeContentOverlay(edits: edits); |
| 4408 } else { | 4548 } else { |
| 4409 throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay"); | 4549 throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay"); |
| 4410 } | 4550 } |
| 4411 } | 4551 } |
| 4412 | 4552 |
| 4413 Map<String, dynamic> toJson() { | 4553 Map<String, dynamic> toJson() { |
| 4414 Map<String, dynamic> result = {}; | 4554 Map<String, dynamic> result = {}; |
| 4415 result["type"] = "change"; | 4555 result["type"] = "change"; |
| 4416 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | 4556 if (edits.isNotEmpty) { |
| 4557 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList()
; |
| 4558 } |
| 4417 return result; | 4559 return result; |
| 4418 } | 4560 } |
| 4419 | 4561 |
| 4420 @override | 4562 @override |
| 4421 String toString() => JSON.encode(toJson()); | 4563 String toString() => JSON.encode(toJson()); |
| 4422 | 4564 |
| 4423 @override | 4565 @override |
| 4424 bool operator==(other) { | 4566 bool operator==(other) { |
| 4425 if (other is ChangeContentOverlay) { | 4567 if (other is ChangeContentOverlay) { |
| 4426 return _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a ==
b); | 4568 return _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a ==
b); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4607 * argument list. | 4749 * argument list. |
| 4608 */ | 4750 */ |
| 4609 String parameterName; | 4751 String parameterName; |
| 4610 | 4752 |
| 4611 /** | 4753 /** |
| 4612 * The type of the options parameter being suggested. This field is omitted | 4754 * The type of the options parameter being suggested. This field is omitted |
| 4613 * if the parameterName field is omitted. | 4755 * if the parameterName field is omitted. |
| 4614 */ | 4756 */ |
| 4615 String parameterType; | 4757 String parameterType; |
| 4616 | 4758 |
| 4617 CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectio
nOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSum
mary, this.docComplete, this.declaringType, this.returnType, this.parameterNames
, this.parameterTypes, this.requiredParameterCount, this.positionalParameterCoun
t, this.parameterName, this.parameterType}); | 4759 CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectio
nOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSum
mary, this.docComplete, this.declaringType, this.returnType, this.parameterNames
, this.parameterTypes, this.requiredParameterCount, this.positionalParameterCoun
t, this.parameterName, this.parameterType}) { |
| 4760 if (parameterNames == null) { |
| 4761 parameterNames = <String>[]; |
| 4762 } |
| 4763 if (parameterTypes == null) { |
| 4764 parameterTypes = <String>[]; |
| 4765 } |
| 4766 } |
| 4618 | 4767 |
| 4619 factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | 4768 factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { |
| 4620 if (json == null) { | 4769 if (json == null) { |
| 4621 json = {}; | 4770 json = {}; |
| 4622 } | 4771 } |
| 4623 if (json is Map) { | 4772 if (json is Map) { |
| 4624 CompletionSuggestionKind kind; | 4773 CompletionSuggestionKind kind; |
| 4625 if (json.containsKey("kind")) { | 4774 if (json.containsKey("kind")) { |
| 4626 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k
ind", json["kind"]); | 4775 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k
ind", json["kind"]); |
| 4627 } else { | 4776 } else { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4675 if (json.containsKey("declaringType")) { | 4824 if (json.containsKey("declaringType")) { |
| 4676 declaringType = jsonDecoder._decodeString(jsonPath + ".declaringType", j
son["declaringType"]); | 4825 declaringType = jsonDecoder._decodeString(jsonPath + ".declaringType", j
son["declaringType"]); |
| 4677 } | 4826 } |
| 4678 String returnType; | 4827 String returnType; |
| 4679 if (json.containsKey("returnType")) { | 4828 if (json.containsKey("returnType")) { |
| 4680 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | 4829 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); |
| 4681 } | 4830 } |
| 4682 List<String> parameterNames; | 4831 List<String> parameterNames; |
| 4683 if (json.containsKey("parameterNames")) { | 4832 if (json.containsKey("parameterNames")) { |
| 4684 parameterNames = jsonDecoder._decodeList(jsonPath + ".parameterNames", j
son["parameterNames"], jsonDecoder._decodeString); | 4833 parameterNames = jsonDecoder._decodeList(jsonPath + ".parameterNames", j
son["parameterNames"], jsonDecoder._decodeString); |
| 4834 } else { |
| 4835 parameterNames = <String>[]; |
| 4685 } | 4836 } |
| 4686 List<String> parameterTypes; | 4837 List<String> parameterTypes; |
| 4687 if (json.containsKey("parameterTypes")) { | 4838 if (json.containsKey("parameterTypes")) { |
| 4688 parameterTypes = jsonDecoder._decodeList(jsonPath + ".parameterTypes", j
son["parameterTypes"], jsonDecoder._decodeString); | 4839 parameterTypes = jsonDecoder._decodeList(jsonPath + ".parameterTypes", j
son["parameterTypes"], jsonDecoder._decodeString); |
| 4840 } else { |
| 4841 parameterTypes = <String>[]; |
| 4689 } | 4842 } |
| 4690 int requiredParameterCount; | 4843 int requiredParameterCount; |
| 4691 if (json.containsKey("requiredParameterCount")) { | 4844 if (json.containsKey("requiredParameterCount")) { |
| 4692 requiredParameterCount = jsonDecoder._decodeInt(jsonPath + ".requiredPar
ameterCount", json["requiredParameterCount"]); | 4845 requiredParameterCount = jsonDecoder._decodeInt(jsonPath + ".requiredPar
ameterCount", json["requiredParameterCount"]); |
| 4693 } | 4846 } |
| 4694 int positionalParameterCount; | 4847 int positionalParameterCount; |
| 4695 if (json.containsKey("positionalParameterCount")) { | 4848 if (json.containsKey("positionalParameterCount")) { |
| 4696 positionalParameterCount = jsonDecoder._decodeInt(jsonPath + ".positiona
lParameterCount", json["positionalParameterCount"]); | 4849 positionalParameterCount = jsonDecoder._decodeInt(jsonPath + ".positiona
lParameterCount", json["positionalParameterCount"]); |
| 4697 } | 4850 } |
| 4698 String parameterName; | 4851 String parameterName; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4723 } | 4876 } |
| 4724 if (docComplete != null) { | 4877 if (docComplete != null) { |
| 4725 result["docComplete"] = docComplete; | 4878 result["docComplete"] = docComplete; |
| 4726 } | 4879 } |
| 4727 if (declaringType != null) { | 4880 if (declaringType != null) { |
| 4728 result["declaringType"] = declaringType; | 4881 result["declaringType"] = declaringType; |
| 4729 } | 4882 } |
| 4730 if (returnType != null) { | 4883 if (returnType != null) { |
| 4731 result["returnType"] = returnType; | 4884 result["returnType"] = returnType; |
| 4732 } | 4885 } |
| 4733 if (parameterNames != null) { | 4886 if (parameterNames.isNotEmpty) { |
| 4734 result["parameterNames"] = parameterNames; | 4887 result["parameterNames"] = parameterNames; |
| 4735 } | 4888 } |
| 4736 if (parameterTypes != null) { | 4889 if (parameterTypes.isNotEmpty) { |
| 4737 result["parameterTypes"] = parameterTypes; | 4890 result["parameterTypes"] = parameterTypes; |
| 4738 } | 4891 } |
| 4739 if (requiredParameterCount != null) { | 4892 if (requiredParameterCount != null) { |
| 4740 result["requiredParameterCount"] = requiredParameterCount; | 4893 result["requiredParameterCount"] = requiredParameterCount; |
| 4741 } | 4894 } |
| 4742 if (positionalParameterCount != null) { | 4895 if (positionalParameterCount != null) { |
| 4743 result["positionalParameterCount"] = positionalParameterCount; | 4896 result["positionalParameterCount"] = positionalParameterCount; |
| 4744 } | 4897 } |
| 4745 if (parameterName != null) { | 4898 if (parameterName != null) { |
| 4746 result["parameterName"] = parameterName; | 4899 result["parameterName"] = parameterName; |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5367 hash = _JenkinsSmiHash.combine(hash, data.hashCode); | 5520 hash = _JenkinsSmiHash.combine(hash, data.hashCode); |
| 5368 return _JenkinsSmiHash.finish(hash); | 5521 return _JenkinsSmiHash.finish(hash); |
| 5369 } | 5522 } |
| 5370 } | 5523 } |
| 5371 | 5524 |
| 5372 /** | 5525 /** |
| 5373 * ErrorFixes | 5526 * ErrorFixes |
| 5374 * | 5527 * |
| 5375 * { | 5528 * { |
| 5376 * "error": AnalysisError | 5529 * "error": AnalysisError |
| 5377 * "fixes": List<SourceChange> | 5530 * "fixes": optional List<SourceChange> |
| 5378 * } | 5531 * } |
| 5379 */ | 5532 */ |
| 5380 class ErrorFixes implements HasToJson { | 5533 class ErrorFixes implements HasToJson { |
| 5381 /** | 5534 /** |
| 5382 * The error with which the fixes are associated. | 5535 * The error with which the fixes are associated. |
| 5383 */ | 5536 */ |
| 5384 AnalysisError error; | 5537 AnalysisError error; |
| 5385 | 5538 |
| 5386 /** | 5539 /** |
| 5387 * The fixes associated with the error. | 5540 * The fixes associated with the error. |
| 5388 */ | 5541 */ |
| 5389 List<SourceChange> fixes; | 5542 List<SourceChange> fixes; |
| 5390 | 5543 |
| 5391 ErrorFixes(this.error, this.fixes); | 5544 ErrorFixes(this.error, {this.fixes}) { |
| 5545 if (fixes == null) { |
| 5546 fixes = <SourceChange>[]; |
| 5547 } |
| 5548 } |
| 5392 | 5549 |
| 5393 factory ErrorFixes.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object j
son) { | 5550 factory ErrorFixes.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object j
son) { |
| 5394 if (json == null) { | 5551 if (json == null) { |
| 5395 json = {}; | 5552 json = {}; |
| 5396 } | 5553 } |
| 5397 if (json is Map) { | 5554 if (json is Map) { |
| 5398 AnalysisError error; | 5555 AnalysisError error; |
| 5399 if (json.containsKey("error")) { | 5556 if (json.containsKey("error")) { |
| 5400 error = new AnalysisError.fromJson(jsonDecoder, jsonPath + ".error", jso
n["error"]); | 5557 error = new AnalysisError.fromJson(jsonDecoder, jsonPath + ".error", jso
n["error"]); |
| 5401 } else { | 5558 } else { |
| 5402 throw jsonDecoder.missingKey(jsonPath, "error"); | 5559 throw jsonDecoder.missingKey(jsonPath, "error"); |
| 5403 } | 5560 } |
| 5404 List<SourceChange> fixes; | 5561 List<SourceChange> fixes; |
| 5405 if (json.containsKey("fixes")) { | 5562 if (json.containsKey("fixes")) { |
| 5406 fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (Str
ing jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, j
son)); | 5563 fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (Str
ing jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, j
son)); |
| 5407 } else { | 5564 } else { |
| 5408 throw jsonDecoder.missingKey(jsonPath, "fixes"); | 5565 fixes = <SourceChange>[]; |
| 5409 } | 5566 } |
| 5410 return new ErrorFixes(error, fixes); | 5567 return new ErrorFixes(error, fixes: fixes); |
| 5411 } else { | 5568 } else { |
| 5412 throw jsonDecoder.mismatch(jsonPath, "ErrorFixes"); | 5569 throw jsonDecoder.mismatch(jsonPath, "ErrorFixes"); |
| 5413 } | 5570 } |
| 5414 } | 5571 } |
| 5415 | 5572 |
| 5416 Map<String, dynamic> toJson() { | 5573 Map<String, dynamic> toJson() { |
| 5417 Map<String, dynamic> result = {}; | 5574 Map<String, dynamic> result = {}; |
| 5418 result["error"] = error.toJson(); | 5575 result["error"] = error.toJson(); |
| 5419 result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList()
; | 5576 if (fixes.isNotEmpty) { |
| 5577 result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList
(); |
| 5578 } |
| 5420 return result; | 5579 return result; |
| 5421 } | 5580 } |
| 5422 | 5581 |
| 5423 @override | 5582 @override |
| 5424 String toString() => JSON.encode(toJson()); | 5583 String toString() => JSON.encode(toJson()); |
| 5425 | 5584 |
| 5426 @override | 5585 @override |
| 5427 bool operator==(other) { | 5586 bool operator==(other) { |
| 5428 if (other is ErrorFixes) { | 5587 if (other is ErrorFixes) { |
| 5429 return error == other.error && | 5588 return error == other.error && |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6322 hash = _JenkinsSmiHash.combine(hash, propagatedType.hashCode); | 6481 hash = _JenkinsSmiHash.combine(hash, propagatedType.hashCode); |
| 6323 hash = _JenkinsSmiHash.combine(hash, staticType.hashCode); | 6482 hash = _JenkinsSmiHash.combine(hash, staticType.hashCode); |
| 6324 return _JenkinsSmiHash.finish(hash); | 6483 return _JenkinsSmiHash.finish(hash); |
| 6325 } | 6484 } |
| 6326 } | 6485 } |
| 6327 | 6486 |
| 6328 /** | 6487 /** |
| 6329 * LinkedEditGroup | 6488 * LinkedEditGroup |
| 6330 * | 6489 * |
| 6331 * { | 6490 * { |
| 6332 * "positions": List<Position> | 6491 * "positions": optional List<Position> |
| 6333 * "length": int | 6492 * "length": int |
| 6334 * "suggestions": List<LinkedEditSuggestion> | 6493 * "suggestions": optional List<LinkedEditSuggestion> |
| 6335 * } | 6494 * } |
| 6336 */ | 6495 */ |
| 6337 class LinkedEditGroup implements HasToJson { | 6496 class LinkedEditGroup implements HasToJson { |
| 6338 /** | 6497 /** |
| 6339 * The positions of the regions that should be edited simultaneously. | 6498 * The positions of the regions that should be edited simultaneously. |
| 6340 */ | 6499 */ |
| 6341 List<Position> positions; | 6500 List<Position> positions; |
| 6342 | 6501 |
| 6343 /** | 6502 /** |
| 6344 * The length of the regions that should be edited simultaneously. | 6503 * The length of the regions that should be edited simultaneously. |
| 6345 */ | 6504 */ |
| 6346 int length; | 6505 int length; |
| 6347 | 6506 |
| 6348 /** | 6507 /** |
| 6349 * Pre-computed suggestions for what every region might want to be changed | 6508 * Pre-computed suggestions for what every region might want to be changed |
| 6350 * to. | 6509 * to. |
| 6351 */ | 6510 */ |
| 6352 List<LinkedEditSuggestion> suggestions; | 6511 List<LinkedEditSuggestion> suggestions; |
| 6353 | 6512 |
| 6354 LinkedEditGroup(this.positions, this.length, this.suggestions); | 6513 LinkedEditGroup(this.length, {this.positions, this.suggestions}) { |
| 6514 if (positions == null) { |
| 6515 positions = <Position>[]; |
| 6516 } |
| 6517 if (suggestions == null) { |
| 6518 suggestions = <LinkedEditSuggestion>[]; |
| 6519 } |
| 6520 } |
| 6355 | 6521 |
| 6356 factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | 6522 factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { |
| 6357 if (json == null) { | 6523 if (json == null) { |
| 6358 json = {}; | 6524 json = {}; |
| 6359 } | 6525 } |
| 6360 if (json is Map) { | 6526 if (json is Map) { |
| 6361 List<Position> positions; | 6527 List<Position> positions; |
| 6362 if (json.containsKey("positions")) { | 6528 if (json.containsKey("positions")) { |
| 6363 positions = jsonDecoder._decodeList(jsonPath + ".positions", json["posit
ions"], (String jsonPath, Object json) => new Position.fromJson(jsonDecoder, jso
nPath, json)); | 6529 positions = jsonDecoder._decodeList(jsonPath + ".positions", json["posit
ions"], (String jsonPath, Object json) => new Position.fromJson(jsonDecoder, jso
nPath, json)); |
| 6364 } else { | 6530 } else { |
| 6365 throw jsonDecoder.missingKey(jsonPath, "positions"); | 6531 positions = <Position>[]; |
| 6366 } | 6532 } |
| 6367 int length; | 6533 int length; |
| 6368 if (json.containsKey("length")) { | 6534 if (json.containsKey("length")) { |
| 6369 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 6535 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 6370 } else { | 6536 } else { |
| 6371 throw jsonDecoder.missingKey(jsonPath, "length"); | 6537 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 6372 } | 6538 } |
| 6373 List<LinkedEditSuggestion> suggestions; | 6539 List<LinkedEditSuggestion> suggestions; |
| 6374 if (json.containsKey("suggestions")) { | 6540 if (json.containsKey("suggestions")) { |
| 6375 suggestions = jsonDecoder._decodeList(jsonPath + ".suggestions", json["s
uggestions"], (String jsonPath, Object json) => new LinkedEditSuggestion.fromJso
n(jsonDecoder, jsonPath, json)); | 6541 suggestions = jsonDecoder._decodeList(jsonPath + ".suggestions", json["s
uggestions"], (String jsonPath, Object json) => new LinkedEditSuggestion.fromJso
n(jsonDecoder, jsonPath, json)); |
| 6376 } else { | 6542 } else { |
| 6377 throw jsonDecoder.missingKey(jsonPath, "suggestions"); | 6543 suggestions = <LinkedEditSuggestion>[]; |
| 6378 } | 6544 } |
| 6379 return new LinkedEditGroup(positions, length, suggestions); | 6545 return new LinkedEditGroup(length, positions: positions, suggestions: sugg
estions); |
| 6380 } else { | 6546 } else { |
| 6381 throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup"); | 6547 throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup"); |
| 6382 } | 6548 } |
| 6383 } | 6549 } |
| 6384 | 6550 |
| 6385 Map<String, dynamic> toJson() { | 6551 Map<String, dynamic> toJson() { |
| 6386 Map<String, dynamic> result = {}; | 6552 Map<String, dynamic> result = {}; |
| 6387 result["positions"] = positions.map((Position value) => value.toJson()).toLi
st(); | 6553 if (positions.isNotEmpty) { |
| 6554 result["positions"] = positions.map((Position value) => value.toJson()).to
List(); |
| 6555 } |
| 6388 result["length"] = length; | 6556 result["length"] = length; |
| 6389 result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => valu
e.toJson()).toList(); | 6557 if (suggestions.isNotEmpty) { |
| 6558 result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => va
lue.toJson()).toList(); |
| 6559 } |
| 6390 return result; | 6560 return result; |
| 6391 } | 6561 } |
| 6392 | 6562 |
| 6393 @override | 6563 @override |
| 6394 String toString() => JSON.encode(toJson()); | 6564 String toString() => JSON.encode(toJson()); |
| 6395 | 6565 |
| 6396 @override | 6566 @override |
| 6397 bool operator==(other) { | 6567 bool operator==(other) { |
| 6398 if (other is LinkedEditGroup) { | 6568 if (other is LinkedEditGroup) { |
| 6399 return _listEqual(positions, other.positions, (Position a, Position b) =>
a == b) && | 6569 return _listEqual(positions, other.positions, (Position a, Position b) =>
a == b) && |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6669 return _JenkinsSmiHash.finish(hash); | 6839 return _JenkinsSmiHash.finish(hash); |
| 6670 } | 6840 } |
| 6671 } | 6841 } |
| 6672 | 6842 |
| 6673 /** | 6843 /** |
| 6674 * NavigationRegion | 6844 * NavigationRegion |
| 6675 * | 6845 * |
| 6676 * { | 6846 * { |
| 6677 * "offset": int | 6847 * "offset": int |
| 6678 * "length": int | 6848 * "length": int |
| 6679 * "targets": List<Element> | 6849 * "targets": optional List<Element> |
| 6680 * } | 6850 * } |
| 6681 */ | 6851 */ |
| 6682 class NavigationRegion implements HasToJson { | 6852 class NavigationRegion implements HasToJson { |
| 6683 /** | 6853 /** |
| 6684 * The offset of the region from which the user can navigate. | 6854 * The offset of the region from which the user can navigate. |
| 6685 */ | 6855 */ |
| 6686 int offset; | 6856 int offset; |
| 6687 | 6857 |
| 6688 /** | 6858 /** |
| 6689 * The length of the region from which the user can navigate. | 6859 * The length of the region from which the user can navigate. |
| 6690 */ | 6860 */ |
| 6691 int length; | 6861 int length; |
| 6692 | 6862 |
| 6693 /** | 6863 /** |
| 6694 * The elements to which the given region is bound. By opening the | 6864 * The elements to which the given region is bound. By opening the |
| 6695 * declaration of the elements, clients can implement one form of navigation. | 6865 * declaration of the elements, clients can implement one form of navigation. |
| 6696 */ | 6866 */ |
| 6697 List<Element> targets; | 6867 List<Element> targets; |
| 6698 | 6868 |
| 6699 NavigationRegion(this.offset, this.length, this.targets); | 6869 NavigationRegion(this.offset, this.length, {this.targets}) { |
| 6870 if (targets == null) { |
| 6871 targets = <Element>[]; |
| 6872 } |
| 6873 } |
| 6700 | 6874 |
| 6701 factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | 6875 factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { |
| 6702 if (json == null) { | 6876 if (json == null) { |
| 6703 json = {}; | 6877 json = {}; |
| 6704 } | 6878 } |
| 6705 if (json is Map) { | 6879 if (json is Map) { |
| 6706 int offset; | 6880 int offset; |
| 6707 if (json.containsKey("offset")) { | 6881 if (json.containsKey("offset")) { |
| 6708 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | 6882 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); |
| 6709 } else { | 6883 } else { |
| 6710 throw jsonDecoder.missingKey(jsonPath, "offset"); | 6884 throw jsonDecoder.missingKey(jsonPath, "offset"); |
| 6711 } | 6885 } |
| 6712 int length; | 6886 int length; |
| 6713 if (json.containsKey("length")) { | 6887 if (json.containsKey("length")) { |
| 6714 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 6888 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 6715 } else { | 6889 } else { |
| 6716 throw jsonDecoder.missingKey(jsonPath, "length"); | 6890 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 6717 } | 6891 } |
| 6718 List<Element> targets; | 6892 List<Element> targets; |
| 6719 if (json.containsKey("targets")) { | 6893 if (json.containsKey("targets")) { |
| 6720 targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"]
, (String jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath,
json)); | 6894 targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"]
, (String jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath,
json)); |
| 6721 } else { | 6895 } else { |
| 6722 throw jsonDecoder.missingKey(jsonPath, "targets"); | 6896 targets = <Element>[]; |
| 6723 } | 6897 } |
| 6724 return new NavigationRegion(offset, length, targets); | 6898 return new NavigationRegion(offset, length, targets: targets); |
| 6725 } else { | 6899 } else { |
| 6726 throw jsonDecoder.mismatch(jsonPath, "NavigationRegion"); | 6900 throw jsonDecoder.mismatch(jsonPath, "NavigationRegion"); |
| 6727 } | 6901 } |
| 6728 } | 6902 } |
| 6729 | 6903 |
| 6730 Map<String, dynamic> toJson() { | 6904 Map<String, dynamic> toJson() { |
| 6731 Map<String, dynamic> result = {}; | 6905 Map<String, dynamic> result = {}; |
| 6732 result["offset"] = offset; | 6906 result["offset"] = offset; |
| 6733 result["length"] = length; | 6907 result["length"] = length; |
| 6734 result["targets"] = targets.map((Element value) => value.toJson()).toList(); | 6908 if (targets.isNotEmpty) { |
| 6909 result["targets"] = targets.map((Element value) => value.toJson()).toList(
); |
| 6910 } |
| 6735 return result; | 6911 return result; |
| 6736 } | 6912 } |
| 6737 | 6913 |
| 6738 @override | 6914 @override |
| 6739 String toString() => JSON.encode(toJson()); | 6915 String toString() => JSON.encode(toJson()); |
| 6740 | 6916 |
| 6741 @override | 6917 @override |
| 6742 bool operator==(other) { | 6918 bool operator==(other) { |
| 6743 if (other is NavigationRegion) { | 6919 if (other is NavigationRegion) { |
| 6744 return offset == other.offset && | 6920 return offset == other.offset && |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6756 hash = _JenkinsSmiHash.combine(hash, targets.hashCode); | 6932 hash = _JenkinsSmiHash.combine(hash, targets.hashCode); |
| 6757 return _JenkinsSmiHash.finish(hash); | 6933 return _JenkinsSmiHash.finish(hash); |
| 6758 } | 6934 } |
| 6759 } | 6935 } |
| 6760 | 6936 |
| 6761 /** | 6937 /** |
| 6762 * Occurrences | 6938 * Occurrences |
| 6763 * | 6939 * |
| 6764 * { | 6940 * { |
| 6765 * "element": Element | 6941 * "element": Element |
| 6766 * "offsets": List<int> | 6942 * "offsets": optional List<int> |
| 6767 * "length": int | 6943 * "length": int |
| 6768 * } | 6944 * } |
| 6769 */ | 6945 */ |
| 6770 class Occurrences implements HasToJson { | 6946 class Occurrences implements HasToJson { |
| 6771 /** | 6947 /** |
| 6772 * The element that was referenced. | 6948 * The element that was referenced. |
| 6773 */ | 6949 */ |
| 6774 Element element; | 6950 Element element; |
| 6775 | 6951 |
| 6776 /** | 6952 /** |
| 6777 * The offsets of the name of the referenced element within the file. | 6953 * The offsets of the name of the referenced element within the file. |
| 6778 */ | 6954 */ |
| 6779 List<int> offsets; | 6955 List<int> offsets; |
| 6780 | 6956 |
| 6781 /** | 6957 /** |
| 6782 * The length of the name of the referenced element. | 6958 * The length of the name of the referenced element. |
| 6783 */ | 6959 */ |
| 6784 int length; | 6960 int length; |
| 6785 | 6961 |
| 6786 Occurrences(this.element, this.offsets, this.length); | 6962 Occurrences(this.element, this.length, {this.offsets}) { |
| 6963 if (offsets == null) { |
| 6964 offsets = <int>[]; |
| 6965 } |
| 6966 } |
| 6787 | 6967 |
| 6788 factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | 6968 factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { |
| 6789 if (json == null) { | 6969 if (json == null) { |
| 6790 json = {}; | 6970 json = {}; |
| 6791 } | 6971 } |
| 6792 if (json is Map) { | 6972 if (json is Map) { |
| 6793 Element element; | 6973 Element element; |
| 6794 if (json.containsKey("element")) { | 6974 if (json.containsKey("element")) { |
| 6795 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | 6975 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); |
| 6796 } else { | 6976 } else { |
| 6797 throw jsonDecoder.missingKey(jsonPath, "element"); | 6977 throw jsonDecoder.missingKey(jsonPath, "element"); |
| 6798 } | 6978 } |
| 6799 List<int> offsets; | 6979 List<int> offsets; |
| 6800 if (json.containsKey("offsets")) { | 6980 if (json.containsKey("offsets")) { |
| 6801 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | 6981 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); |
| 6802 } else { | 6982 } else { |
| 6803 throw jsonDecoder.missingKey(jsonPath, "offsets"); | 6983 offsets = <int>[]; |
| 6804 } | 6984 } |
| 6805 int length; | 6985 int length; |
| 6806 if (json.containsKey("length")) { | 6986 if (json.containsKey("length")) { |
| 6807 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 6987 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 6808 } else { | 6988 } else { |
| 6809 throw jsonDecoder.missingKey(jsonPath, "length"); | 6989 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 6810 } | 6990 } |
| 6811 return new Occurrences(element, offsets, length); | 6991 return new Occurrences(element, length, offsets: offsets); |
| 6812 } else { | 6992 } else { |
| 6813 throw jsonDecoder.mismatch(jsonPath, "Occurrences"); | 6993 throw jsonDecoder.mismatch(jsonPath, "Occurrences"); |
| 6814 } | 6994 } |
| 6815 } | 6995 } |
| 6816 | 6996 |
| 6817 Map<String, dynamic> toJson() { | 6997 Map<String, dynamic> toJson() { |
| 6818 Map<String, dynamic> result = {}; | 6998 Map<String, dynamic> result = {}; |
| 6819 result["element"] = element.toJson(); | 6999 result["element"] = element.toJson(); |
| 6820 result["offsets"] = offsets; | 7000 if (offsets.isNotEmpty) { |
| 7001 result["offsets"] = offsets; |
| 7002 } |
| 6821 result["length"] = length; | 7003 result["length"] = length; |
| 6822 return result; | 7004 return result; |
| 6823 } | 7005 } |
| 6824 | 7006 |
| 6825 @override | 7007 @override |
| 6826 String toString() => JSON.encode(toJson()); | 7008 String toString() => JSON.encode(toJson()); |
| 6827 | 7009 |
| 6828 @override | 7010 @override |
| 6829 bool operator==(other) { | 7011 bool operator==(other) { |
| 6830 if (other is Occurrences) { | 7012 if (other is Occurrences) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6873 * The length of the element. | 7055 * The length of the element. |
| 6874 */ | 7056 */ |
| 6875 int length; | 7057 int length; |
| 6876 | 7058 |
| 6877 /** | 7059 /** |
| 6878 * The children of the node. The field will be omitted if the node has no | 7060 * The children of the node. The field will be omitted if the node has no |
| 6879 * children. | 7061 * children. |
| 6880 */ | 7062 */ |
| 6881 List<Outline> children; | 7063 List<Outline> children; |
| 6882 | 7064 |
| 6883 Outline(this.element, this.offset, this.length, {this.children}); | 7065 Outline(this.element, this.offset, this.length, {this.children}) { |
| 7066 if (children == null) { |
| 7067 children = <Outline>[]; |
| 7068 } |
| 7069 } |
| 6884 | 7070 |
| 6885 factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json
) { | 7071 factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json
) { |
| 6886 if (json == null) { | 7072 if (json == null) { |
| 6887 json = {}; | 7073 json = {}; |
| 6888 } | 7074 } |
| 6889 if (json is Map) { | 7075 if (json is Map) { |
| 6890 Element element; | 7076 Element element; |
| 6891 if (json.containsKey("element")) { | 7077 if (json.containsKey("element")) { |
| 6892 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | 7078 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); |
| 6893 } else { | 7079 } else { |
| 6894 throw jsonDecoder.missingKey(jsonPath, "element"); | 7080 throw jsonDecoder.missingKey(jsonPath, "element"); |
| 6895 } | 7081 } |
| 6896 int offset; | 7082 int offset; |
| 6897 if (json.containsKey("offset")) { | 7083 if (json.containsKey("offset")) { |
| 6898 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | 7084 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); |
| 6899 } else { | 7085 } else { |
| 6900 throw jsonDecoder.missingKey(jsonPath, "offset"); | 7086 throw jsonDecoder.missingKey(jsonPath, "offset"); |
| 6901 } | 7087 } |
| 6902 int length; | 7088 int length; |
| 6903 if (json.containsKey("length")) { | 7089 if (json.containsKey("length")) { |
| 6904 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 7090 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 6905 } else { | 7091 } else { |
| 6906 throw jsonDecoder.missingKey(jsonPath, "length"); | 7092 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 6907 } | 7093 } |
| 6908 List<Outline> children; | 7094 List<Outline> children; |
| 6909 if (json.containsKey("children")) { | 7095 if (json.containsKey("children")) { |
| 6910 children = jsonDecoder._decodeList(jsonPath + ".children", json["childre
n"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPat
h, json)); | 7096 children = jsonDecoder._decodeList(jsonPath + ".children", json["childre
n"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPat
h, json)); |
| 7097 } else { |
| 7098 children = <Outline>[]; |
| 6911 } | 7099 } |
| 6912 return new Outline(element, offset, length, children: children); | 7100 return new Outline(element, offset, length, children: children); |
| 6913 } else { | 7101 } else { |
| 6914 throw jsonDecoder.mismatch(jsonPath, "Outline"); | 7102 throw jsonDecoder.mismatch(jsonPath, "Outline"); |
| 6915 } | 7103 } |
| 6916 } | 7104 } |
| 6917 | 7105 |
| 6918 Map<String, dynamic> toJson() { | 7106 Map<String, dynamic> toJson() { |
| 6919 Map<String, dynamic> result = {}; | 7107 Map<String, dynamic> result = {}; |
| 6920 result["element"] = element.toJson(); | 7108 result["element"] = element.toJson(); |
| 6921 result["offset"] = offset; | 7109 result["offset"] = offset; |
| 6922 result["length"] = length; | 7110 result["length"] = length; |
| 6923 if (children != null) { | 7111 if (children.isNotEmpty) { |
| 6924 result["children"] = children.map((Outline value) => value.toJson()).toLis
t(); | 7112 result["children"] = children.map((Outline value) => value.toJson()).toLis
t(); |
| 6925 } | 7113 } |
| 6926 return result; | 7114 return result; |
| 6927 } | 7115 } |
| 6928 | 7116 |
| 6929 @override | 7117 @override |
| 6930 String toString() => JSON.encode(toJson()); | 7118 String toString() => JSON.encode(toJson()); |
| 6931 | 7119 |
| 6932 @override | 7120 @override |
| 6933 bool operator==(other) { | 7121 bool operator==(other) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6979 */ | 7167 */ |
| 6980 OverriddenMember superclassMember; | 7168 OverriddenMember superclassMember; |
| 6981 | 7169 |
| 6982 /** | 7170 /** |
| 6983 * The members inherited from interfaces that are overridden by the | 7171 * The members inherited from interfaces that are overridden by the |
| 6984 * overriding member. The field is omitted if there are no interface members, | 7172 * overriding member. The field is omitted if there are no interface members, |
| 6985 * in which case there must be a superclass member. | 7173 * in which case there must be a superclass member. |
| 6986 */ | 7174 */ |
| 6987 List<OverriddenMember> interfaceMembers; | 7175 List<OverriddenMember> interfaceMembers; |
| 6988 | 7176 |
| 6989 Override(this.offset, this.length, {this.superclassMember, this.interfaceMembe
rs}); | 7177 Override(this.offset, this.length, {this.superclassMember, this.interfaceMembe
rs}) { |
| 7178 if (interfaceMembers == null) { |
| 7179 interfaceMembers = <OverriddenMember>[]; |
| 7180 } |
| 7181 } |
| 6990 | 7182 |
| 6991 factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { | 7183 factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { |
| 6992 if (json == null) { | 7184 if (json == null) { |
| 6993 json = {}; | 7185 json = {}; |
| 6994 } | 7186 } |
| 6995 if (json is Map) { | 7187 if (json is Map) { |
| 6996 int offset; | 7188 int offset; |
| 6997 if (json.containsKey("offset")) { | 7189 if (json.containsKey("offset")) { |
| 6998 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | 7190 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); |
| 6999 } else { | 7191 } else { |
| 7000 throw jsonDecoder.missingKey(jsonPath, "offset"); | 7192 throw jsonDecoder.missingKey(jsonPath, "offset"); |
| 7001 } | 7193 } |
| 7002 int length; | 7194 int length; |
| 7003 if (json.containsKey("length")) { | 7195 if (json.containsKey("length")) { |
| 7004 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 7196 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 7005 } else { | 7197 } else { |
| 7006 throw jsonDecoder.missingKey(jsonPath, "length"); | 7198 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 7007 } | 7199 } |
| 7008 OverriddenMember superclassMember; | 7200 OverriddenMember superclassMember; |
| 7009 if (json.containsKey("superclassMember")) { | 7201 if (json.containsKey("superclassMember")) { |
| 7010 superclassMember = new OverriddenMember.fromJson(jsonDecoder, jsonPath +
".superclassMember", json["superclassMember"]); | 7202 superclassMember = new OverriddenMember.fromJson(jsonDecoder, jsonPath +
".superclassMember", json["superclassMember"]); |
| 7011 } | 7203 } |
| 7012 List<OverriddenMember> interfaceMembers; | 7204 List<OverriddenMember> interfaceMembers; |
| 7013 if (json.containsKey("interfaceMembers")) { | 7205 if (json.containsKey("interfaceMembers")) { |
| 7014 interfaceMembers = jsonDecoder._decodeList(jsonPath + ".interfaceMembers
", json["interfaceMembers"], (String jsonPath, Object json) => new OverriddenMem
ber.fromJson(jsonDecoder, jsonPath, json)); | 7206 interfaceMembers = jsonDecoder._decodeList(jsonPath + ".interfaceMembers
", json["interfaceMembers"], (String jsonPath, Object json) => new OverriddenMem
ber.fromJson(jsonDecoder, jsonPath, json)); |
| 7207 } else { |
| 7208 interfaceMembers = <OverriddenMember>[]; |
| 7015 } | 7209 } |
| 7016 return new Override(offset, length, superclassMember: superclassMember, in
terfaceMembers: interfaceMembers); | 7210 return new Override(offset, length, superclassMember: superclassMember, in
terfaceMembers: interfaceMembers); |
| 7017 } else { | 7211 } else { |
| 7018 throw jsonDecoder.mismatch(jsonPath, "Override"); | 7212 throw jsonDecoder.mismatch(jsonPath, "Override"); |
| 7019 } | 7213 } |
| 7020 } | 7214 } |
| 7021 | 7215 |
| 7022 Map<String, dynamic> toJson() { | 7216 Map<String, dynamic> toJson() { |
| 7023 Map<String, dynamic> result = {}; | 7217 Map<String, dynamic> result = {}; |
| 7024 result["offset"] = offset; | 7218 result["offset"] = offset; |
| 7025 result["length"] = length; | 7219 result["length"] = length; |
| 7026 if (superclassMember != null) { | 7220 if (superclassMember != null) { |
| 7027 result["superclassMember"] = superclassMember.toJson(); | 7221 result["superclassMember"] = superclassMember.toJson(); |
| 7028 } | 7222 } |
| 7029 if (interfaceMembers != null) { | 7223 if (interfaceMembers.isNotEmpty) { |
| 7030 result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value)
=> value.toJson()).toList(); | 7224 result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value)
=> value.toJson()).toList(); |
| 7031 } | 7225 } |
| 7032 return result; | 7226 return result; |
| 7033 } | 7227 } |
| 7034 | 7228 |
| 7035 @override | 7229 @override |
| 7036 String toString() => JSON.encode(toJson()); | 7230 String toString() => JSON.encode(toJson()); |
| 7037 | 7231 |
| 7038 @override | 7232 @override |
| 7039 bool operator==(other) { | 7233 bool operator==(other) { |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7638 } | 7832 } |
| 7639 } | 7833 } |
| 7640 | 7834 |
| 7641 /** | 7835 /** |
| 7642 * SearchResult | 7836 * SearchResult |
| 7643 * | 7837 * |
| 7644 * { | 7838 * { |
| 7645 * "location": Location | 7839 * "location": Location |
| 7646 * "kind": SearchResultKind | 7840 * "kind": SearchResultKind |
| 7647 * "isPotential": bool | 7841 * "isPotential": bool |
| 7648 * "path": List<Element> | 7842 * "path": optional List<Element> |
| 7649 * } | 7843 * } |
| 7650 */ | 7844 */ |
| 7651 class SearchResult implements HasToJson { | 7845 class SearchResult implements HasToJson { |
| 7652 /** | 7846 /** |
| 7653 * The location of the code that matched the search criteria. | 7847 * The location of the code that matched the search criteria. |
| 7654 */ | 7848 */ |
| 7655 Location location; | 7849 Location location; |
| 7656 | 7850 |
| 7657 /** | 7851 /** |
| 7658 * The kind of element that was found or the kind of reference that was | 7852 * The kind of element that was found or the kind of reference that was |
| 7659 * found. | 7853 * found. |
| 7660 */ | 7854 */ |
| 7661 SearchResultKind kind; | 7855 SearchResultKind kind; |
| 7662 | 7856 |
| 7663 /** | 7857 /** |
| 7664 * True if the result is a potential match but cannot be confirmed to be a | 7858 * True if the result is a potential match but cannot be confirmed to be a |
| 7665 * match. For example, if all references to a method m defined in some class | 7859 * match. For example, if all references to a method m defined in some class |
| 7666 * were requested, and a reference to a method m from an unknown class were | 7860 * were requested, and a reference to a method m from an unknown class were |
| 7667 * found, it would be marked as being a potential match. | 7861 * found, it would be marked as being a potential match. |
| 7668 */ | 7862 */ |
| 7669 bool isPotential; | 7863 bool isPotential; |
| 7670 | 7864 |
| 7671 /** | 7865 /** |
| 7672 * The elements that contain the result, starting with the most immediately | 7866 * The elements that contain the result, starting with the most immediately |
| 7673 * enclosing ancestor and ending with the library. | 7867 * enclosing ancestor and ending with the library. |
| 7674 */ | 7868 */ |
| 7675 List<Element> path; | 7869 List<Element> path; |
| 7676 | 7870 |
| 7677 SearchResult(this.location, this.kind, this.isPotential, this.path); | 7871 SearchResult(this.location, this.kind, this.isPotential, {this.path}) { |
| 7872 if (path == null) { |
| 7873 path = <Element>[]; |
| 7874 } |
| 7875 } |
| 7678 | 7876 |
| 7679 factory SearchResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | 7877 factory SearchResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { |
| 7680 if (json == null) { | 7878 if (json == null) { |
| 7681 json = {}; | 7879 json = {}; |
| 7682 } | 7880 } |
| 7683 if (json is Map) { | 7881 if (json is Map) { |
| 7684 Location location; | 7882 Location location; |
| 7685 if (json.containsKey("location")) { | 7883 if (json.containsKey("location")) { |
| 7686 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js
on["location"]); | 7884 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js
on["location"]); |
| 7687 } else { | 7885 } else { |
| 7688 throw jsonDecoder.missingKey(jsonPath, "location"); | 7886 throw jsonDecoder.missingKey(jsonPath, "location"); |
| 7689 } | 7887 } |
| 7690 SearchResultKind kind; | 7888 SearchResultKind kind; |
| 7691 if (json.containsKey("kind")) { | 7889 if (json.containsKey("kind")) { |
| 7692 kind = new SearchResultKind.fromJson(jsonDecoder, jsonPath + ".kind", js
on["kind"]); | 7890 kind = new SearchResultKind.fromJson(jsonDecoder, jsonPath + ".kind", js
on["kind"]); |
| 7693 } else { | 7891 } else { |
| 7694 throw jsonDecoder.missingKey(jsonPath, "kind"); | 7892 throw jsonDecoder.missingKey(jsonPath, "kind"); |
| 7695 } | 7893 } |
| 7696 bool isPotential; | 7894 bool isPotential; |
| 7697 if (json.containsKey("isPotential")) { | 7895 if (json.containsKey("isPotential")) { |
| 7698 isPotential = jsonDecoder._decodeBool(jsonPath + ".isPotential", json["i
sPotential"]); | 7896 isPotential = jsonDecoder._decodeBool(jsonPath + ".isPotential", json["i
sPotential"]); |
| 7699 } else { | 7897 } else { |
| 7700 throw jsonDecoder.missingKey(jsonPath, "isPotential"); | 7898 throw jsonDecoder.missingKey(jsonPath, "isPotential"); |
| 7701 } | 7899 } |
| 7702 List<Element> path; | 7900 List<Element> path; |
| 7703 if (json.containsKey("path")) { | 7901 if (json.containsKey("path")) { |
| 7704 path = jsonDecoder._decodeList(jsonPath + ".path", json["path"], (String
jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json)); | 7902 path = jsonDecoder._decodeList(jsonPath + ".path", json["path"], (String
jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json)); |
| 7705 } else { | 7903 } else { |
| 7706 throw jsonDecoder.missingKey(jsonPath, "path"); | 7904 path = <Element>[]; |
| 7707 } | 7905 } |
| 7708 return new SearchResult(location, kind, isPotential, path); | 7906 return new SearchResult(location, kind, isPotential, path: path); |
| 7709 } else { | 7907 } else { |
| 7710 throw jsonDecoder.mismatch(jsonPath, "SearchResult"); | 7908 throw jsonDecoder.mismatch(jsonPath, "SearchResult"); |
| 7711 } | 7909 } |
| 7712 } | 7910 } |
| 7713 | 7911 |
| 7714 /** | 7912 /** |
| 7715 * Construct based on a value from the search engine. | 7913 * Construct based on a value from the search engine. |
| 7716 */ | 7914 */ |
| 7717 factory SearchResult.fromMatch(engine.SearchMatch match) => | 7915 factory SearchResult.fromMatch(engine.SearchMatch match) => |
| 7718 searchResultFromMatch(match); | 7916 searchResultFromMatch(match); |
| 7719 | 7917 |
| 7720 Map<String, dynamic> toJson() { | 7918 Map<String, dynamic> toJson() { |
| 7721 Map<String, dynamic> result = {}; | 7919 Map<String, dynamic> result = {}; |
| 7722 result["location"] = location.toJson(); | 7920 result["location"] = location.toJson(); |
| 7723 result["kind"] = kind.toJson(); | 7921 result["kind"] = kind.toJson(); |
| 7724 result["isPotential"] = isPotential; | 7922 result["isPotential"] = isPotential; |
| 7725 result["path"] = path.map((Element value) => value.toJson()).toList(); | 7923 if (path.isNotEmpty) { |
| 7924 result["path"] = path.map((Element value) => value.toJson()).toList(); |
| 7925 } |
| 7726 return result; | 7926 return result; |
| 7727 } | 7927 } |
| 7728 | 7928 |
| 7729 @override | 7929 @override |
| 7730 String toString() => JSON.encode(toJson()); | 7930 String toString() => JSON.encode(toJson()); |
| 7731 | 7931 |
| 7732 @override | 7932 @override |
| 7733 bool operator==(other) { | 7933 bool operator==(other) { |
| 7734 if (other is SearchResult) { | 7934 if (other is SearchResult) { |
| 7735 return location == other.location && | 7935 return location == other.location && |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7885 String toString() => "ServerService.$name"; | 8085 String toString() => "ServerService.$name"; |
| 7886 | 8086 |
| 7887 String toJson() => name; | 8087 String toJson() => name; |
| 7888 } | 8088 } |
| 7889 | 8089 |
| 7890 /** | 8090 /** |
| 7891 * SourceChange | 8091 * SourceChange |
| 7892 * | 8092 * |
| 7893 * { | 8093 * { |
| 7894 * "message": String | 8094 * "message": String |
| 7895 * "edits": List<SourceFileEdit> | 8095 * "edits": optional List<SourceFileEdit> |
| 7896 * "linkedEditGroups": List<LinkedEditGroup> | 8096 * "linkedEditGroups": optional List<LinkedEditGroup> |
| 7897 * "selection": optional Position | 8097 * "selection": optional Position |
| 7898 * } | 8098 * } |
| 7899 */ | 8099 */ |
| 7900 class SourceChange implements HasToJson { | 8100 class SourceChange implements HasToJson { |
| 7901 /** | 8101 /** |
| 7902 * A human-readable description of the change to be applied. | 8102 * A human-readable description of the change to be applied. |
| 7903 */ | 8103 */ |
| 7904 String message; | 8104 String message; |
| 7905 | 8105 |
| 7906 /** | 8106 /** |
| 7907 * A list of the edits used to effect the change, grouped by file. | 8107 * A list of the edits used to effect the change, grouped by file. |
| 7908 */ | 8108 */ |
| 7909 List<SourceFileEdit> edits; | 8109 List<SourceFileEdit> edits; |
| 7910 | 8110 |
| 7911 /** | 8111 /** |
| 7912 * A list of the linked editing groups used to customize the changes that | 8112 * A list of the linked editing groups used to customize the changes that |
| 7913 * were made. | 8113 * were made. |
| 7914 */ | 8114 */ |
| 7915 List<LinkedEditGroup> linkedEditGroups; | 8115 List<LinkedEditGroup> linkedEditGroups; |
| 7916 | 8116 |
| 7917 /** | 8117 /** |
| 7918 * The position that should be selected after the edits have been applied. | 8118 * The position that should be selected after the edits have been applied. |
| 7919 */ | 8119 */ |
| 7920 Position selection; | 8120 Position selection; |
| 7921 | 8121 |
| 7922 SourceChange(this.message, this.edits, this.linkedEditGroups, {this.selection}
); | 8122 SourceChange(this.message, {this.edits, this.linkedEditGroups, this.selection}
) { |
| 8123 if (edits == null) { |
| 8124 edits = <SourceFileEdit>[]; |
| 8125 } |
| 8126 if (linkedEditGroups == null) { |
| 8127 linkedEditGroups = <LinkedEditGroup>[]; |
| 8128 } |
| 8129 } |
| 7923 | 8130 |
| 7924 factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | 8131 factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { |
| 7925 if (json == null) { | 8132 if (json == null) { |
| 7926 json = {}; | 8133 json = {}; |
| 7927 } | 8134 } |
| 7928 if (json is Map) { | 8135 if (json is Map) { |
| 7929 String message; | 8136 String message; |
| 7930 if (json.containsKey("message")) { | 8137 if (json.containsKey("message")) { |
| 7931 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); | 8138 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); |
| 7932 } else { | 8139 } else { |
| 7933 throw jsonDecoder.missingKey(jsonPath, "message"); | 8140 throw jsonDecoder.missingKey(jsonPath, "message"); |
| 7934 } | 8141 } |
| 7935 List<SourceFileEdit> edits; | 8142 List<SourceFileEdit> edits; |
| 7936 if (json.containsKey("edits")) { | 8143 if (json.containsKey("edits")) { |
| 7937 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceFileEdit.fromJson(jsonDecoder, jsonPath,
json)); | 8144 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceFileEdit.fromJson(jsonDecoder, jsonPath,
json)); |
| 7938 } else { | 8145 } else { |
| 7939 throw jsonDecoder.missingKey(jsonPath, "edits"); | 8146 edits = <SourceFileEdit>[]; |
| 7940 } | 8147 } |
| 7941 List<LinkedEditGroup> linkedEditGroups; | 8148 List<LinkedEditGroup> linkedEditGroups; |
| 7942 if (json.containsKey("linkedEditGroups")) { | 8149 if (json.containsKey("linkedEditGroups")) { |
| 7943 linkedEditGroups = jsonDecoder._decodeList(jsonPath + ".linkedEditGroups
", json["linkedEditGroups"], (String jsonPath, Object json) => new LinkedEditGro
up.fromJson(jsonDecoder, jsonPath, json)); | 8150 linkedEditGroups = jsonDecoder._decodeList(jsonPath + ".linkedEditGroups
", json["linkedEditGroups"], (String jsonPath, Object json) => new LinkedEditGro
up.fromJson(jsonDecoder, jsonPath, json)); |
| 7944 } else { | 8151 } else { |
| 7945 throw jsonDecoder.missingKey(jsonPath, "linkedEditGroups"); | 8152 linkedEditGroups = <LinkedEditGroup>[]; |
| 7946 } | 8153 } |
| 7947 Position selection; | 8154 Position selection; |
| 7948 if (json.containsKey("selection")) { | 8155 if (json.containsKey("selection")) { |
| 7949 selection = new Position.fromJson(jsonDecoder, jsonPath + ".selection",
json["selection"]); | 8156 selection = new Position.fromJson(jsonDecoder, jsonPath + ".selection",
json["selection"]); |
| 7950 } | 8157 } |
| 7951 return new SourceChange(message, edits, linkedEditGroups, selection: selec
tion); | 8158 return new SourceChange(message, edits: edits, linkedEditGroups: linkedEdi
tGroups, selection: selection); |
| 7952 } else { | 8159 } else { |
| 7953 throw jsonDecoder.mismatch(jsonPath, "SourceChange"); | 8160 throw jsonDecoder.mismatch(jsonPath, "SourceChange"); |
| 7954 } | 8161 } |
| 7955 } | 8162 } |
| 7956 | 8163 |
| 7957 Map<String, dynamic> toJson() { | 8164 Map<String, dynamic> toJson() { |
| 7958 Map<String, dynamic> result = {}; | 8165 Map<String, dynamic> result = {}; |
| 7959 result["message"] = message; | 8166 result["message"] = message; |
| 7960 result["edits"] = edits.map((SourceFileEdit value) => value.toJson()).toList
(); | 8167 if (edits.isNotEmpty) { |
| 7961 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) =>
value.toJson()).toList(); | 8168 result["edits"] = edits.map((SourceFileEdit value) => value.toJson()).toLi
st(); |
| 8169 } |
| 8170 if (linkedEditGroups.isNotEmpty) { |
| 8171 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value)
=> value.toJson()).toList(); |
| 8172 } |
| 7962 if (selection != null) { | 8173 if (selection != null) { |
| 7963 result["selection"] = selection.toJson(); | 8174 result["selection"] = selection.toJson(); |
| 7964 } | 8175 } |
| 7965 return result; | 8176 return result; |
| 7966 } | 8177 } |
| 7967 | 8178 |
| 7968 @override | 8179 @override |
| 7969 String toString() => JSON.encode(toJson()); | 8180 String toString() => JSON.encode(toJson()); |
| 7970 | 8181 |
| 7971 @override | 8182 @override |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8120 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | 8331 hash = _JenkinsSmiHash.combine(hash, id.hashCode); |
| 8121 return _JenkinsSmiHash.finish(hash); | 8332 return _JenkinsSmiHash.finish(hash); |
| 8122 } | 8333 } |
| 8123 } | 8334 } |
| 8124 | 8335 |
| 8125 /** | 8336 /** |
| 8126 * SourceFileEdit | 8337 * SourceFileEdit |
| 8127 * | 8338 * |
| 8128 * { | 8339 * { |
| 8129 * "file": FilePath | 8340 * "file": FilePath |
| 8130 * "edits": List<SourceEdit> | 8341 * "edits": optional List<SourceEdit> |
| 8131 * } | 8342 * } |
| 8132 */ | 8343 */ |
| 8133 class SourceFileEdit implements HasToJson { | 8344 class SourceFileEdit implements HasToJson { |
| 8134 /** | 8345 /** |
| 8135 * The file containing the code to be modified. | 8346 * The file containing the code to be modified. |
| 8136 */ | 8347 */ |
| 8137 String file; | 8348 String file; |
| 8138 | 8349 |
| 8139 /** | 8350 /** |
| 8140 * A list of the edits used to effect the change. | 8351 * A list of the edits used to effect the change. |
| 8141 */ | 8352 */ |
| 8142 List<SourceEdit> edits; | 8353 List<SourceEdit> edits; |
| 8143 | 8354 |
| 8144 SourceFileEdit(this.file, this.edits); | 8355 SourceFileEdit(this.file, {this.edits}) { |
| 8356 if (edits == null) { |
| 8357 edits = <SourceEdit>[]; |
| 8358 } |
| 8359 } |
| 8145 | 8360 |
| 8146 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | 8361 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { |
| 8147 if (json == null) { | 8362 if (json == null) { |
| 8148 json = {}; | 8363 json = {}; |
| 8149 } | 8364 } |
| 8150 if (json is Map) { | 8365 if (json is Map) { |
| 8151 String file; | 8366 String file; |
| 8152 if (json.containsKey("file")) { | 8367 if (json.containsKey("file")) { |
| 8153 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 8368 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 8154 } else { | 8369 } else { |
| 8155 throw jsonDecoder.missingKey(jsonPath, "file"); | 8370 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 8156 } | 8371 } |
| 8157 List<SourceEdit> edits; | 8372 List<SourceEdit> edits; |
| 8158 if (json.containsKey("edits")) { | 8373 if (json.containsKey("edits")) { |
| 8159 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); | 8374 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); |
| 8160 } else { | 8375 } else { |
| 8161 throw jsonDecoder.missingKey(jsonPath, "edits"); | 8376 edits = <SourceEdit>[]; |
| 8162 } | 8377 } |
| 8163 return new SourceFileEdit(file, edits); | 8378 return new SourceFileEdit(file, edits: edits); |
| 8164 } else { | 8379 } else { |
| 8165 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit"); | 8380 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit"); |
| 8166 } | 8381 } |
| 8167 } | 8382 } |
| 8168 | 8383 |
| 8169 Map<String, dynamic> toJson() { | 8384 Map<String, dynamic> toJson() { |
| 8170 Map<String, dynamic> result = {}; | 8385 Map<String, dynamic> result = {}; |
| 8171 result["file"] = file; | 8386 result["file"] = file; |
| 8172 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | 8387 if (edits.isNotEmpty) { |
| 8388 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList()
; |
| 8389 } |
| 8173 return result; | 8390 return result; |
| 8174 } | 8391 } |
| 8175 | 8392 |
| 8176 /** | 8393 /** |
| 8177 * Adds the given [Edit] to the list. | 8394 * Adds the given [Edit] to the list. |
| 8178 */ | 8395 */ |
| 8179 void add(SourceEdit edit) => _addEditForSource(this, edit); | 8396 void add(SourceEdit edit) => _addEditForSource(this, edit); |
| 8180 | 8397 |
| 8181 /** | 8398 /** |
| 8182 * Adds the given [Edit]s. | 8399 * Adds the given [Edit]s. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 8206 } | 8423 } |
| 8207 | 8424 |
| 8208 /** | 8425 /** |
| 8209 * TypeHierarchyItem | 8426 * TypeHierarchyItem |
| 8210 * | 8427 * |
| 8211 * { | 8428 * { |
| 8212 * "classElement": Element | 8429 * "classElement": Element |
| 8213 * "displayName": optional String | 8430 * "displayName": optional String |
| 8214 * "memberElement": optional Element | 8431 * "memberElement": optional Element |
| 8215 * "superclass": optional int | 8432 * "superclass": optional int |
| 8216 * "interfaces": List<int> | 8433 * "interfaces": optional List<int> |
| 8217 * "mixins": List<int> | 8434 * "mixins": optional List<int> |
| 8218 * "subclasses": List<int> | 8435 * "subclasses": optional List<int> |
| 8219 * } | 8436 * } |
| 8220 */ | 8437 */ |
| 8221 class TypeHierarchyItem implements HasToJson { | 8438 class TypeHierarchyItem implements HasToJson { |
| 8222 /** | 8439 /** |
| 8223 * The class element represented by this item. | 8440 * The class element represented by this item. |
| 8224 */ | 8441 */ |
| 8225 Element classElement; | 8442 Element classElement; |
| 8226 | 8443 |
| 8227 /** | 8444 /** |
| 8228 * The name to be displayed for the class. This field will be omitted if the | 8445 * The name to be displayed for the class. This field will be omitted if the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 8258 */ | 8475 */ |
| 8259 List<int> mixins; | 8476 List<int> mixins; |
| 8260 | 8477 |
| 8261 /** | 8478 /** |
| 8262 * The indexes of the items representing the subtypes of this class. The list | 8479 * The indexes of the items representing the subtypes of this class. The list |
| 8263 * will be empty if there are no subtypes or if this item represents a | 8480 * will be empty if there are no subtypes or if this item represents a |
| 8264 * supertype of the pivot type. | 8481 * supertype of the pivot type. |
| 8265 */ | 8482 */ |
| 8266 List<int> subclasses; | 8483 List<int> subclasses; |
| 8267 | 8484 |
| 8268 TypeHierarchyItem(this.classElement, this.interfaces, this.mixins, this.subcla
sses, {this.displayName, this.memberElement, this.superclass}); | 8485 TypeHierarchyItem(this.classElement, {this.displayName, this.memberElement, th
is.superclass, this.interfaces, this.mixins, this.subclasses}) { |
| 8486 if (interfaces == null) { |
| 8487 interfaces = <int>[]; |
| 8488 } |
| 8489 if (mixins == null) { |
| 8490 mixins = <int>[]; |
| 8491 } |
| 8492 if (subclasses == null) { |
| 8493 subclasses = <int>[]; |
| 8494 } |
| 8495 } |
| 8269 | 8496 |
| 8270 factory TypeHierarchyItem.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { | 8497 factory TypeHierarchyItem.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { |
| 8271 if (json == null) { | 8498 if (json == null) { |
| 8272 json = {}; | 8499 json = {}; |
| 8273 } | 8500 } |
| 8274 if (json is Map) { | 8501 if (json is Map) { |
| 8275 Element classElement; | 8502 Element classElement; |
| 8276 if (json.containsKey("classElement")) { | 8503 if (json.containsKey("classElement")) { |
| 8277 classElement = new Element.fromJson(jsonDecoder, jsonPath + ".classEleme
nt", json["classElement"]); | 8504 classElement = new Element.fromJson(jsonDecoder, jsonPath + ".classEleme
nt", json["classElement"]); |
| 8278 } else { | 8505 } else { |
| 8279 throw jsonDecoder.missingKey(jsonPath, "classElement"); | 8506 throw jsonDecoder.missingKey(jsonPath, "classElement"); |
| 8280 } | 8507 } |
| 8281 String displayName; | 8508 String displayName; |
| 8282 if (json.containsKey("displayName")) { | 8509 if (json.containsKey("displayName")) { |
| 8283 displayName = jsonDecoder._decodeString(jsonPath + ".displayName", json[
"displayName"]); | 8510 displayName = jsonDecoder._decodeString(jsonPath + ".displayName", json[
"displayName"]); |
| 8284 } | 8511 } |
| 8285 Element memberElement; | 8512 Element memberElement; |
| 8286 if (json.containsKey("memberElement")) { | 8513 if (json.containsKey("memberElement")) { |
| 8287 memberElement = new Element.fromJson(jsonDecoder, jsonPath + ".memberEle
ment", json["memberElement"]); | 8514 memberElement = new Element.fromJson(jsonDecoder, jsonPath + ".memberEle
ment", json["memberElement"]); |
| 8288 } | 8515 } |
| 8289 int superclass; | 8516 int superclass; |
| 8290 if (json.containsKey("superclass")) { | 8517 if (json.containsKey("superclass")) { |
| 8291 superclass = jsonDecoder._decodeInt(jsonPath + ".superclass", json["supe
rclass"]); | 8518 superclass = jsonDecoder._decodeInt(jsonPath + ".superclass", json["supe
rclass"]); |
| 8292 } | 8519 } |
| 8293 List<int> interfaces; | 8520 List<int> interfaces; |
| 8294 if (json.containsKey("interfaces")) { | 8521 if (json.containsKey("interfaces")) { |
| 8295 interfaces = jsonDecoder._decodeList(jsonPath + ".interfaces", json["int
erfaces"], jsonDecoder._decodeInt); | 8522 interfaces = jsonDecoder._decodeList(jsonPath + ".interfaces", json["int
erfaces"], jsonDecoder._decodeInt); |
| 8296 } else { | 8523 } else { |
| 8297 throw jsonDecoder.missingKey(jsonPath, "interfaces"); | 8524 interfaces = <int>[]; |
| 8298 } | 8525 } |
| 8299 List<int> mixins; | 8526 List<int> mixins; |
| 8300 if (json.containsKey("mixins")) { | 8527 if (json.containsKey("mixins")) { |
| 8301 mixins = jsonDecoder._decodeList(jsonPath + ".mixins", json["mixins"], j
sonDecoder._decodeInt); | 8528 mixins = jsonDecoder._decodeList(jsonPath + ".mixins", json["mixins"], j
sonDecoder._decodeInt); |
| 8302 } else { | 8529 } else { |
| 8303 throw jsonDecoder.missingKey(jsonPath, "mixins"); | 8530 mixins = <int>[]; |
| 8304 } | 8531 } |
| 8305 List<int> subclasses; | 8532 List<int> subclasses; |
| 8306 if (json.containsKey("subclasses")) { | 8533 if (json.containsKey("subclasses")) { |
| 8307 subclasses = jsonDecoder._decodeList(jsonPath + ".subclasses", json["sub
classes"], jsonDecoder._decodeInt); | 8534 subclasses = jsonDecoder._decodeList(jsonPath + ".subclasses", json["sub
classes"], jsonDecoder._decodeInt); |
| 8308 } else { | 8535 } else { |
| 8309 throw jsonDecoder.missingKey(jsonPath, "subclasses"); | 8536 subclasses = <int>[]; |
| 8310 } | 8537 } |
| 8311 return new TypeHierarchyItem(classElement, interfaces, mixins, subclasses,
displayName: displayName, memberElement: memberElement, superclass: superclass)
; | 8538 return new TypeHierarchyItem(classElement, displayName: displayName, membe
rElement: memberElement, superclass: superclass, interfaces: interfaces, mixins:
mixins, subclasses: subclasses); |
| 8312 } else { | 8539 } else { |
| 8313 throw jsonDecoder.mismatch(jsonPath, "TypeHierarchyItem"); | 8540 throw jsonDecoder.mismatch(jsonPath, "TypeHierarchyItem"); |
| 8314 } | 8541 } |
| 8315 } | 8542 } |
| 8316 | 8543 |
| 8317 Map<String, dynamic> toJson() { | 8544 Map<String, dynamic> toJson() { |
| 8318 Map<String, dynamic> result = {}; | 8545 Map<String, dynamic> result = {}; |
| 8319 result["classElement"] = classElement.toJson(); | 8546 result["classElement"] = classElement.toJson(); |
| 8320 if (displayName != null) { | 8547 if (displayName != null) { |
| 8321 result["displayName"] = displayName; | 8548 result["displayName"] = displayName; |
| 8322 } | 8549 } |
| 8323 if (memberElement != null) { | 8550 if (memberElement != null) { |
| 8324 result["memberElement"] = memberElement.toJson(); | 8551 result["memberElement"] = memberElement.toJson(); |
| 8325 } | 8552 } |
| 8326 if (superclass != null) { | 8553 if (superclass != null) { |
| 8327 result["superclass"] = superclass; | 8554 result["superclass"] = superclass; |
| 8328 } | 8555 } |
| 8329 result["interfaces"] = interfaces; | 8556 if (interfaces.isNotEmpty) { |
| 8330 result["mixins"] = mixins; | 8557 result["interfaces"] = interfaces; |
| 8331 result["subclasses"] = subclasses; | 8558 } |
| 8559 if (mixins.isNotEmpty) { |
| 8560 result["mixins"] = mixins; |
| 8561 } |
| 8562 if (subclasses.isNotEmpty) { |
| 8563 result["subclasses"] = subclasses; |
| 8564 } |
| 8332 return result; | 8565 return result; |
| 8333 } | 8566 } |
| 8334 | 8567 |
| 8335 @override | 8568 @override |
| 8336 String toString() => JSON.encode(toJson()); | 8569 String toString() => JSON.encode(toJson()); |
| 8337 | 8570 |
| 8338 @override | 8571 @override |
| 8339 bool operator==(other) { | 8572 bool operator==(other) { |
| 8340 if (other is TypeHierarchyItem) { | 8573 if (other is TypeHierarchyItem) { |
| 8341 return classElement == other.classElement && | 8574 return classElement == other.classElement && |
| (...skipping 18 matching lines...) Expand all Loading... |
| 8360 hash = _JenkinsSmiHash.combine(hash, mixins.hashCode); | 8593 hash = _JenkinsSmiHash.combine(hash, mixins.hashCode); |
| 8361 hash = _JenkinsSmiHash.combine(hash, subclasses.hashCode); | 8594 hash = _JenkinsSmiHash.combine(hash, subclasses.hashCode); |
| 8362 return _JenkinsSmiHash.finish(hash); | 8595 return _JenkinsSmiHash.finish(hash); |
| 8363 } | 8596 } |
| 8364 } | 8597 } |
| 8365 | 8598 |
| 8366 /** | 8599 /** |
| 8367 * extractLocalVariable feedback | 8600 * extractLocalVariable feedback |
| 8368 * | 8601 * |
| 8369 * { | 8602 * { |
| 8370 * "names": List<String> | 8603 * "names": optional List<String> |
| 8371 * "offsets": List<int> | 8604 * "offsets": optional List<int> |
| 8372 * "lengths": List<int> | 8605 * "lengths": optional List<int> |
| 8373 * } | 8606 * } |
| 8374 */ | 8607 */ |
| 8375 class ExtractLocalVariableFeedback implements HasToJson { | 8608 class ExtractLocalVariableFeedback implements HasToJson { |
| 8376 /** | 8609 /** |
| 8377 * The proposed names for the local variable. | 8610 * The proposed names for the local variable. |
| 8378 */ | 8611 */ |
| 8379 List<String> names; | 8612 List<String> names; |
| 8380 | 8613 |
| 8381 /** | 8614 /** |
| 8382 * The offsets of the expressions that would be replaced by a reference to | 8615 * The offsets of the expressions that would be replaced by a reference to |
| 8383 * the variable. | 8616 * the variable. |
| 8384 */ | 8617 */ |
| 8385 List<int> offsets; | 8618 List<int> offsets; |
| 8386 | 8619 |
| 8387 /** | 8620 /** |
| 8388 * The lengths of the expressions that would be replaced by a reference to | 8621 * The lengths of the expressions that would be replaced by a reference to |
| 8389 * the variable. The lengths correspond to the offsets. In other words, for a | 8622 * the variable. The lengths correspond to the offsets. In other words, for a |
| 8390 * given expression, if the offset of that expression is offsets[i], then the | 8623 * given expression, if the offset of that expression is offsets[i], then the |
| 8391 * length of that expression is lengths[i]. | 8624 * length of that expression is lengths[i]. |
| 8392 */ | 8625 */ |
| 8393 List<int> lengths; | 8626 List<int> lengths; |
| 8394 | 8627 |
| 8395 ExtractLocalVariableFeedback(this.names, this.offsets, this.lengths); | 8628 ExtractLocalVariableFeedback({this.names, this.offsets, this.lengths}) { |
| 8629 if (names == null) { |
| 8630 names = <String>[]; |
| 8631 } |
| 8632 if (offsets == null) { |
| 8633 offsets = <int>[]; |
| 8634 } |
| 8635 if (lengths == null) { |
| 8636 lengths = <int>[]; |
| 8637 } |
| 8638 } |
| 8396 | 8639 |
| 8397 factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | 8640 factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { |
| 8398 if (json == null) { | 8641 if (json == null) { |
| 8399 json = {}; | 8642 json = {}; |
| 8400 } | 8643 } |
| 8401 if (json is Map) { | 8644 if (json is Map) { |
| 8402 List<String> names; | 8645 List<String> names; |
| 8403 if (json.containsKey("names")) { | 8646 if (json.containsKey("names")) { |
| 8404 names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], json
Decoder._decodeString); | 8647 names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], json
Decoder._decodeString); |
| 8405 } else { | 8648 } else { |
| 8406 throw jsonDecoder.missingKey(jsonPath, "names"); | 8649 names = <String>[]; |
| 8407 } | 8650 } |
| 8408 List<int> offsets; | 8651 List<int> offsets; |
| 8409 if (json.containsKey("offsets")) { | 8652 if (json.containsKey("offsets")) { |
| 8410 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | 8653 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); |
| 8411 } else { | 8654 } else { |
| 8412 throw jsonDecoder.missingKey(jsonPath, "offsets"); | 8655 offsets = <int>[]; |
| 8413 } | 8656 } |
| 8414 List<int> lengths; | 8657 List<int> lengths; |
| 8415 if (json.containsKey("lengths")) { | 8658 if (json.containsKey("lengths")) { |
| 8416 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); | 8659 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); |
| 8417 } else { | 8660 } else { |
| 8418 throw jsonDecoder.missingKey(jsonPath, "lengths"); | 8661 lengths = <int>[]; |
| 8419 } | 8662 } |
| 8420 return new ExtractLocalVariableFeedback(names, offsets, lengths); | 8663 return new ExtractLocalVariableFeedback(names: names, offsets: offsets, le
ngths: lengths); |
| 8421 } else { | 8664 } else { |
| 8422 throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable feedback"); | 8665 throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable feedback"); |
| 8423 } | 8666 } |
| 8424 } | 8667 } |
| 8425 | 8668 |
| 8426 factory ExtractLocalVariableFeedback.fromRefactoringResult(EditGetRefactoringR
esult refactoringResult) { | 8669 factory ExtractLocalVariableFeedback.fromRefactoringResult(EditGetRefactoringR
esult refactoringResult) { |
| 8427 return new ExtractLocalVariableFeedback.fromJson( | 8670 return new ExtractLocalVariableFeedback.fromJson( |
| 8428 new ResponseDecoder(), "feedback", refactoringResult.feedback); | 8671 new ResponseDecoder(), "feedback", refactoringResult.feedback); |
| 8429 } | 8672 } |
| 8430 | 8673 |
| 8431 Map<String, dynamic> toJson() { | 8674 Map<String, dynamic> toJson() { |
| 8432 Map<String, dynamic> result = {}; | 8675 Map<String, dynamic> result = {}; |
| 8433 result["names"] = names; | 8676 if (names.isNotEmpty) { |
| 8434 result["offsets"] = offsets; | 8677 result["names"] = names; |
| 8435 result["lengths"] = lengths; | 8678 } |
| 8679 if (offsets.isNotEmpty) { |
| 8680 result["offsets"] = offsets; |
| 8681 } |
| 8682 if (lengths.isNotEmpty) { |
| 8683 result["lengths"] = lengths; |
| 8684 } |
| 8436 return result; | 8685 return result; |
| 8437 } | 8686 } |
| 8438 | 8687 |
| 8439 @override | 8688 @override |
| 8440 String toString() => JSON.encode(toJson()); | 8689 String toString() => JSON.encode(toJson()); |
| 8441 | 8690 |
| 8442 @override | 8691 @override |
| 8443 bool operator==(other) { | 8692 bool operator==(other) { |
| 8444 if (other is ExtractLocalVariableFeedback) { | 8693 if (other is ExtractLocalVariableFeedback) { |
| 8445 return _listEqual(names, other.names, (String a, String b) => a == b) && | 8694 return _listEqual(names, other.names, (String a, String b) => a == b) && |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8539 } | 8788 } |
| 8540 } | 8789 } |
| 8541 | 8790 |
| 8542 /** | 8791 /** |
| 8543 * extractMethod feedback | 8792 * extractMethod feedback |
| 8544 * | 8793 * |
| 8545 * { | 8794 * { |
| 8546 * "offset": int | 8795 * "offset": int |
| 8547 * "length": int | 8796 * "length": int |
| 8548 * "returnType": String | 8797 * "returnType": String |
| 8549 * "names": List<String> | 8798 * "names": optional List<String> |
| 8550 * "canCreateGetter": bool | 8799 * "canCreateGetter": bool |
| 8551 * "parameters": List<RefactoringMethodParameter> | 8800 * "parameters": optional List<RefactoringMethodParameter> |
| 8552 * "occurrences": int | 8801 * "occurrences": int |
| 8553 * "offsets": List<int> | 8802 * "offsets": optional List<int> |
| 8554 * "lengths": List<int> | 8803 * "lengths": optional List<int> |
| 8555 * } | 8804 * } |
| 8556 */ | 8805 */ |
| 8557 class ExtractMethodFeedback implements HasToJson { | 8806 class ExtractMethodFeedback implements HasToJson { |
| 8558 /** | 8807 /** |
| 8559 * The offset to the beginning of the expression or statements that will be | 8808 * The offset to the beginning of the expression or statements that will be |
| 8560 * extracted. | 8809 * extracted. |
| 8561 */ | 8810 */ |
| 8562 int offset; | 8811 int offset; |
| 8563 | 8812 |
| 8564 /** | 8813 /** |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8599 | 8848 |
| 8600 /** | 8849 /** |
| 8601 * The lengths of the expressions or statements that would be replaced by an | 8850 * The lengths of the expressions or statements that would be replaced by an |
| 8602 * invocation of the method. The lengths correspond to the offsets. In other | 8851 * invocation of the method. The lengths correspond to the offsets. In other |
| 8603 * words, for a given expression (or block of statements), if the offset of | 8852 * words, for a given expression (or block of statements), if the offset of |
| 8604 * that expression is offsets[i], then the length of that expression is | 8853 * that expression is offsets[i], then the length of that expression is |
| 8605 * lengths[i]. | 8854 * lengths[i]. |
| 8606 */ | 8855 */ |
| 8607 List<int> lengths; | 8856 List<int> lengths; |
| 8608 | 8857 |
| 8609 ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, t
his.canCreateGetter, this.parameters, this.occurrences, this.offsets, this.lengt
hs); | 8858 ExtractMethodFeedback(this.offset, this.length, this.returnType, this.canCreat
eGetter, this.occurrences, {this.names, this.parameters, this.offsets, this.leng
ths}) { |
| 8859 if (names == null) { |
| 8860 names = <String>[]; |
| 8861 } |
| 8862 if (parameters == null) { |
| 8863 parameters = <RefactoringMethodParameter>[]; |
| 8864 } |
| 8865 if (offsets == null) { |
| 8866 offsets = <int>[]; |
| 8867 } |
| 8868 if (lengths == null) { |
| 8869 lengths = <int>[]; |
| 8870 } |
| 8871 } |
| 8610 | 8872 |
| 8611 factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | 8873 factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { |
| 8612 if (json == null) { | 8874 if (json == null) { |
| 8613 json = {}; | 8875 json = {}; |
| 8614 } | 8876 } |
| 8615 if (json is Map) { | 8877 if (json is Map) { |
| 8616 int offset; | 8878 int offset; |
| 8617 if (json.containsKey("offset")) { | 8879 if (json.containsKey("offset")) { |
| 8618 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | 8880 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); |
| 8619 } else { | 8881 } else { |
| 8620 throw jsonDecoder.missingKey(jsonPath, "offset"); | 8882 throw jsonDecoder.missingKey(jsonPath, "offset"); |
| 8621 } | 8883 } |
| 8622 int length; | 8884 int length; |
| 8623 if (json.containsKey("length")) { | 8885 if (json.containsKey("length")) { |
| 8624 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | 8886 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); |
| 8625 } else { | 8887 } else { |
| 8626 throw jsonDecoder.missingKey(jsonPath, "length"); | 8888 throw jsonDecoder.missingKey(jsonPath, "length"); |
| 8627 } | 8889 } |
| 8628 String returnType; | 8890 String returnType; |
| 8629 if (json.containsKey("returnType")) { | 8891 if (json.containsKey("returnType")) { |
| 8630 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | 8892 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); |
| 8631 } else { | 8893 } else { |
| 8632 throw jsonDecoder.missingKey(jsonPath, "returnType"); | 8894 throw jsonDecoder.missingKey(jsonPath, "returnType"); |
| 8633 } | 8895 } |
| 8634 List<String> names; | 8896 List<String> names; |
| 8635 if (json.containsKey("names")) { | 8897 if (json.containsKey("names")) { |
| 8636 names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], json
Decoder._decodeString); | 8898 names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], json
Decoder._decodeString); |
| 8637 } else { | 8899 } else { |
| 8638 throw jsonDecoder.missingKey(jsonPath, "names"); | 8900 names = <String>[]; |
| 8639 } | 8901 } |
| 8640 bool canCreateGetter; | 8902 bool canCreateGetter; |
| 8641 if (json.containsKey("canCreateGetter")) { | 8903 if (json.containsKey("canCreateGetter")) { |
| 8642 canCreateGetter = jsonDecoder._decodeBool(jsonPath + ".canCreateGetter",
json["canCreateGetter"]); | 8904 canCreateGetter = jsonDecoder._decodeBool(jsonPath + ".canCreateGetter",
json["canCreateGetter"]); |
| 8643 } else { | 8905 } else { |
| 8644 throw jsonDecoder.missingKey(jsonPath, "canCreateGetter"); | 8906 throw jsonDecoder.missingKey(jsonPath, "canCreateGetter"); |
| 8645 } | 8907 } |
| 8646 List<RefactoringMethodParameter> parameters; | 8908 List<RefactoringMethodParameter> parameters; |
| 8647 if (json.containsKey("parameters")) { | 8909 if (json.containsKey("parameters")) { |
| 8648 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); | 8910 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); |
| 8649 } else { | 8911 } else { |
| 8650 throw jsonDecoder.missingKey(jsonPath, "parameters"); | 8912 parameters = <RefactoringMethodParameter>[]; |
| 8651 } | 8913 } |
| 8652 int occurrences; | 8914 int occurrences; |
| 8653 if (json.containsKey("occurrences")) { | 8915 if (json.containsKey("occurrences")) { |
| 8654 occurrences = jsonDecoder._decodeInt(jsonPath + ".occurrences", json["oc
currences"]); | 8916 occurrences = jsonDecoder._decodeInt(jsonPath + ".occurrences", json["oc
currences"]); |
| 8655 } else { | 8917 } else { |
| 8656 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | 8918 throw jsonDecoder.missingKey(jsonPath, "occurrences"); |
| 8657 } | 8919 } |
| 8658 List<int> offsets; | 8920 List<int> offsets; |
| 8659 if (json.containsKey("offsets")) { | 8921 if (json.containsKey("offsets")) { |
| 8660 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | 8922 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); |
| 8661 } else { | 8923 } else { |
| 8662 throw jsonDecoder.missingKey(jsonPath, "offsets"); | 8924 offsets = <int>[]; |
| 8663 } | 8925 } |
| 8664 List<int> lengths; | 8926 List<int> lengths; |
| 8665 if (json.containsKey("lengths")) { | 8927 if (json.containsKey("lengths")) { |
| 8666 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); | 8928 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); |
| 8667 } else { | 8929 } else { |
| 8668 throw jsonDecoder.missingKey(jsonPath, "lengths"); | 8930 lengths = <int>[]; |
| 8669 } | 8931 } |
| 8670 return new ExtractMethodFeedback(offset, length, returnType, names, canCre
ateGetter, parameters, occurrences, offsets, lengths); | 8932 return new ExtractMethodFeedback(offset, length, returnType, canCreateGett
er, occurrences, names: names, parameters: parameters, offsets: offsets, lengths
: lengths); |
| 8671 } else { | 8933 } else { |
| 8672 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback"); | 8934 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback"); |
| 8673 } | 8935 } |
| 8674 } | 8936 } |
| 8675 | 8937 |
| 8676 factory ExtractMethodFeedback.fromRefactoringResult(EditGetRefactoringResult r
efactoringResult) { | 8938 factory ExtractMethodFeedback.fromRefactoringResult(EditGetRefactoringResult r
efactoringResult) { |
| 8677 return new ExtractMethodFeedback.fromJson( | 8939 return new ExtractMethodFeedback.fromJson( |
| 8678 new ResponseDecoder(), "feedback", refactoringResult.feedback); | 8940 new ResponseDecoder(), "feedback", refactoringResult.feedback); |
| 8679 } | 8941 } |
| 8680 | 8942 |
| 8681 Map<String, dynamic> toJson() { | 8943 Map<String, dynamic> toJson() { |
| 8682 Map<String, dynamic> result = {}; | 8944 Map<String, dynamic> result = {}; |
| 8683 result["offset"] = offset; | 8945 result["offset"] = offset; |
| 8684 result["length"] = length; | 8946 result["length"] = length; |
| 8685 result["returnType"] = returnType; | 8947 result["returnType"] = returnType; |
| 8686 result["names"] = names; | 8948 if (names.isNotEmpty) { |
| 8949 result["names"] = names; |
| 8950 } |
| 8687 result["canCreateGetter"] = canCreateGetter; | 8951 result["canCreateGetter"] = canCreateGetter; |
| 8688 result["parameters"] = parameters.map((RefactoringMethodParameter value) =>
value.toJson()).toList(); | 8952 if (parameters.isNotEmpty) { |
| 8953 result["parameters"] = parameters.map((RefactoringMethodParameter value) =
> value.toJson()).toList(); |
| 8954 } |
| 8689 result["occurrences"] = occurrences; | 8955 result["occurrences"] = occurrences; |
| 8690 result["offsets"] = offsets; | 8956 if (offsets.isNotEmpty) { |
| 8691 result["lengths"] = lengths; | 8957 result["offsets"] = offsets; |
| 8958 } |
| 8959 if (lengths.isNotEmpty) { |
| 8960 result["lengths"] = lengths; |
| 8961 } |
| 8692 return result; | 8962 return result; |
| 8693 } | 8963 } |
| 8694 | 8964 |
| 8695 @override | 8965 @override |
| 8696 String toString() => JSON.encode(toJson()); | 8966 String toString() => JSON.encode(toJson()); |
| 8697 | 8967 |
| 8698 @override | 8968 @override |
| 8699 bool operator==(other) { | 8969 bool operator==(other) { |
| 8700 if (other is ExtractMethodFeedback) { | 8970 if (other is ExtractMethodFeedback) { |
| 8701 return offset == other.offset && | 8971 return offset == other.offset && |
| (...skipping 25 matching lines...) Expand all Loading... |
| 8727 } | 8997 } |
| 8728 } | 8998 } |
| 8729 | 8999 |
| 8730 /** | 9000 /** |
| 8731 * extractMethod options | 9001 * extractMethod options |
| 8732 * | 9002 * |
| 8733 * { | 9003 * { |
| 8734 * "returnType": String | 9004 * "returnType": String |
| 8735 * "createGetter": bool | 9005 * "createGetter": bool |
| 8736 * "name": String | 9006 * "name": String |
| 8737 * "parameters": List<RefactoringMethodParameter> | 9007 * "parameters": optional List<RefactoringMethodParameter> |
| 8738 * "extractAll": bool | 9008 * "extractAll": bool |
| 8739 * } | 9009 * } |
| 8740 */ | 9010 */ |
| 8741 class ExtractMethodOptions implements HasToJson { | 9011 class ExtractMethodOptions implements HasToJson { |
| 8742 /** | 9012 /** |
| 8743 * The return type that should be defined for the method. | 9013 * The return type that should be defined for the method. |
| 8744 */ | 9014 */ |
| 8745 String returnType; | 9015 String returnType; |
| 8746 | 9016 |
| 8747 /** | 9017 /** |
| (...skipping 21 matching lines...) Expand all Loading... |
| 8769 */ | 9039 */ |
| 8770 List<RefactoringMethodParameter> parameters; | 9040 List<RefactoringMethodParameter> parameters; |
| 8771 | 9041 |
| 8772 /** | 9042 /** |
| 8773 * True if all occurrences of the expression or statements should be replaced | 9043 * True if all occurrences of the expression or statements should be replaced |
| 8774 * by an invocation of the method. The expression or statements used to | 9044 * by an invocation of the method. The expression or statements used to |
| 8775 * initiate the refactoring will always be replaced. | 9045 * initiate the refactoring will always be replaced. |
| 8776 */ | 9046 */ |
| 8777 bool extractAll; | 9047 bool extractAll; |
| 8778 | 9048 |
| 8779 ExtractMethodOptions(this.returnType, this.createGetter, this.name, this.param
eters, this.extractAll); | 9049 ExtractMethodOptions(this.returnType, this.createGetter, this.name, this.extra
ctAll, {this.parameters}) { |
| 9050 if (parameters == null) { |
| 9051 parameters = <RefactoringMethodParameter>[]; |
| 9052 } |
| 9053 } |
| 8780 | 9054 |
| 8781 factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | 9055 factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { |
| 8782 if (json == null) { | 9056 if (json == null) { |
| 8783 json = {}; | 9057 json = {}; |
| 8784 } | 9058 } |
| 8785 if (json is Map) { | 9059 if (json is Map) { |
| 8786 String returnType; | 9060 String returnType; |
| 8787 if (json.containsKey("returnType")) { | 9061 if (json.containsKey("returnType")) { |
| 8788 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | 9062 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); |
| 8789 } else { | 9063 } else { |
| 8790 throw jsonDecoder.missingKey(jsonPath, "returnType"); | 9064 throw jsonDecoder.missingKey(jsonPath, "returnType"); |
| 8791 } | 9065 } |
| 8792 bool createGetter; | 9066 bool createGetter; |
| 8793 if (json.containsKey("createGetter")) { | 9067 if (json.containsKey("createGetter")) { |
| 8794 createGetter = jsonDecoder._decodeBool(jsonPath + ".createGetter", json[
"createGetter"]); | 9068 createGetter = jsonDecoder._decodeBool(jsonPath + ".createGetter", json[
"createGetter"]); |
| 8795 } else { | 9069 } else { |
| 8796 throw jsonDecoder.missingKey(jsonPath, "createGetter"); | 9070 throw jsonDecoder.missingKey(jsonPath, "createGetter"); |
| 8797 } | 9071 } |
| 8798 String name; | 9072 String name; |
| 8799 if (json.containsKey("name")) { | 9073 if (json.containsKey("name")) { |
| 8800 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | 9074 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); |
| 8801 } else { | 9075 } else { |
| 8802 throw jsonDecoder.missingKey(jsonPath, "name"); | 9076 throw jsonDecoder.missingKey(jsonPath, "name"); |
| 8803 } | 9077 } |
| 8804 List<RefactoringMethodParameter> parameters; | 9078 List<RefactoringMethodParameter> parameters; |
| 8805 if (json.containsKey("parameters")) { | 9079 if (json.containsKey("parameters")) { |
| 8806 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); | 9080 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); |
| 8807 } else { | 9081 } else { |
| 8808 throw jsonDecoder.missingKey(jsonPath, "parameters"); | 9082 parameters = <RefactoringMethodParameter>[]; |
| 8809 } | 9083 } |
| 8810 bool extractAll; | 9084 bool extractAll; |
| 8811 if (json.containsKey("extractAll")) { | 9085 if (json.containsKey("extractAll")) { |
| 8812 extractAll = jsonDecoder._decodeBool(jsonPath + ".extractAll", json["ext
ractAll"]); | 9086 extractAll = jsonDecoder._decodeBool(jsonPath + ".extractAll", json["ext
ractAll"]); |
| 8813 } else { | 9087 } else { |
| 8814 throw jsonDecoder.missingKey(jsonPath, "extractAll"); | 9088 throw jsonDecoder.missingKey(jsonPath, "extractAll"); |
| 8815 } | 9089 } |
| 8816 return new ExtractMethodOptions(returnType, createGetter, name, parameters
, extractAll); | 9090 return new ExtractMethodOptions(returnType, createGetter, name, extractAll
, parameters: parameters); |
| 8817 } else { | 9091 } else { |
| 8818 throw jsonDecoder.mismatch(jsonPath, "extractMethod options"); | 9092 throw jsonDecoder.mismatch(jsonPath, "extractMethod options"); |
| 8819 } | 9093 } |
| 8820 } | 9094 } |
| 8821 | 9095 |
| 8822 factory ExtractMethodOptions.fromRefactoringParams(EditGetRefactoringParams re
factoringParams, Request request) { | 9096 factory ExtractMethodOptions.fromRefactoringParams(EditGetRefactoringParams re
factoringParams, Request request) { |
| 8823 return new ExtractMethodOptions.fromJson( | 9097 return new ExtractMethodOptions.fromJson( |
| 8824 new RequestDecoder(request), "options", refactoringParams.options); | 9098 new RequestDecoder(request), "options", refactoringParams.options); |
| 8825 } | 9099 } |
| 8826 | 9100 |
| 8827 Map<String, dynamic> toJson() { | 9101 Map<String, dynamic> toJson() { |
| 8828 Map<String, dynamic> result = {}; | 9102 Map<String, dynamic> result = {}; |
| 8829 result["returnType"] = returnType; | 9103 result["returnType"] = returnType; |
| 8830 result["createGetter"] = createGetter; | 9104 result["createGetter"] = createGetter; |
| 8831 result["name"] = name; | 9105 result["name"] = name; |
| 8832 result["parameters"] = parameters.map((RefactoringMethodParameter value) =>
value.toJson()).toList(); | 9106 if (parameters.isNotEmpty) { |
| 9107 result["parameters"] = parameters.map((RefactoringMethodParameter value) =
> value.toJson()).toList(); |
| 9108 } |
| 8833 result["extractAll"] = extractAll; | 9109 result["extractAll"] = extractAll; |
| 8834 return result; | 9110 return result; |
| 8835 } | 9111 } |
| 8836 | 9112 |
| 8837 @override | 9113 @override |
| 8838 String toString() => JSON.encode(toJson()); | 9114 String toString() => JSON.encode(toJson()); |
| 8839 | 9115 |
| 8840 @override | 9116 @override |
| 8841 bool operator==(other) { | 9117 bool operator==(other) { |
| 8842 if (other is ExtractMethodOptions) { | 9118 if (other is ExtractMethodOptions) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9071 return false; | 9347 return false; |
| 9072 } | 9348 } |
| 9073 | 9349 |
| 9074 @override | 9350 @override |
| 9075 int get hashCode { | 9351 int get hashCode { |
| 9076 int hash = 0; | 9352 int hash = 0; |
| 9077 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 9353 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 9078 return _JenkinsSmiHash.finish(hash); | 9354 return _JenkinsSmiHash.finish(hash); |
| 9079 } | 9355 } |
| 9080 } | 9356 } |
| OLD | NEW |