| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 .toResponse(request.id)); | 166 .toResponse(request.id)); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 return; | 169 return; |
| 170 } | 170 } |
| 171 | 171 |
| 172 Future<AnalysisDoneReason> analysisFuture = | 172 Future<AnalysisDoneReason> analysisFuture = |
| 173 server.onFileAnalysisComplete(file); | 173 server.onFileAnalysisComplete(file); |
| 174 if (analysisFuture == null) { | 174 if (analysisFuture == null) { |
| 175 server.sendResponse(new Response.getNavigationInvalidFile(request)); | 175 server.sendResponse(new Response.getNavigationInvalidFile(request)); |
| 176 return; |
| 176 } | 177 } |
| 177 analysisFuture.then((AnalysisDoneReason reason) async { | 178 analysisFuture.then((AnalysisDoneReason reason) async { |
| 178 switch (reason) { | 179 switch (reason) { |
| 179 case AnalysisDoneReason.COMPLETE: | 180 case AnalysisDoneReason.COMPLETE: |
| 180 CompilationUnit unit = await server.getResolvedCompilationUnit(file); | 181 CompilationUnit unit = await server.getResolvedCompilationUnit(file); |
| 181 if (unit == null) { | 182 if (unit == null) { |
| 182 server.sendResponse(new Response.getNavigationInvalidFile(request)); | 183 server.sendResponse(new Response.getNavigationInvalidFile(request)); |
| 183 } else { | 184 } else { |
| 184 CompilationUnitElement unitElement = unit.element; | 185 CompilationUnitElement unitElement = unit.element; |
| 185 NavigationCollectorImpl collector = computeNavigation( | 186 NavigationCollectorImpl collector = computeNavigation( |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 context.onResultChanged(descriptor).listen((result) { | 441 context.onResultChanged(descriptor).listen((result) { |
| 441 StreamController<engine.ResultChangedEvent> controller = | 442 StreamController<engine.ResultChangedEvent> controller = |
| 442 controllers[result.descriptor]; | 443 controllers[result.descriptor]; |
| 443 if (controller != null) { | 444 if (controller != null) { |
| 444 controller.add(result); | 445 controller.add(result); |
| 445 } | 446 } |
| 446 }); | 447 }); |
| 447 } | 448 } |
| 448 } | 449 } |
| 449 } | 450 } |
| OLD | NEW |