| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer_cli.src.analyzer_impl; | 5 library analyzer_cli.src.analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return await _analyze(printMode); | 125 return await _analyze(printMode); |
| 126 } | 126 } |
| 127 | 127 |
| 128 /// Fills [errorInfos] using [sources]. | 128 /// Fills [errorInfos] using [sources]. |
| 129 Future<Null> prepareErrors() async { | 129 Future<Null> prepareErrors() async { |
| 130 PerformanceTag previous = _prepareErrorsTag.makeCurrent(); | 130 PerformanceTag previous = _prepareErrorsTag.makeCurrent(); |
| 131 try { | 131 try { |
| 132 for (Source source in sources) { | 132 for (Source source in sources) { |
| 133 if (analysisDriver != null) { | 133 if (analysisDriver != null) { |
| 134 String path = source.fullName; | 134 String path = source.fullName; |
| 135 analysisDriver.addFile(path); |
| 135 ErrorsResult errorsResult = await analysisDriver.getErrors(path); | 136 ErrorsResult errorsResult = await analysisDriver.getErrors(path); |
| 136 errorInfos.add(new AnalysisErrorInfoImpl( | 137 errorInfos.add(new AnalysisErrorInfoImpl( |
| 137 errorsResult.errors, errorsResult.lineInfo)); | 138 errorsResult.errors, errorsResult.lineInfo)); |
| 138 } else { | 139 } else { |
| 139 context.computeErrors(source); | 140 context.computeErrors(source); |
| 140 errorInfos.add(context.getErrors(source)); | 141 errorInfos.add(context.getErrors(source)); |
| 141 } | 142 } |
| 142 } | 143 } |
| 143 } finally { | 144 } finally { |
| 144 previous.makeCurrent(); | 145 previous.makeCurrent(); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 380 } |
| 380 | 381 |
| 381 @override | 382 @override |
| 382 void logInformation(String message, [CaughtException exception]) { | 383 void logInformation(String message, [CaughtException exception]) { |
| 383 outSink.writeln(message); | 384 outSink.writeln(message); |
| 384 if (exception != null) { | 385 if (exception != null) { |
| 385 outSink.writeln(exception); | 386 outSink.writeln(exception); |
| 386 } | 387 } |
| 387 } | 388 } |
| 388 } | 389 } |
| OLD | NEW |