Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 574573002: Add SourceFileEdit.time field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 8807 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 * "time": int
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 time in milliseconds since the "Unix epoch" when this change was
8840 * created. The client may use it to make sure that the file was not changed
8841 * since then, so it is safe to apply the change.
8842 */
8843 int time;
8844
8845 /**
8838 * A list of the edits used to effect the change. 8846 * A list of the edits used to effect the change.
8839 */ 8847 */
8840 List<SourceEdit> edits; 8848 List<SourceEdit> edits;
8841 8849
8842 SourceFileEdit(this.file, {this.edits}) { 8850 SourceFileEdit(this.file, {this.time, this.edits}) {
8851 if (time == null) {
8852 time = new DateTime.now().millisecondsSinceEpoch;
8853 }
8843 if (edits == null) { 8854 if (edits == null) {
8844 edits = <SourceEdit>[]; 8855 edits = <SourceEdit>[];
8845 } 8856 }
8846 } 8857 }
8847 8858
8848 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) { 8859 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) {
8849 if (json == null) { 8860 if (json == null) {
8850 json = {}; 8861 json = {};
8851 } 8862 }
8852 if (json is Map) { 8863 if (json is Map) {
8853 String file; 8864 String file;
8854 if (json.containsKey("file")) { 8865 if (json.containsKey("file")) {
8855 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); 8866 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
8856 } else { 8867 } else {
8857 throw jsonDecoder.missingKey(jsonPath, "file"); 8868 throw jsonDecoder.missingKey(jsonPath, "file");
8858 } 8869 }
8870 int time;
8871 if (json.containsKey("time")) {
8872 time = jsonDecoder._decodeInt(jsonPath + ".time", json["time"]);
8873 } else {
8874 throw jsonDecoder.missingKey(jsonPath, "time");
8875 }
8859 List<SourceEdit> edits; 8876 List<SourceEdit> edits;
8860 if (json.containsKey("edits")) { 8877 if (json.containsKey("edits")) {
8861 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso n)); 8878 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso n));
8862 } else { 8879 } else {
8863 throw jsonDecoder.missingKey(jsonPath, "edits"); 8880 throw jsonDecoder.missingKey(jsonPath, "edits");
8864 } 8881 }
8865 return new SourceFileEdit(file, edits: edits); 8882 return new SourceFileEdit(file, time: time, edits: edits);
8866 } else { 8883 } else {
8867 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit"); 8884 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit");
8868 } 8885 }
8869 } 8886 }
8870 8887
8871 Map<String, dynamic> toJson() { 8888 Map<String, dynamic> toJson() {
8872 Map<String, dynamic> result = {}; 8889 Map<String, dynamic> result = {};
8873 result["file"] = file; 8890 result["file"] = file;
8891 result["time"] = time;
8874 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); 8892 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
8875 return result; 8893 return result;
8876 } 8894 }
8877 8895
8878 /** 8896 /**
8879 * Adds the given [Edit] to the list. 8897 * Adds the given [Edit] to the list.
8880 */ 8898 */
8881 void add(SourceEdit edit) => _addEditForSource(this, edit); 8899 void add(SourceEdit edit) => _addEditForSource(this, edit);
8882 8900
8883 /** 8901 /**
8884 * Adds the given [Edit]s. 8902 * Adds the given [Edit]s.
8885 */ 8903 */
8886 void addAll(Iterable<SourceEdit> edits) => 8904 void addAll(Iterable<SourceEdit> edits) =>
8887 _addAllEditsForSource(this, edits); 8905 _addAllEditsForSource(this, edits);
8888 8906
8889 @override 8907 @override
8890 String toString() => JSON.encode(toJson()); 8908 String toString() => JSON.encode(toJson());
8891 8909
8892 @override 8910 @override
8893 bool operator==(other) { 8911 bool operator==(other) {
8894 if (other is SourceFileEdit) { 8912 if (other is SourceFileEdit) {
8895 return file == other.file && 8913 return file == other.file &&
8914 time == other.time &&
8896 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) ; 8915 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) ;
8897 } 8916 }
8898 return false; 8917 return false;
8899 } 8918 }
8900 8919
8901 @override 8920 @override
8902 int get hashCode { 8921 int get hashCode {
8903 int hash = 0; 8922 int hash = 0;
8904 hash = _JenkinsSmiHash.combine(hash, file.hashCode); 8923 hash = _JenkinsSmiHash.combine(hash, file.hashCode);
8924 hash = _JenkinsSmiHash.combine(hash, time.hashCode);
8905 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); 8925 hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
8906 return _JenkinsSmiHash.finish(hash); 8926 return _JenkinsSmiHash.finish(hash);
8907 } 8927 }
8908 } 8928 }
8909 8929
8910 /** 8930 /**
8911 * TypeHierarchyItem 8931 * TypeHierarchyItem
8912 * 8932 *
8913 * { 8933 * {
8914 * "classElement": Element 8934 * "classElement": Element
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
10030 return false; 10050 return false;
10031 } 10051 }
10032 10052
10033 @override 10053 @override
10034 int get hashCode { 10054 int get hashCode {
10035 int hash = 0; 10055 int hash = 0;
10036 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 10056 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
10037 return _JenkinsSmiHash.finish(hash); 10057 return _JenkinsSmiHash.finish(hash);
10038 } 10058 }
10039 } 10059 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698