| 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' hide Resource; | 8 import 'dart:core' hide Resource; |
| 9 | 9 |
| 10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; | 10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return new Response.getErrorsInvalidFile(request); | 58 return new Response.getErrorsInvalidFile(request); |
| 59 } | 59 } |
| 60 completionFuture.then((AnalysisDoneReason reason) { | 60 completionFuture.then((AnalysisDoneReason reason) { |
| 61 switch (reason) { | 61 switch (reason) { |
| 62 case AnalysisDoneReason.COMPLETE: | 62 case AnalysisDoneReason.COMPLETE: |
| 63 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); | 63 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); |
| 64 List<AnalysisError> errors; | 64 List<AnalysisError> errors; |
| 65 if (errorInfo == null) { | 65 if (errorInfo == null) { |
| 66 server.sendResponse(new Response.getErrorsInvalidFile(request)); | 66 server.sendResponse(new Response.getErrorsInvalidFile(request)); |
| 67 } else { | 67 } else { |
| 68 errors = doAnalysisError_listFromEngine( | 68 engine.AnalysisContext context = server.getAnalysisContext(file); |
| 69 errors = doAnalysisError_listFromEngine(context, |
| 69 errorInfo.lineInfo, errorInfo.errors); | 70 errorInfo.lineInfo, errorInfo.errors); |
| 70 server.sendResponse( | 71 server.sendResponse( |
| 71 new AnalysisGetErrorsResult(errors).toResponse(request.id)); | 72 new AnalysisGetErrorsResult(errors).toResponse(request.id)); |
| 72 } | 73 } |
| 73 break; | 74 break; |
| 74 case AnalysisDoneReason.CONTEXT_REMOVED: | 75 case AnalysisDoneReason.CONTEXT_REMOVED: |
| 75 // The active contexts have changed, so try again. | 76 // The active contexts have changed, so try again. |
| 76 Response response = getErrors(request); | 77 Response response = getErrors(request); |
| 77 if (response != Response.DELAYED_RESPONSE) { | 78 if (response != Response.DELAYED_RESPONSE) { |
| 78 server.sendResponse(response); | 79 server.sendResponse(response); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 context.onResultComputed(descriptor).listen((result) { | 401 context.onResultComputed(descriptor).listen((result) { |
| 401 StreamController<engine.ComputedResult> controller = | 402 StreamController<engine.ComputedResult> controller = |
| 402 controllers[result.descriptor]; | 403 controllers[result.descriptor]; |
| 403 if (controller != null) { | 404 if (controller != null) { |
| 404 controller.add(result); | 405 controller.add(result); |
| 405 } | 406 } |
| 406 }); | 407 }); |
| 407 } | 408 } |
| 408 } | 409 } |
| 409 } | 410 } |
| OLD | NEW |