Skip to content

Commit e47b915

Browse files
author
Dart CI
committed
Version 2.18.0-238.0.dev
Merge commit 'fd185c0dec8386aa52481de388b989bb944fd8b3' into 'dev'
2 parents be6c0ba + fd185c0 commit e47b915

File tree

20 files changed

+434
-317
lines changed

20 files changed

+434
-317
lines changed

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
777777
}
778778

779779
var units = <ParsedUnitResult>[];
780-
for (var unitFile in file.libraryFiles) {
780+
for (var unitFile in kind.files) {
781781
var unitPath = unitFile.path;
782782
var unitResult = parseFileSync(unitPath);
783783
if (unitResult is! ParsedUnitResult) {
@@ -1707,11 +1707,20 @@ class AnalysisDriver implements AnalysisDriverGeneric {
17071707
CaughtException caught = CaughtException(exception, stackTrace);
17081708

17091709
var fileContentMap = <String, String>{};
1710-
var libraryFile = _fsState.getFileForPath(path);
1710+
1711+
var fileContent = '';
17111712
try {
1712-
for (var file in libraryFile.libraryFiles) {
1713-
var path = file.path;
1714-
fileContentMap[path] = file.content;
1713+
final file = _fsState.getFileForPath(path);
1714+
fileContent = file.content;
1715+
final fileKind = file.kind;
1716+
final libraryKind = fileKind.library;
1717+
if (libraryKind != null) {
1718+
for (final file in libraryKind.files) {
1719+
fileContentMap[file.path] = file.content;
1720+
}
1721+
} else {
1722+
final file = fileKind.file;
1723+
fileContentMap[file.path] = file.content;
17151724
}
17161725
} catch (_) {
17171726
// We might get an exception while parsing to access parts.
@@ -1728,7 +1737,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
17281737
ExceptionResult(
17291738
filePath: path,
17301739
fileContentMap: fileContentMap,
1731-
fileContent: libraryFile.content,
1740+
fileContent: fileContent,
17321741
exception: caught,
17331742
contextKey: contextKey,
17341743
),

0 commit comments

Comments
 (0)