Index: pkg/analysis_server/lib/src/domain_analysis.dart |
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart |
index 955f0ced429856013711b7a754d0fdf6430fbac1..483f5321b21c155f5e47d264b53d0de4a56488a3 100644 |
--- a/pkg/analysis_server/lib/src/domain_analysis.dart |
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart |
@@ -118,48 +118,33 @@ class AnalysisDomainHandler implements RequestHandler { |
return new Response.getNavigationInvalidFile(request); |
} |
analysisFuture.then((AnalysisDoneReason reason) { |
- print(' reason: $reason'); |
- try { |
- switch (reason) { |
- case AnalysisDoneReason.COMPLETE: |
- print(' AnalysisDoneReason.COMPLETE'); |
- List<CompilationUnit> units = |
- server.getResolvedCompilationUnits(file); |
- print(' units: $units'); |
- if (units.isEmpty) { |
- server |
- .sendResponse(new Response.getNavigationInvalidFile(request)); |
- } else { |
- DartUnitNavigationComputer computer = |
- new DartUnitNavigationComputer(); |
- _GetNavigationAstVisitor visitor = new _GetNavigationAstVisitor( |
- params.offset, params.offset + params.length, computer); |
- for (CompilationUnit unit in units) { |
- unit.accept(visitor); |
- } |
- server.sendResponse(new AnalysisGetNavigationResult( |
- computer.files, computer.targets, computer.regions) |
- .toResponse(request.id)); |
- } |
- break; |
- case AnalysisDoneReason.CONTEXT_REMOVED: |
- print(' AnalysisDoneReason.CONTEXT_REMOVED'); |
- // The active contexts have changed, so try again. |
- Response response = getNavigation(request); |
- if (response != Response.DELAYED_RESPONSE) { |
- server.sendResponse(response); |
+ switch (reason) { |
+ case AnalysisDoneReason.COMPLETE: |
+ List<CompilationUnit> units = |
+ server.getResolvedCompilationUnits(file); |
+ if (units.isEmpty) { |
+ server.sendResponse(new Response.getNavigationInvalidFile(request)); |
+ } else { |
+ DartUnitNavigationComputer computer = |
+ new DartUnitNavigationComputer(); |
+ _GetNavigationAstVisitor visitor = new _GetNavigationAstVisitor( |
+ params.offset, params.offset + params.length, computer); |
+ for (CompilationUnit unit in units) { |
+ unit.accept(visitor); |
} |
- break; |
- } |
- } on Exception catch (e, st) { |
- print('Exception1 in AnalysisDomainHandler.getNavigation()'); |
- print(e); |
- print(st); |
+ server.sendResponse(new AnalysisGetNavigationResult( |
+ computer.files, computer.targets, computer.regions) |
+ .toResponse(request.id)); |
+ } |
+ break; |
+ case AnalysisDoneReason.CONTEXT_REMOVED: |
+ // The active contexts have changed, so try again. |
+ Response response = getNavigation(request); |
+ if (response != Response.DELAYED_RESPONSE) { |
+ server.sendResponse(response); |
+ } |
+ break; |
} |
- }).catchError((e, st) { |
- print('Exception2 in AnalysisDomainHandler.getNavigation()'); |
- print(e); |
- print(st); |
}); |
// delay response |
return Response.DELAYED_RESPONSE; |