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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 .toResponse(request.id)); | 126 .toResponse(request.id)); |
127 }); | 127 }); |
128 // delay response | 128 // delay response |
129 return Response.DELAYED_RESPONSE; | 129 return Response.DELAYED_RESPONSE; |
130 } | 130 } |
131 | 131 |
132 /** | 132 /** |
133 * Implement the `analysis.getNavigation` request. | 133 * Implement the `analysis.getNavigation` request. |
134 */ | 134 */ |
135 Response getNavigation(Request request) { | 135 Response getNavigation(Request request) { |
| 136 if (server.options.enableNewAnalysisDriver) { |
| 137 // TODO(scheglov) implement for the new analysis driver |
| 138 return new Response.getNavigationInvalidFile(request); |
| 139 } |
136 var params = new AnalysisGetNavigationParams.fromRequest(request); | 140 var params = new AnalysisGetNavigationParams.fromRequest(request); |
137 String file = params.file; | 141 String file = params.file; |
138 Future<AnalysisDoneReason> analysisFuture = | 142 Future<AnalysisDoneReason> analysisFuture = |
139 server.onFileAnalysisComplete(file); | 143 server.onFileAnalysisComplete(file); |
140 if (analysisFuture == null) { | 144 if (analysisFuture == null) { |
141 return new Response.getNavigationInvalidFile(request); | 145 return new Response.getNavigationInvalidFile(request); |
142 } | 146 } |
143 analysisFuture.then((AnalysisDoneReason reason) { | 147 analysisFuture.then((AnalysisDoneReason reason) { |
144 switch (reason) { | 148 switch (reason) { |
145 case AnalysisDoneReason.COMPLETE: | 149 case AnalysisDoneReason.COMPLETE: |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 context.onResultChanged(descriptor).listen((result) { | 414 context.onResultChanged(descriptor).listen((result) { |
411 StreamController<engine.ResultChangedEvent> controller = | 415 StreamController<engine.ResultChangedEvent> controller = |
412 controllers[result.descriptor]; | 416 controllers[result.descriptor]; |
413 if (controller != null) { | 417 if (controller != null) { |
414 controller.add(result); | 418 controller.add(result); |
415 } | 419 } |
416 }); | 420 }); |
417 } | 421 } |
418 } | 422 } |
419 } | 423 } |
OLD | NEW |