| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } else { | 60 } else { |
| 61 List<AnalysisError> protocolErrors = | 61 List<AnalysisError> protocolErrors = |
| 62 doAnalysisError_listFromEngine(analysisOptions, lineInfo, errors); | 62 doAnalysisError_listFromEngine(analysisOptions, lineInfo, errors); |
| 63 server.sendResponse( | 63 server.sendResponse( |
| 64 new AnalysisGetErrorsResult(protocolErrors).toResponse(request.id)); | 64 new AnalysisGetErrorsResult(protocolErrors).toResponse(request.id)); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 if (server.options.enableNewAnalysisDriver) { | 68 if (server.options.enableNewAnalysisDriver) { |
| 69 var result = await server.getAnalysisResult(file); | 69 var result = await server.getAnalysisResult(file); |
| 70 |
| 71 if (server.onResultErrorSupplementor != null) { |
| 72 if (result != null) { |
| 73 await server.onResultErrorSupplementor(file, result.errors); |
| 74 } else { |
| 75 server.onNoAnalysisResult(file, send); |
| 76 return; |
| 77 } |
| 78 } |
| 79 |
| 70 send(result?.driver?.analysisOptions, result?.lineInfo, result?.errors); | 80 send(result?.driver?.analysisOptions, result?.lineInfo, result?.errors); |
| 71 return; | 81 return; |
| 72 } | 82 } |
| 73 | 83 |
| 74 Future<AnalysisDoneReason> completionFuture = | 84 Future<AnalysisDoneReason> completionFuture = |
| 75 server.onFileAnalysisComplete(file); | 85 server.onFileAnalysisComplete(file); |
| 76 if (completionFuture == null) { | 86 if (completionFuture == null) { |
| 77 server.sendResponse(new Response.getErrorsInvalidFile(request)); | 87 server.sendResponse(new Response.getErrorsInvalidFile(request)); |
| 78 } | 88 } |
| 79 completionFuture.then((AnalysisDoneReason reason) async { | 89 completionFuture.then((AnalysisDoneReason reason) async { |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 context.onResultChanged(descriptor).listen((result) { | 451 context.onResultChanged(descriptor).listen((result) { |
| 442 StreamController<engine.ResultChangedEvent> controller = | 452 StreamController<engine.ResultChangedEvent> controller = |
| 443 controllers[result.descriptor]; | 453 controllers[result.descriptor]; |
| 444 if (controller != null) { | 454 if (controller != null) { |
| 445 controller.add(result); | 455 controller.add(result); |
| 446 } | 456 } |
| 447 }); | 457 }); |
| 448 } | 458 } |
| 449 } | 459 } |
| 450 } | 460 } |
| OLD | NEW |