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

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: tweak 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
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8657 matching lines...) Expand 10 before | Expand all | Expand 10 after
8668 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson()).toList(); 8668 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson()).toList();
8669 if (selection != null) { 8669 if (selection != null) {
8670 result["selection"] = selection.toJson(); 8670 result["selection"] = selection.toJson();
8671 } 8671 }
8672 return result; 8672 return result;
8673 } 8673 }
8674 8674
8675 /** 8675 /**
8676 * Adds [edit] to the [FileEdit] for the given [file]. 8676 * Adds [edit] to the [FileEdit] for the given [file].
8677 */ 8677 */
8678 void addEdit(String file, SourceEdit edit) => 8678 void addEdit(String file, int fileStamp, SourceEdit edit) =>
8679 _addEditToSourceChange(this, file, edit); 8679 _addEditToSourceChange(this, file, fileStamp, edit);
8680 8680
8681 /** 8681 /**
8682 * Adds the given [FileEdit]. 8682 * Adds the given [FileEdit].
8683 */ 8683 */
8684 void addFileEdit(SourceFileEdit edit) { 8684 void addFileEdit(SourceFileEdit edit) {
8685 edits.add(edit); 8685 edits.add(edit);
8686 } 8686 }
8687 8687
8688 /** 8688 /**
8689 * Adds the given [LinkedEditGroup]. 8689 * Adds the given [LinkedEditGroup].
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
8853 hash = _JenkinsSmiHash.combine(hash, id.hashCode); 8853 hash = _JenkinsSmiHash.combine(hash, id.hashCode);
8854 return _JenkinsSmiHash.finish(hash); 8854 return _JenkinsSmiHash.finish(hash);
8855 } 8855 }
8856 } 8856 }
8857 8857
8858 /** 8858 /**
8859 * SourceFileEdit 8859 * SourceFileEdit
8860 * 8860 *
8861 * { 8861 * {
8862 * "file": FilePath 8862 * "file": FilePath
8863 * "fileStamp": long
8863 * "edits": List<SourceEdit> 8864 * "edits": List<SourceEdit>
8864 * } 8865 * }
8865 */ 8866 */
8866 class SourceFileEdit implements HasToJson { 8867 class SourceFileEdit implements HasToJson {
8867 /** 8868 /**
8868 * The file containing the code to be modified. 8869 * The file containing the code to be modified.
8869 */ 8870 */
8870 String file; 8871 String file;
8871 8872
8872 /** 8873 /**
8874 * The modification stamp of the file at the moment when the change was
8875 * created, in milliseconds since the "Unix epoch". Will be -1 if the file
8876 * did not exist and should be created. The client may use this field to make
8877 * sure that the file was not changed since then, so it is safe to apply the
8878 * change.
8879 */
8880 int fileStamp;
8881
8882 /**
8873 * A list of the edits used to effect the change. 8883 * A list of the edits used to effect the change.
8874 */ 8884 */
8875 List<SourceEdit> edits; 8885 List<SourceEdit> edits;
8876 8886
8877 SourceFileEdit(this.file, {this.edits}) { 8887 SourceFileEdit(this.file, this.fileStamp, {this.edits}) {
8878 if (edits == null) { 8888 if (edits == null) {
8879 edits = <SourceEdit>[]; 8889 edits = <SourceEdit>[];
8880 } 8890 }
8881 } 8891 }
8882 8892
8883 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) { 8893 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) {
8884 if (json == null) { 8894 if (json == null) {
8885 json = {}; 8895 json = {};
8886 } 8896 }
8887 if (json is Map) { 8897 if (json is Map) {
8888 String file; 8898 String file;
8889 if (json.containsKey("file")) { 8899 if (json.containsKey("file")) {
8890 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); 8900 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
8891 } else { 8901 } else {
8892 throw jsonDecoder.missingKey(jsonPath, "file"); 8902 throw jsonDecoder.missingKey(jsonPath, "file");
8893 } 8903 }
8904 int fileStamp;
8905 if (json.containsKey("fileStamp")) {
8906 fileStamp = jsonDecoder._decodeInt(jsonPath + ".fileStamp", json["fileSt amp"]);
8907 } else {
8908 throw jsonDecoder.missingKey(jsonPath, "fileStamp");
8909 }
8894 List<SourceEdit> edits; 8910 List<SourceEdit> edits;
8895 if (json.containsKey("edits")) { 8911 if (json.containsKey("edits")) {
8896 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso n)); 8912 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso n));
8897 } else { 8913 } else {
8898 throw jsonDecoder.missingKey(jsonPath, "edits"); 8914 throw jsonDecoder.missingKey(jsonPath, "edits");
8899 } 8915 }
8900 return new SourceFileEdit(file, edits: edits); 8916 return new SourceFileEdit(file, fileStamp, edits: edits);
8901 } else { 8917 } else {
8902 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit"); 8918 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit");
8903 } 8919 }
8904 } 8920 }
8905 8921
8906 Map<String, dynamic> toJson() { 8922 Map<String, dynamic> toJson() {
8907 Map<String, dynamic> result = {}; 8923 Map<String, dynamic> result = {};
8908 result["file"] = file; 8924 result["file"] = file;
8925 result["fileStamp"] = fileStamp;
8909 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); 8926 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
8910 return result; 8927 return result;
8911 } 8928 }
8912 8929
8913 /** 8930 /**
8914 * Adds the given [Edit] to the list. 8931 * Adds the given [Edit] to the list.
8915 */ 8932 */
8916 void add(SourceEdit edit) => _addEditForSource(this, edit); 8933 void add(SourceEdit edit) => _addEditForSource(this, edit);
8917 8934
8918 /** 8935 /**
8919 * Adds the given [Edit]s. 8936 * Adds the given [Edit]s.
8920 */ 8937 */
8921 void addAll(Iterable<SourceEdit> edits) => 8938 void addAll(Iterable<SourceEdit> edits) =>
8922 _addAllEditsForSource(this, edits); 8939 _addAllEditsForSource(this, edits);
8923 8940
8924 @override 8941 @override
8925 String toString() => JSON.encode(toJson()); 8942 String toString() => JSON.encode(toJson());
8926 8943
8927 @override 8944 @override
8928 bool operator==(other) { 8945 bool operator==(other) {
8929 if (other is SourceFileEdit) { 8946 if (other is SourceFileEdit) {
8930 return file == other.file && 8947 return file == other.file &&
8948 fileStamp == other.fileStamp &&
8931 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) ; 8949 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) ;
8932 } 8950 }
8933 return false; 8951 return false;
8934 } 8952 }
8935 8953
8936 @override 8954 @override
8937 int get hashCode { 8955 int get hashCode {
8938 int hash = 0; 8956 int hash = 0;
8939 hash = _JenkinsSmiHash.combine(hash, file.hashCode); 8957 hash = _JenkinsSmiHash.combine(hash, file.hashCode);
8958 hash = _JenkinsSmiHash.combine(hash, fileStamp.hashCode);
8940 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); 8959 hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
8941 return _JenkinsSmiHash.finish(hash); 8960 return _JenkinsSmiHash.finish(hash);
8942 } 8961 }
8943 } 8962 }
8944 8963
8945 /** 8964 /**
8946 * TypeHierarchyItem 8965 * TypeHierarchyItem
8947 * 8966 *
8948 * { 8967 * {
8949 * "classElement": Element 8968 * "classElement": Element
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
10065 return false; 10084 return false;
10066 } 10085 }
10067 10086
10068 @override 10087 @override
10069 int get hashCode { 10088 int get hashCode {
10070 int hash = 0; 10089 int hash = 0;
10071 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 10090 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
10072 return _JenkinsSmiHash.finish(hash); 10091 return _JenkinsSmiHash.finish(hash);
10073 } 10092 }
10074 } 10093 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698