OLD | NEW |
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.analysis; | 5 library domain.analysis; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:core'; | 8 import 'dart:core'; |
9 | 9 |
10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; | 10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 Response getLibraryDependencies(Request request) { | 129 Response getLibraryDependencies(Request request) { |
130 server.onAnalysisComplete.then((_) { | 130 server.onAnalysisComplete.then((_) { |
131 LibraryDependencyCollector collector = | 131 LibraryDependencyCollector collector = |
132 new LibraryDependencyCollector(server.analysisContexts); | 132 new LibraryDependencyCollector(server.analysisContexts); |
133 Set<String> libraries = collector.collectLibraryDependencies(); | 133 Set<String> libraries = collector.collectLibraryDependencies(); |
134 Map<String, Map<String, List<String>>> packageMap = | 134 Map<String, Map<String, List<String>>> packageMap = |
135 collector.calculatePackageMap(server.folderMap); | 135 collector.calculatePackageMap(server.folderMap); |
136 server.sendResponse(new AnalysisGetLibraryDependenciesResult( | 136 server.sendResponse(new AnalysisGetLibraryDependenciesResult( |
137 libraries.toList(growable: false), packageMap) | 137 libraries.toList(growable: false), packageMap) |
138 .toResponse(request.id)); | 138 .toResponse(request.id)); |
| 139 }).catchError((error, st) { |
| 140 server.sendResponse(new Response.serverError(request, error, st)); |
139 }); | 141 }); |
140 // delay response | 142 // delay response |
141 return Response.DELAYED_RESPONSE; | 143 return Response.DELAYED_RESPONSE; |
142 } | 144 } |
143 | 145 |
144 /** | 146 /** |
145 * Implement the `analysis.getNavigation` request. | 147 * Implement the `analysis.getNavigation` request. |
146 */ | 148 */ |
147 Future<Null> getNavigation(Request request) async { | 149 Future<Null> getNavigation(Request request) async { |
148 var params = new AnalysisGetNavigationParams.fromRequest(request); | 150 var params = new AnalysisGetNavigationParams.fromRequest(request); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 context.onResultChanged(descriptor).listen((result) { | 443 context.onResultChanged(descriptor).listen((result) { |
442 StreamController<engine.ResultChangedEvent> controller = | 444 StreamController<engine.ResultChangedEvent> controller = |
443 controllers[result.descriptor]; | 445 controllers[result.descriptor]; |
444 if (controller != null) { | 446 if (controller != null) { |
445 controller.add(result); | 447 controller.add(result); |
446 } | 448 } |
447 }); | 449 }); |
448 } | 450 } |
449 } | 451 } |
450 } | 452 } |
OLD | NEW |