| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 ProcessedSeverity _processError(AnalysisError error) => | 260 ProcessedSeverity _processError(AnalysisError error) => |
| 261 processError(error, options, analysisOptions); | 261 processError(error, options, analysisOptions); |
| 262 | 262 |
| 263 Future<LibraryElement> _resolveLibrary() async { | 263 Future<LibraryElement> _resolveLibrary() async { |
| 264 PerformanceTag previous = _resolveLibraryTag.makeCurrent(); | 264 PerformanceTag previous = _resolveLibraryTag.makeCurrent(); |
| 265 try { | 265 try { |
| 266 if (analysisDriver != null) { | 266 if (analysisDriver != null) { |
| 267 String path = librarySource.fullName; | 267 String path = librarySource.fullName; |
| 268 analysisDriver.priorityFiles = [path]; | 268 analysisDriver.priorityFiles = [path]; |
| 269 UnitElementResult elementResult = | 269 AnalysisResult analysisResult = await analysisDriver.getResult(path); |
| 270 await analysisDriver.getUnitElement(path); | 270 return analysisResult.unit.element.library; |
| 271 return elementResult.element.library; | |
| 272 } else { | 271 } else { |
| 273 return context.computeLibraryElement(librarySource); | 272 return context.computeLibraryElement(librarySource); |
| 274 } | 273 } |
| 275 } finally { | 274 } finally { |
| 276 previous.makeCurrent(); | 275 previous.makeCurrent(); |
| 277 } | 276 } |
| 278 } | 277 } |
| 279 | 278 |
| 280 /// Compute the severity of the error; however: | 279 /// Compute the severity of the error; however: |
| 281 /// * if [options.enableTypeChecks] is false, then de-escalate checked-mode | 280 /// * if [options.enableTypeChecks] is false, then de-escalate checked-mode |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 383 } |
| 385 | 384 |
| 386 @override | 385 @override |
| 387 void logInformation(String message, [CaughtException exception]) { | 386 void logInformation(String message, [CaughtException exception]) { |
| 388 outSink.writeln(message); | 387 outSink.writeln(message); |
| 389 if (exception != null) { | 388 if (exception != null) { |
| 390 outSink.writeln(exception); | 389 outSink.writeln(exception); |
| 391 } | 390 } |
| 392 } | 391 } |
| 393 } | 392 } |
| OLD | NEW |