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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/generated_protocol.dart
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
index f4105b2bd856dc18297c5ef0f0b324f508deff1d..b4d2644bc34a6e8f6c7a82e872e5f9fd5d725e89 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -8825,6 +8825,7 @@ class SourceEdit implements HasToJson {
*
* {
* "file": FilePath
+ * "time": int
* "edits": List<SourceEdit>
* }
*/
@@ -8835,11 +8836,21 @@ class SourceFileEdit implements HasToJson {
String file;
/**
+ * The time in milliseconds since the "Unix epoch" when this change was
+ * created. The client may use it to make sure that the file was not changed
+ * since then, so it is safe to apply the change.
+ */
+ int time;
+
+ /**
* A list of the edits used to effect the change.
*/
List<SourceEdit> edits;
- SourceFileEdit(this.file, {this.edits}) {
+ SourceFileEdit(this.file, {this.time, this.edits}) {
+ if (time == null) {
+ time = new DateTime.now().millisecondsSinceEpoch;
+ }
if (edits == null) {
edits = <SourceEdit>[];
}
@@ -8856,13 +8867,19 @@ class SourceFileEdit implements HasToJson {
} else {
throw jsonDecoder.missingKey(jsonPath, "file");
}
+ int time;
+ if (json.containsKey("time")) {
+ time = jsonDecoder._decodeInt(jsonPath + ".time", json["time"]);
+ } else {
+ throw jsonDecoder.missingKey(jsonPath, "time");
+ }
List<SourceEdit> edits;
if (json.containsKey("edits")) {
edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.missingKey(jsonPath, "edits");
}
- return new SourceFileEdit(file, edits: edits);
+ return new SourceFileEdit(file, time: time, edits: edits);
} else {
throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit");
}
@@ -8871,6 +8888,7 @@ class SourceFileEdit implements HasToJson {
Map<String, dynamic> toJson() {
Map<String, dynamic> result = {};
result["file"] = file;
+ result["time"] = time;
result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
return result;
}
@@ -8893,6 +8911,7 @@ class SourceFileEdit implements HasToJson {
bool operator==(other) {
if (other is SourceFileEdit) {
return file == other.file &&
+ time == other.time &&
_listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
}
return false;
@@ -8902,6 +8921,7 @@ class SourceFileEdit implements HasToJson {
int get hashCode {
int hash = 0;
hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, time.hashCode);
hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
return _JenkinsSmiHash.finish(hash);
}

Powered by Google App Engine
This is Rietveld 408576698