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

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

Issue 176873015: update client to use channel rather than socket (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: use common json encoder Created 6 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
« no previous file with comments | « pkg/analysis_server/lib/src/channel.dart ('k') | pkg/analysis_server/test/protocol_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index 123214f7214eaa648e42d342629559532ccd6640..7541aed2dd5f0a109b22122483a3f859e9c1ecb0 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -147,6 +147,20 @@ class Request {
}
throw new RequestFailure(new Response.expectedInteger(this, value));
}
+
+ /**
+ * Return a table representing the structure of the Json object that will be
+ * sent to the client to represent this response.
+ */
+ Map<String, Object> toJson() {
+ Map jsonObject = new Map();
+ jsonObject[ID] = id;
+ jsonObject[METHOD] = method;
+ params.forEach((String key, Object value) {
+ jsonObject[key] = value;
+ });
+ return jsonObject;
+ }
}
/**
« no previous file with comments | « pkg/analysis_server/lib/src/channel.dart ('k') | pkg/analysis_server/test/protocol_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698