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

Unified Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 943723002: Return version with connected notification (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Touched missed Java files Created 5 years, 10 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 4f67be66ce20cc703a677c513d77ff27673eada2..62b3ce88d8f751f50fcbea7593e7b948ff973110 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -223,25 +223,70 @@ class ServerSetSubscriptionsResult {
return 748820900;
}
}
+
/**
* server.connected params
+ *
+ * {
+ * "version": String
+ * }
*/
-class ServerConnectedParams {
+class ServerConnectedParams implements HasToJson {
+ /**
+ * The version number of the analysis server.
+ */
+ String version;
+
+ ServerConnectedParams(this.version);
+
+ factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+ if (json == null) {
+ json = {};
+ }
+ if (json is Map) {
+ String version;
+ if (json.containsKey("version")) {
+ version = jsonDecoder._decodeString(jsonPath + ".version", json["version"]);
+ } else {
+ throw jsonDecoder.missingKey(jsonPath, "version");
+ }
+ return new ServerConnectedParams(version);
+ } else {
+ throw jsonDecoder.mismatch(jsonPath, "server.connected params");
+ }
+ }
+
+ factory ServerConnectedParams.fromNotification(Notification notification) {
+ return new ServerConnectedParams.fromJson(
+ new ResponseDecoder(null), "params", notification._params);
+ }
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["version"] = version;
+ return result;
+ }
+
Notification toNotification() {
- return new Notification("server.connected", null);
+ return new Notification("server.connected", toJson());
}
@override
+ String toString() => JSON.encode(toJson());
+
+ @override
bool operator==(other) {
if (other is ServerConnectedParams) {
- return true;
+ return version == other.version;
}
return false;
}
@override
int get hashCode {
- return 509239412;
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, version.hashCode);
+ return _JenkinsSmiHash.finish(hash);
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/integration/integration_test_methods.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698