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

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

Issue 299513003: improve analysis server notifications (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove analysis.complete notification Created 6 years, 7 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/protocol.dart'; 8 import 'package:analysis_server/src/protocol.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/java_io.dart'; 10 import 'package:analyzer/src/generated/java_io.dart';
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // TODO what error code should be returned here? 104 // TODO what error code should be returned here?
105 return new Response(request.id, new RequestError( 105 return new Response(request.id, new RequestError(
106 RequestError.CODE_SDK_ERROR, 'Failed to access sdk: $e')); 106 RequestError.CODE_SDK_ERROR, 'Failed to access sdk: $e'));
107 } 107 }
108 context.sourceFactory = new SourceFactory([ 108 context.sourceFactory = new SourceFactory([
109 new DartUriResolver(sdk), 109 new DartUriResolver(sdk),
110 new FileUriResolver(), 110 new FileUriResolver(),
111 // new PackageUriResolver(), 111 // new PackageUriResolver(),
112 ]); 112 ]);
113 server.contextMap[contextId] = context; 113 server.contextMap[contextId] = context;
114 server.contextIdMap[context] = contextId;
114 115
115 Response response = new Response(request.id); 116 Response response = new Response(request.id);
116 return response; 117 return response;
117 } 118 }
118 119
119 /** 120 /**
120 * Delete the context with the given id. Future attempts to use the context id 121 * Delete the context with the given id. Future attempts to use the context id
121 * will result in an error being returned. 122 * will result in an error being returned.
122 */ 123 */
123 Response deleteContext(Request request) { 124 Response deleteContext(Request request) {
124 String contextId = request.getRequiredParameter(AnalysisServer.CONTEXT_ID_PA RAM).asString(); 125 String contextId = request.getRequiredParameter(AnalysisServer.CONTEXT_ID_PA RAM).asString();
125 126
126 AnalysisContext removedContext = server.contextMap.remove(contextId); 127 AnalysisContext removedContext = server.contextMap.remove(contextId);
127 if (removedContext == null) { 128 if (removedContext == null) {
128 return new Response.contextDoesNotExist(request); 129 return new Response.contextDoesNotExist(request);
129 } 130 }
131 server.contextIdMap.remove(removedContext);
130 Response response = new Response(request.id); 132 Response response = new Response(request.id);
131 return response; 133 return response;
132 } 134 }
133 135
134 /** 136 /**
135 * Cleanly shutdown the analysis server. 137 * Cleanly shutdown the analysis server.
136 */ 138 */
137 Response shutdown(Request request) { 139 Response shutdown(Request request) {
138 server.running = false; 140 server.running = false;
139 Response response = new Response(request.id); 141 Response response = new Response(request.id);
140 return response; 142 return response;
141 } 143 }
142 144
143 /** 145 /**
144 * Return the version number of the analysis server. 146 * Return the version number of the analysis server.
145 */ 147 */
146 Response version(Request request) { 148 Response version(Request request) {
147 Response response = new Response(request.id); 149 Response response = new Response(request.id);
148 response.setResult(VERSION_RESULT, '0.0.1'); 150 response.setResult(VERSION_RESULT, '0.0.1');
149 return response; 151 return response;
150 } 152 }
151 } 153 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/analysis_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698