| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement; | 10 import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement; |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 {String content, bool withErrors: true, CompilationUnit resolvedUnit}) { | 841 {String content, bool withErrors: true, CompilationUnit resolvedUnit}) { |
| 842 var unit = new AnalysisDriverResolvedUnit.fromBuffer(bytes); | 842 var unit = new AnalysisDriverResolvedUnit.fromBuffer(bytes); |
| 843 List<AnalysisError> errors = withErrors | 843 List<AnalysisError> errors = withErrors |
| 844 ? _getErrorsFromSerialized(file, unit.errors) | 844 ? _getErrorsFromSerialized(file, unit.errors) |
| 845 : const <AnalysisError>[]; | 845 : const <AnalysisError>[]; |
| 846 return new AnalysisResult( | 846 return new AnalysisResult( |
| 847 this, | 847 this, |
| 848 _sourceFactory, | 848 _sourceFactory, |
| 849 file.path, | 849 file.path, |
| 850 file.uri, | 850 file.uri, |
| 851 file.exists, |
| 851 content, | 852 content, |
| 852 file.contentHash, | 853 file.contentHash, |
| 853 file.lineInfo, | 854 file.lineInfo, |
| 854 resolvedUnit, | 855 resolvedUnit, |
| 855 errors, | 856 errors, |
| 856 unit.index); | 857 unit.index); |
| 857 } | 858 } |
| 858 | 859 |
| 859 /** | 860 /** |
| 860 * Return [AnalysisError]s for the given [serialized] errors. | 861 * Return [AnalysisError]s for the given [serialized] errors. |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 final String path; | 1305 final String path; |
| 1305 | 1306 |
| 1306 /** | 1307 /** |
| 1307 * The URI of the file that corresponded to the [path] in the used | 1308 * The URI of the file that corresponded to the [path] in the used |
| 1308 * [SourceFactory] at some point. Is it not guaranteed to be still consistent | 1309 * [SourceFactory] at some point. Is it not guaranteed to be still consistent |
| 1309 * to the [path], and provided as FYI. | 1310 * to the [path], and provided as FYI. |
| 1310 */ | 1311 */ |
| 1311 final Uri uri; | 1312 final Uri uri; |
| 1312 | 1313 |
| 1313 /** | 1314 /** |
| 1315 * Return `true` if the file exists. |
| 1316 */ |
| 1317 final bool exists; |
| 1318 |
| 1319 /** |
| 1314 * The content of the file that was scanned, parsed and resolved. | 1320 * The content of the file that was scanned, parsed and resolved. |
| 1315 */ | 1321 */ |
| 1316 final String content; | 1322 final String content; |
| 1317 | 1323 |
| 1318 /** | 1324 /** |
| 1319 * The MD5 hash of the [content]. | 1325 * The MD5 hash of the [content]. |
| 1320 */ | 1326 */ |
| 1321 final String contentHash; | 1327 final String contentHash; |
| 1322 | 1328 |
| 1323 /** | 1329 /** |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1338 /** | 1344 /** |
| 1339 * The index of the unit. | 1345 * The index of the unit. |
| 1340 */ | 1346 */ |
| 1341 final AnalysisDriverUnitIndex _index; | 1347 final AnalysisDriverUnitIndex _index; |
| 1342 | 1348 |
| 1343 AnalysisResult( | 1349 AnalysisResult( |
| 1344 this.driver, | 1350 this.driver, |
| 1345 this.sourceFactory, | 1351 this.sourceFactory, |
| 1346 this.path, | 1352 this.path, |
| 1347 this.uri, | 1353 this.uri, |
| 1354 this.exists, |
| 1348 this.content, | 1355 this.content, |
| 1349 this.contentHash, | 1356 this.contentHash, |
| 1350 this.lineInfo, | 1357 this.lineInfo, |
| 1351 this.unit, | 1358 this.unit, |
| 1352 this.errors, | 1359 this.errors, |
| 1353 this._index); | 1360 this._index); |
| 1354 } | 1361 } |
| 1355 | 1362 |
| 1356 /** | 1363 /** |
| 1357 * Exception that happened during analysis. | 1364 * Exception that happened during analysis. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 libraryDeclarations.add(new TopLevelDeclarationInSource( | 1619 libraryDeclarations.add(new TopLevelDeclarationInSource( |
| 1613 file.source, declaration, isExported)); | 1620 file.source, declaration, isExported)); |
| 1614 } | 1621 } |
| 1615 } | 1622 } |
| 1616 } | 1623 } |
| 1617 | 1624 |
| 1618 // We're not done yet. | 1625 // We're not done yet. |
| 1619 return false; | 1626 return false; |
| 1620 } | 1627 } |
| 1621 } | 1628 } |
| OLD | NEW |