| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * Implement the `analysis.getNavigation` request. | 145 * Implement the `analysis.getNavigation` request. |
| 146 */ | 146 */ |
| 147 Future<Null> getNavigation(Request request) async { | 147 Future<Null> getNavigation(Request request) async { |
| 148 var params = new AnalysisGetNavigationParams.fromRequest(request); | 148 var params = new AnalysisGetNavigationParams.fromRequest(request); |
| 149 String file = params.file; | 149 String file = params.file; |
| 150 | 150 |
| 151 if (server.options.enableNewAnalysisDriver) { | 151 if (server.options.enableNewAnalysisDriver) { |
| 152 AnalysisDriver driver = server.getContainingDriver(file); | 152 AnalysisDriver driver = server.getAnalysisDriver(file); |
| 153 if (driver == null) { | 153 if (driver == null) { |
| 154 server.sendResponse(new Response.getNavigationInvalidFile(request)); | 154 server.sendResponse(new Response.getNavigationInvalidFile(request)); |
| 155 } else { | 155 } else { |
| 156 AnalysisResult result = await server.getAnalysisResult(file); | 156 AnalysisResult result = await server.getAnalysisResult(file); |
| 157 CompilationUnit unit = result?.unit; | 157 CompilationUnit unit = result?.unit; |
| 158 if (unit == null || !result.exists) { | 158 if (unit == null || !result.exists) { |
| 159 server.sendResponse(new Response.getNavigationInvalidFile(request)); | 159 server.sendResponse(new Response.getNavigationInvalidFile(request)); |
| 160 } else { | 160 } else { |
| 161 NavigationCollectorImpl collector = new NavigationCollectorImpl(); | 161 NavigationCollectorImpl collector = new NavigationCollectorImpl(); |
| 162 computeDartNavigation(collector, unit, params.offset, params.length); | 162 computeDartNavigation(collector, unit, params.offset, params.length); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 context.onResultChanged(descriptor).listen((result) { | 441 context.onResultChanged(descriptor).listen((result) { |
| 442 StreamController<engine.ResultChangedEvent> controller = | 442 StreamController<engine.ResultChangedEvent> controller = |
| 443 controllers[result.descriptor]; | 443 controllers[result.descriptor]; |
| 444 if (controller != null) { | 444 if (controller != null) { |
| 445 controller.add(result); | 445 controller.add(result); |
| 446 } | 446 } |
| 447 }); | 447 }); |
| 448 } | 448 } |
| 449 } | 449 } |
| 450 } | 450 } |
| OLD | NEW |