| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script | 6 // To regenerate the file, use the script |
| 7 // "pkg/analysis_server/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
| 8 | 8 |
| 9 part of protocol; | 9 part of protocol; |
| 10 /** | 10 /** |
| (...skipping 8622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8633 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) =>
value.toJson()).toList(); | 8633 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) =>
value.toJson()).toList(); |
| 8634 if (selection != null) { | 8634 if (selection != null) { |
| 8635 result["selection"] = selection.toJson(); | 8635 result["selection"] = selection.toJson(); |
| 8636 } | 8636 } |
| 8637 return result; | 8637 return result; |
| 8638 } | 8638 } |
| 8639 | 8639 |
| 8640 /** | 8640 /** |
| 8641 * Adds [edit] to the [FileEdit] for the given [file]. | 8641 * Adds [edit] to the [FileEdit] for the given [file]. |
| 8642 */ | 8642 */ |
| 8643 void addEdit(String file, SourceEdit edit) => | 8643 void addEdit(String file, int fileStamp, SourceEdit edit) => |
| 8644 _addEditToSourceChange(this, file, edit); | 8644 _addEditToSourceChange(this, file, fileStamp, edit); |
| 8645 | 8645 |
| 8646 /** | 8646 /** |
| 8647 * Adds the given [FileEdit]. | 8647 * Adds the given [FileEdit]. |
| 8648 */ | 8648 */ |
| 8649 void addFileEdit(SourceFileEdit edit) { | 8649 void addFileEdit(SourceFileEdit edit) { |
| 8650 edits.add(edit); | 8650 edits.add(edit); |
| 8651 } | 8651 } |
| 8652 | 8652 |
| 8653 /** | 8653 /** |
| 8654 * Adds the given [LinkedEditGroup]. | 8654 * Adds the given [LinkedEditGroup]. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8818 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | 8818 hash = _JenkinsSmiHash.combine(hash, id.hashCode); |
| 8819 return _JenkinsSmiHash.finish(hash); | 8819 return _JenkinsSmiHash.finish(hash); |
| 8820 } | 8820 } |
| 8821 } | 8821 } |
| 8822 | 8822 |
| 8823 /** | 8823 /** |
| 8824 * SourceFileEdit | 8824 * SourceFileEdit |
| 8825 * | 8825 * |
| 8826 * { | 8826 * { |
| 8827 * "file": FilePath | 8827 * "file": FilePath |
| 8828 * "fileStamp": long |
| 8828 * "edits": List<SourceEdit> | 8829 * "edits": List<SourceEdit> |
| 8829 * } | 8830 * } |
| 8830 */ | 8831 */ |
| 8831 class SourceFileEdit implements HasToJson { | 8832 class SourceFileEdit implements HasToJson { |
| 8832 /** | 8833 /** |
| 8833 * The file containing the code to be modified. | 8834 * The file containing the code to be modified. |
| 8834 */ | 8835 */ |
| 8835 String file; | 8836 String file; |
| 8836 | 8837 |
| 8837 /** | 8838 /** |
| 8839 * The modification stamp of the file at the moment when the change was |
| 8840 * created, in milliseconds since the "Unix epoch". Maybe -1 if the file did |
| 8841 * not exist and should be created. The client may use this field to make |
| 8842 * sure that the file was not changed since then, so it is safe to apply the |
| 8843 * change. |
| 8844 */ |
| 8845 int fileStamp; |
| 8846 |
| 8847 /** |
| 8838 * A list of the edits used to effect the change. | 8848 * A list of the edits used to effect the change. |
| 8839 */ | 8849 */ |
| 8840 List<SourceEdit> edits; | 8850 List<SourceEdit> edits; |
| 8841 | 8851 |
| 8842 SourceFileEdit(this.file, {this.edits}) { | 8852 SourceFileEdit(this.file, this.fileStamp, {this.edits}) { |
| 8843 if (edits == null) { | 8853 if (edits == null) { |
| 8844 edits = <SourceEdit>[]; | 8854 edits = <SourceEdit>[]; |
| 8845 } | 8855 } |
| 8846 } | 8856 } |
| 8847 | 8857 |
| 8848 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | 8858 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { |
| 8849 if (json == null) { | 8859 if (json == null) { |
| 8850 json = {}; | 8860 json = {}; |
| 8851 } | 8861 } |
| 8852 if (json is Map) { | 8862 if (json is Map) { |
| 8853 String file; | 8863 String file; |
| 8854 if (json.containsKey("file")) { | 8864 if (json.containsKey("file")) { |
| 8855 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 8865 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 8856 } else { | 8866 } else { |
| 8857 throw jsonDecoder.missingKey(jsonPath, "file"); | 8867 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 8858 } | 8868 } |
| 8869 int fileStamp; |
| 8870 if (json.containsKey("fileStamp")) { |
| 8871 fileStamp = jsonDecoder._decodeInt(jsonPath + ".fileStamp", json["fileSt
amp"]); |
| 8872 } else { |
| 8873 throw jsonDecoder.missingKey(jsonPath, "fileStamp"); |
| 8874 } |
| 8859 List<SourceEdit> edits; | 8875 List<SourceEdit> edits; |
| 8860 if (json.containsKey("edits")) { | 8876 if (json.containsKey("edits")) { |
| 8861 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); | 8877 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); |
| 8862 } else { | 8878 } else { |
| 8863 throw jsonDecoder.missingKey(jsonPath, "edits"); | 8879 throw jsonDecoder.missingKey(jsonPath, "edits"); |
| 8864 } | 8880 } |
| 8865 return new SourceFileEdit(file, edits: edits); | 8881 return new SourceFileEdit(file, fileStamp, edits: edits); |
| 8866 } else { | 8882 } else { |
| 8867 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit"); | 8883 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit"); |
| 8868 } | 8884 } |
| 8869 } | 8885 } |
| 8870 | 8886 |
| 8871 Map<String, dynamic> toJson() { | 8887 Map<String, dynamic> toJson() { |
| 8872 Map<String, dynamic> result = {}; | 8888 Map<String, dynamic> result = {}; |
| 8873 result["file"] = file; | 8889 result["file"] = file; |
| 8890 result["fileStamp"] = fileStamp; |
| 8874 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | 8891 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); |
| 8875 return result; | 8892 return result; |
| 8876 } | 8893 } |
| 8877 | 8894 |
| 8878 /** | 8895 /** |
| 8879 * Adds the given [Edit] to the list. | 8896 * Adds the given [Edit] to the list. |
| 8880 */ | 8897 */ |
| 8881 void add(SourceEdit edit) => _addEditForSource(this, edit); | 8898 void add(SourceEdit edit) => _addEditForSource(this, edit); |
| 8882 | 8899 |
| 8883 /** | 8900 /** |
| 8884 * Adds the given [Edit]s. | 8901 * Adds the given [Edit]s. |
| 8885 */ | 8902 */ |
| 8886 void addAll(Iterable<SourceEdit> edits) => | 8903 void addAll(Iterable<SourceEdit> edits) => |
| 8887 _addAllEditsForSource(this, edits); | 8904 _addAllEditsForSource(this, edits); |
| 8888 | 8905 |
| 8889 @override | 8906 @override |
| 8890 String toString() => JSON.encode(toJson()); | 8907 String toString() => JSON.encode(toJson()); |
| 8891 | 8908 |
| 8892 @override | 8909 @override |
| 8893 bool operator==(other) { | 8910 bool operator==(other) { |
| 8894 if (other is SourceFileEdit) { | 8911 if (other is SourceFileEdit) { |
| 8895 return file == other.file && | 8912 return file == other.file && |
| 8913 fileStamp == other.fileStamp && |
| 8896 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b)
; | 8914 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b)
; |
| 8897 } | 8915 } |
| 8898 return false; | 8916 return false; |
| 8899 } | 8917 } |
| 8900 | 8918 |
| 8901 @override | 8919 @override |
| 8902 int get hashCode { | 8920 int get hashCode { |
| 8903 int hash = 0; | 8921 int hash = 0; |
| 8904 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 8922 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 8923 hash = _JenkinsSmiHash.combine(hash, fileStamp.hashCode); |
| 8905 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | 8924 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); |
| 8906 return _JenkinsSmiHash.finish(hash); | 8925 return _JenkinsSmiHash.finish(hash); |
| 8907 } | 8926 } |
| 8908 } | 8927 } |
| 8909 | 8928 |
| 8910 /** | 8929 /** |
| 8911 * TypeHierarchyItem | 8930 * TypeHierarchyItem |
| 8912 * | 8931 * |
| 8913 * { | 8932 * { |
| 8914 * "classElement": Element | 8933 * "classElement": Element |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10030 return false; | 10049 return false; |
| 10031 } | 10050 } |
| 10032 | 10051 |
| 10033 @override | 10052 @override |
| 10034 int get hashCode { | 10053 int get hashCode { |
| 10035 int hash = 0; | 10054 int hash = 0; |
| 10036 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 10055 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 10037 return _JenkinsSmiHash.finish(hash); | 10056 return _JenkinsSmiHash.finish(hash); |
| 10038 } | 10057 } |
| 10039 } | 10058 } |
| OLD | NEW |