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

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

Issue 497393002: Make more use of generated code in analysis server. (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 library domain.server; 5 library domain.server;
6 6
7 import 'package:analysis_server/src/analysis_server.dart'; 7 import 'package:analysis_server/src/analysis_server.dart';
8 import 'package:analysis_server/src/constants.dart'; 8 import 'package:analysis_server/src/constants.dart';
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:analysis_server/src/protocol2.dart'; 10 import 'package:analysis_server/src/protocol2.dart';
(...skipping 10 matching lines...) Expand all
21 21
22 /** 22 /**
23 * Initialize a newly created handler to handle requests for the given [server ]. 23 * Initialize a newly created handler to handle requests for the given [server ].
24 */ 24 */
25 ServerDomainHandler(this.server); 25 ServerDomainHandler(this.server);
26 26
27 /** 27 /**
28 * Return the version number of the analysis server. 28 * Return the version number of the analysis server.
29 */ 29 */
30 Response getVersion(Request request) { 30 Response getVersion(Request request) {
31 Response response = new Response(request.id); 31 return new ServerGetVersionResult('0.0.1').toResponse(request.id);
32 response.setResult(VERSION, '0.0.1');
33 return response;
34 } 32 }
35 33
36 @override 34 @override
37 Response handleRequest(Request request) { 35 Response handleRequest(Request request) {
38 try { 36 try {
39 String requestName = request.method; 37 String requestName = request.method;
40 if (requestName == SERVER_GET_VERSION) { 38 if (requestName == SERVER_GET_VERSION) {
41 return getVersion(request); 39 return getVersion(request);
42 } else if (requestName == SERVER_SET_SUBSCRIPTIONS) { 40 } else if (requestName == SERVER_SET_SUBSCRIPTIONS) {
43 return setSubscriptions(request); 41 return setSubscriptions(request);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 114
117 /** 115 /**
118 * Cleanly shutdown the analysis server. 116 * Cleanly shutdown the analysis server.
119 */ 117 */
120 Response shutdown(Request request) { 118 Response shutdown(Request request) {
121 server.shutdown(); 119 server.shutdown();
122 Response response = new Response(request.id); 120 Response response = new Response(request.id);
123 return response; 121 return response;
124 } 122 }
125 } 123 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/domain_completion.dart ('k') | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698