mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
Renames for FileState kinds / directives.
Change-Id: Ia024eb8922b06a0bdb37321f76a7527dc7e3c117 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251740 Reviewed-by: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
55f22572d7
commit
eddd4f4427
|
@ -90,7 +90,7 @@ class _CiderDartFixContextImpl extends DartFixContextImpl {
|
|||
var files = _fileResolver.getFilesWithTopLevelDeclarations(name);
|
||||
for (var file in files) {
|
||||
final kind = file.kind;
|
||||
if (kind is LibraryFileStateKind) {
|
||||
if (kind is LibraryFileKind) {
|
||||
var libraryElement = await _fileResolver.getLibraryByUri2(
|
||||
uriStr: file.uriStr,
|
||||
);
|
||||
|
|
|
@ -85,7 +85,7 @@ import 'package:analyzer/src/util/performance/operation_performance.dart';
|
|||
/// TODO(scheglov) Clean up the list of implicitly analyzed files.
|
||||
class AnalysisDriver implements AnalysisDriverGeneric {
|
||||
/// The version of data format, should be incremented on every format change.
|
||||
static const int DATA_VERSION = 235;
|
||||
static const int DATA_VERSION = 236;
|
||||
|
||||
/// The number of exception contexts allowed to write. Once this field is
|
||||
/// zero, we stop writing any new exception contexts in this process.
|
||||
|
@ -167,7 +167,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
/// The mapping from the files for which analysis was requested using
|
||||
/// [getResolvedLibrary] to the [Completer]s to report the result.
|
||||
final _requestedLibraries =
|
||||
<LibraryFileStateKind, List<Completer<ResolvedLibraryResult>>>{};
|
||||
<LibraryFileKind, List<Completer<ResolvedLibraryResult>>>{};
|
||||
|
||||
/// The queue of requests for completion.
|
||||
final List<_ResolveForCompletionRequest> _resolveForCompletionRequests = [];
|
||||
|
@ -728,10 +728,10 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
}
|
||||
|
||||
final kind = file.kind;
|
||||
if (kind is LibraryFileStateKind) {
|
||||
} else if (kind is AugmentationFileStateKind) {
|
||||
if (kind is LibraryFileKind) {
|
||||
} else if (kind is AugmentationFileKind) {
|
||||
return NotLibraryButAugmentationResult();
|
||||
} else if (kind is PartFileStateKind) {
|
||||
} else if (kind is PartFileKind) {
|
||||
return NotLibraryButPartResult();
|
||||
} else {
|
||||
throw UnimplementedError('(${kind.runtimeType}) $kind');
|
||||
|
@ -783,10 +783,10 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
|
||||
final file = _fsState.getFileForPath(path);
|
||||
final kind = file.kind;
|
||||
if (kind is LibraryFileStateKind) {
|
||||
} else if (kind is AugmentationFileStateKind) {
|
||||
if (kind is LibraryFileKind) {
|
||||
} else if (kind is AugmentationFileKind) {
|
||||
return NotLibraryButAugmentationResult();
|
||||
} else if (kind is PartFileStateKind) {
|
||||
} else if (kind is PartFileKind) {
|
||||
return NotLibraryButPartResult();
|
||||
} else {
|
||||
throw UnimplementedError('(${kind.runtimeType}) $kind');
|
||||
|
@ -846,16 +846,16 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
|
||||
final file = _fsState.getFileForPath(path);
|
||||
final kind = file.kind;
|
||||
if (kind is LibraryFileStateKind) {
|
||||
if (kind is LibraryFileKind) {
|
||||
final completer = Completer<ResolvedLibraryResult>();
|
||||
_requestedLibraries
|
||||
.putIfAbsent(kind, () => <Completer<ResolvedLibraryResult>>[])
|
||||
.add(completer);
|
||||
_scheduler.notify(this);
|
||||
return completer.future;
|
||||
} else if (kind is AugmentationFileStateKind) {
|
||||
} else if (kind is AugmentationFileKind) {
|
||||
return NotLibraryButAugmentationResult();
|
||||
} else if (kind is PartFileStateKind) {
|
||||
} else if (kind is PartFileKind) {
|
||||
return NotLibraryButPartResult();
|
||||
} else {
|
||||
throw UnimplementedError('(${kind.runtimeType}) $kind');
|
||||
|
@ -1399,7 +1399,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
/// Return the newly computed resolution result of the library with the
|
||||
/// given [path].
|
||||
Future<ResolvedLibraryResultImpl> _computeResolvedLibrary(
|
||||
LibraryFileStateKind library,
|
||||
LibraryFileKind library,
|
||||
) async {
|
||||
final path = library.file.path;
|
||||
return _logger.runAsync('Compute resolved library $path', () async {
|
||||
|
@ -1532,7 +1532,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
|
||||
_fsState.getFileForUri(Uri.parse('dart:core')).map(
|
||||
(file) {
|
||||
final kind = file?.kind as LibraryFileStateKind;
|
||||
final kind = file?.kind as LibraryFileKind;
|
||||
kind.discoverReferencedFiles();
|
||||
},
|
||||
(externalLibrary) {},
|
||||
|
@ -1641,8 +1641,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
|
||||
/// Return the signature that identifies fully resolved results for the [file]
|
||||
/// in the [library], e.g. element model, errors, index, etc.
|
||||
String _getResolvedUnitSignature(
|
||||
LibraryFileStateKind library, FileState file) {
|
||||
String _getResolvedUnitSignature(LibraryFileKind library, FileState file) {
|
||||
ApiSignature signature = ApiSignature();
|
||||
signature.addUint32List(_saltForResolution);
|
||||
signature.addString(library.file.uriStr);
|
||||
|
@ -1709,7 +1708,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
// TODO(scheglov) Eventually list of `LibraryOrAugmentationFileKind`.
|
||||
for (final file in affected) {
|
||||
final kind = file.kind;
|
||||
if (kind is LibraryFileStateKind) {
|
||||
if (kind is LibraryFileKind) {
|
||||
kind.invalidateLibraryCycle();
|
||||
}
|
||||
accumulatedAffected.add(file.path);
|
||||
|
@ -1834,7 +1833,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
|
|||
.toBuffer();
|
||||
}
|
||||
|
||||
String? _storeExceptionContext(String path, LibraryFileStateKind library,
|
||||
String? _storeExceptionContext(String path, LibraryFileKind library,
|
||||
Object exception, StackTrace stackTrace) {
|
||||
if (allowedNumberOfContextsToWrite <= 0) {
|
||||
return null;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -65,7 +65,7 @@ class AnalysisForCompletionResult {
|
|||
class LibraryAnalyzer {
|
||||
final AnalysisOptionsImpl _analysisOptions;
|
||||
final DeclaredVariables _declaredVariables;
|
||||
final LibraryFileStateKind _library;
|
||||
final LibraryFileKind _library;
|
||||
final InheritanceManager3 _inheritance;
|
||||
|
||||
final LibraryElementImpl _libraryElement;
|
||||
|
@ -537,7 +537,7 @@ class LibraryAnalyzer {
|
|||
libraryFile: libraryUnit,
|
||||
};
|
||||
for (final part in _library.parts) {
|
||||
if (part is PartDirectiveWithFile) {
|
||||
if (part is PartWithFile) {
|
||||
final partFile = part.includedPart?.file;
|
||||
if (partFile != null) {
|
||||
units[partFile] = _parse(partFile);
|
||||
|
@ -583,7 +583,7 @@ class LibraryAnalyzer {
|
|||
_resolveImportDirective(
|
||||
directive: directive,
|
||||
importElement: _libraryElement.imports2[importIndex],
|
||||
importState: _library.imports[importIndex],
|
||||
importState: _library.libraryImports[importIndex],
|
||||
libraryErrorReporter: libraryErrorReporter,
|
||||
);
|
||||
importIndex++;
|
||||
|
@ -591,7 +591,7 @@ class LibraryAnalyzer {
|
|||
_resolveExportDirective(
|
||||
directive: directive,
|
||||
exportElement: _libraryElement.exports2[exportIndex],
|
||||
exportState: _library.exports[exportIndex],
|
||||
exportState: _library.libraryExports[exportIndex],
|
||||
libraryErrorReporter: libraryErrorReporter,
|
||||
);
|
||||
exportIndex++;
|
||||
|
@ -622,7 +622,7 @@ class LibraryAnalyzer {
|
|||
void _resolveExportDirective({
|
||||
required ExportDirectiveImpl directive,
|
||||
required ExportElement2 exportElement,
|
||||
required ExportDirectiveState exportState,
|
||||
required LibraryExportState exportState,
|
||||
required ErrorReporter libraryErrorReporter,
|
||||
}) {
|
||||
directive.element = exportElement;
|
||||
|
@ -634,7 +634,7 @@ class LibraryAnalyzer {
|
|||
configurationUris: exportState.uris.configurations,
|
||||
selectedUriState: exportState.selectedUri,
|
||||
);
|
||||
if (exportState is ExportDirectiveWithUri) {
|
||||
if (exportState is LibraryExportWithUri) {
|
||||
final selectedUriStr = exportState.selectedUri.relativeUriStr;
|
||||
if (selectedUriStr.startsWith('dart-ext:')) {
|
||||
libraryErrorReporter.reportErrorForNode(
|
||||
|
@ -650,7 +650,7 @@ class LibraryAnalyzer {
|
|||
directive.uri,
|
||||
[selectedUriStr],
|
||||
);
|
||||
} else if (exportState is ExportDirectiveWithFile &&
|
||||
} else if (exportState is LibraryExportWithFile &&
|
||||
!exportState.exportedFile.exists) {
|
||||
final errorCode = isGeneratedSource(exportState.exportedSource)
|
||||
? CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED
|
||||
|
@ -716,7 +716,7 @@ class LibraryAnalyzer {
|
|||
void _resolveImportDirective({
|
||||
required ImportDirectiveImpl directive,
|
||||
required ImportElement2 importElement,
|
||||
required ImportDirectiveState importState,
|
||||
required LibraryImportState importState,
|
||||
required ErrorReporter libraryErrorReporter,
|
||||
}) {
|
||||
directive.element = importElement;
|
||||
|
@ -729,7 +729,7 @@ class LibraryAnalyzer {
|
|||
configurationUris: importState.uris.configurations,
|
||||
selectedUriState: importState.selectedUri,
|
||||
);
|
||||
if (importState is ImportDirectiveWithUri) {
|
||||
if (importState is LibraryImportWithUri) {
|
||||
final selectedUriStr = importState.selectedUri.relativeUriStr;
|
||||
if (selectedUriStr.startsWith('dart-ext:')) {
|
||||
libraryErrorReporter.reportErrorForNode(
|
||||
|
@ -745,7 +745,7 @@ class LibraryAnalyzer {
|
|||
directive.uri,
|
||||
[selectedUriStr],
|
||||
);
|
||||
} else if (importState is ImportDirectiveWithFile &&
|
||||
} else if (importState is LibraryImportWithFile &&
|
||||
!importState.importedFile.exists) {
|
||||
final errorCode = isGeneratedSource(importState.importedSource)
|
||||
? CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED
|
||||
|
@ -814,7 +814,7 @@ class LibraryAnalyzer {
|
|||
final partElement = _libraryElement.parts2[index];
|
||||
directive.element = partElement;
|
||||
|
||||
if (partState is! PartDirectiveWithUri) {
|
||||
if (partState is! PartWithUri) {
|
||||
libraryErrorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.URI_WITH_INTERPOLATION,
|
||||
directive.uri,
|
||||
|
@ -822,7 +822,7 @@ class LibraryAnalyzer {
|
|||
return;
|
||||
}
|
||||
|
||||
if (partState is! PartDirectiveWithFile) {
|
||||
if (partState is! PartWithFile) {
|
||||
final errorCode = partState.uri.isValid
|
||||
? CompileTimeErrorCode.URI_DOES_NOT_EXIST
|
||||
: CompileTimeErrorCode.INVALID_URI;
|
||||
|
@ -836,7 +836,7 @@ class LibraryAnalyzer {
|
|||
final includedFile = partState.includedFile;
|
||||
final includedKind = includedFile.kind;
|
||||
|
||||
if (includedKind is! PartFileStateKind) {
|
||||
if (includedKind is! PartFileKind) {
|
||||
if (includedFile.exists) {
|
||||
libraryErrorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.PART_OF_NON_PART,
|
||||
|
@ -856,9 +856,9 @@ class LibraryAnalyzer {
|
|||
return;
|
||||
}
|
||||
|
||||
if (includedKind is PartOfNameFileStateKind) {
|
||||
if (includedKind is PartOfNameFileKind) {
|
||||
if (!includedKind.libraries.contains(_library)) {
|
||||
final name = includedKind.directive.name;
|
||||
final name = includedKind.unlinked.name;
|
||||
if (libraryNameNode == null) {
|
||||
libraryErrorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.PART_OF_UNNAMED_LIBRARY,
|
||||
|
|
|
@ -89,7 +89,7 @@ class LibraryContext {
|
|||
|
||||
/// Computes a [CompilationUnitElement] for the given library/unit pair.
|
||||
CompilationUnitElementImpl computeUnitElement(
|
||||
LibraryFileStateKind library,
|
||||
LibraryFileKind library,
|
||||
FileState unit,
|
||||
) {
|
||||
var reference = elementFactory.rootReference
|
||||
|
@ -117,7 +117,7 @@ class LibraryContext {
|
|||
|
||||
/// Load data required to access elements of the given [targetLibrary].
|
||||
Future<void> load({
|
||||
required LibraryFileStateKind targetLibrary,
|
||||
required LibraryFileKind targetLibrary,
|
||||
required OperationPerformanceImpl performance,
|
||||
}) async {
|
||||
addToLogRing('[load][targetLibrary: ${targetLibrary.file}]');
|
||||
|
|
|
@ -12,7 +12,7 @@ import 'package:collection/collection.dart';
|
|||
|
||||
/// Ensure that the [FileState.libraryCycle] for the [file] and anything it
|
||||
/// depends on is computed.
|
||||
void computeLibraryCycle(Uint32List salt, LibraryFileStateKind file) {
|
||||
void computeLibraryCycle(Uint32List salt, LibraryFileKind file) {
|
||||
var libraryWalker = _LibraryWalker(salt);
|
||||
libraryWalker.walk(libraryWalker.getNode(file));
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class LibraryCycle {
|
|||
final int id = _nextId++;
|
||||
|
||||
/// The libraries that belong to this cycle.
|
||||
final List<LibraryFileStateKind> libraries;
|
||||
final List<LibraryFileKind> libraries;
|
||||
|
||||
/// The library cycles that this cycle references directly.
|
||||
final Set<LibraryCycle> directDependencies;
|
||||
|
@ -130,7 +130,7 @@ class LibraryCycle {
|
|||
/// Node in [_LibraryWalker].
|
||||
class _LibraryNode extends graph.Node<_LibraryNode> {
|
||||
final _LibraryWalker walker;
|
||||
final LibraryFileStateKind kind;
|
||||
final LibraryFileKind kind;
|
||||
|
||||
_LibraryNode(this.walker, this.kind);
|
||||
|
||||
|
@ -139,13 +139,13 @@ class _LibraryNode extends graph.Node<_LibraryNode> {
|
|||
|
||||
@override
|
||||
List<_LibraryNode> computeDependencies() {
|
||||
final referencedLibraries = {kind, ...kind.allAugmentations}
|
||||
final referencedLibraries = {kind, ...kind.augmentations}
|
||||
.map((container) => [
|
||||
...container.imports
|
||||
.whereType<ImportDirectiveWithFile>()
|
||||
...container.libraryImports
|
||||
.whereType<LibraryImportWithFile>()
|
||||
.map((import) => import.importedLibrary),
|
||||
...container.exports
|
||||
.whereType<ExportDirectiveWithFile>()
|
||||
...container.libraryExports
|
||||
.whereType<LibraryExportWithFile>()
|
||||
.map((export) => export.exportedLibrary),
|
||||
])
|
||||
.expand((libraries) => libraries)
|
||||
|
@ -160,7 +160,7 @@ class _LibraryNode extends graph.Node<_LibraryNode> {
|
|||
/// sorted [LibraryCycle]s.
|
||||
class _LibraryWalker extends graph.DependencyWalker<_LibraryNode> {
|
||||
final Uint32List _salt;
|
||||
final Map<LibraryFileStateKind, _LibraryNode> nodesOfFiles = {};
|
||||
final Map<LibraryFileKind, _LibraryNode> nodesOfFiles = {};
|
||||
|
||||
_LibraryWalker(this._salt);
|
||||
|
||||
|
@ -195,7 +195,7 @@ class _LibraryWalker extends graph.DependencyWalker<_LibraryNode> {
|
|||
}
|
||||
|
||||
// Fill the cycle with libraries.
|
||||
var libraries = <LibraryFileStateKind>[];
|
||||
var libraries = <LibraryFileKind>[];
|
||||
for (var node in scc) {
|
||||
final file = node.kind.file;
|
||||
libraries.add(node.kind);
|
||||
|
@ -239,7 +239,7 @@ class _LibraryWalker extends graph.DependencyWalker<_LibraryNode> {
|
|||
}
|
||||
}
|
||||
|
||||
_LibraryNode getNode(LibraryFileStateKind file) {
|
||||
_LibraryNode getNode(LibraryFileKind file) {
|
||||
return nodesOfFiles.putIfAbsent(file, () => _LibraryNode(this, file));
|
||||
}
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ class Search {
|
|||
if (searchedFiles.add(libraryPath, this)) {
|
||||
final libraryFile = _driver.fsState.getFileForPath(libraryPath);
|
||||
final libraryKind = libraryFile.kind;
|
||||
if (libraryKind is LibraryFileStateKind) {
|
||||
if (libraryKind is LibraryFileKind) {
|
||||
for (final file in libraryKind.files) {
|
||||
if (file.path == path || file.referencedNames.contains(name)) {
|
||||
files.add(file.path);
|
||||
|
|
|
@ -90,6 +90,34 @@ class MacroClass {
|
|||
}
|
||||
}
|
||||
|
||||
class UnlinkedAugmentationImportDirective {
|
||||
final int augmentKeywordOffset;
|
||||
final int importKeywordOffset;
|
||||
final String? uri;
|
||||
|
||||
UnlinkedAugmentationImportDirective({
|
||||
required this.augmentKeywordOffset,
|
||||
required this.importKeywordOffset,
|
||||
required this.uri,
|
||||
});
|
||||
|
||||
factory UnlinkedAugmentationImportDirective.read(
|
||||
SummaryDataReader reader,
|
||||
) {
|
||||
return UnlinkedAugmentationImportDirective(
|
||||
augmentKeywordOffset: reader.readUInt30(),
|
||||
importKeywordOffset: reader.readUInt30(),
|
||||
uri: reader.readOptionalStringUtf8(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeUInt30(augmentKeywordOffset);
|
||||
sink.writeUInt30(importKeywordOffset);
|
||||
sink.writeOptionalStringUtf8(uri);
|
||||
}
|
||||
}
|
||||
|
||||
class UnlinkedCombinator {
|
||||
final int keywordOffset;
|
||||
final int endOffset;
|
||||
|
@ -120,157 +148,6 @@ class UnlinkedCombinator {
|
|||
}
|
||||
}
|
||||
|
||||
/// Unlinked information about an `export` directive.
|
||||
class UnlinkedExportDirective extends UnlinkedNamespaceDirective {
|
||||
final int exportKeywordOffset;
|
||||
|
||||
UnlinkedExportDirective({
|
||||
required super.combinators,
|
||||
required super.configurations,
|
||||
required this.exportKeywordOffset,
|
||||
required super.uri,
|
||||
});
|
||||
|
||||
factory UnlinkedExportDirective.read(SummaryDataReader reader) {
|
||||
return UnlinkedExportDirective(
|
||||
combinators: reader.readTypedList(
|
||||
() => UnlinkedCombinator.read(reader),
|
||||
),
|
||||
configurations: reader.readTypedList(
|
||||
() => UnlinkedNamespaceDirectiveConfiguration.read(reader),
|
||||
),
|
||||
exportKeywordOffset: reader.readUInt30(),
|
||||
uri: reader.readOptionalStringUtf8(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeList<UnlinkedCombinator>(
|
||||
combinators,
|
||||
(x) => x.write(sink),
|
||||
);
|
||||
sink.writeList<UnlinkedNamespaceDirectiveConfiguration>(
|
||||
configurations,
|
||||
(x) {
|
||||
x.write(sink);
|
||||
},
|
||||
);
|
||||
sink.writeUInt30(exportKeywordOffset);
|
||||
sink.writeOptionalStringUtf8(uri);
|
||||
}
|
||||
}
|
||||
|
||||
class UnlinkedImportAugmentationDirective {
|
||||
final int augmentKeywordOffset;
|
||||
final int importKeywordOffset;
|
||||
final String? uri;
|
||||
|
||||
UnlinkedImportAugmentationDirective({
|
||||
required this.augmentKeywordOffset,
|
||||
required this.importKeywordOffset,
|
||||
required this.uri,
|
||||
});
|
||||
|
||||
factory UnlinkedImportAugmentationDirective.read(
|
||||
SummaryDataReader reader,
|
||||
) {
|
||||
return UnlinkedImportAugmentationDirective(
|
||||
augmentKeywordOffset: reader.readUInt30(),
|
||||
importKeywordOffset: reader.readUInt30(),
|
||||
uri: reader.readOptionalStringUtf8(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeUInt30(augmentKeywordOffset);
|
||||
sink.writeUInt30(importKeywordOffset);
|
||||
sink.writeOptionalStringUtf8(uri);
|
||||
}
|
||||
}
|
||||
|
||||
/// Unlinked information about an 'import' directive.
|
||||
class UnlinkedImportDirective extends UnlinkedNamespaceDirective {
|
||||
final int importKeywordOffset;
|
||||
final bool isSyntheticDartCore;
|
||||
final UnlinkedImportDirectivePrefix? prefix;
|
||||
|
||||
UnlinkedImportDirective({
|
||||
required super.combinators,
|
||||
required super.configurations,
|
||||
required this.importKeywordOffset,
|
||||
this.isSyntheticDartCore = false,
|
||||
required this.prefix,
|
||||
required super.uri,
|
||||
});
|
||||
|
||||
factory UnlinkedImportDirective.read(SummaryDataReader reader) {
|
||||
return UnlinkedImportDirective(
|
||||
combinators: reader.readTypedList(
|
||||
() => UnlinkedCombinator.read(reader),
|
||||
),
|
||||
configurations: reader.readTypedList(
|
||||
() => UnlinkedNamespaceDirectiveConfiguration.read(reader),
|
||||
),
|
||||
importKeywordOffset: reader.readUInt30() - 1,
|
||||
isSyntheticDartCore: reader.readBool(),
|
||||
prefix: reader.readOptionalObject(
|
||||
UnlinkedImportDirectivePrefix.read,
|
||||
),
|
||||
uri: reader.readOptionalStringUtf8(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeList<UnlinkedCombinator>(
|
||||
combinators,
|
||||
(x) => x.write(sink),
|
||||
);
|
||||
sink.writeList<UnlinkedNamespaceDirectiveConfiguration>(
|
||||
configurations,
|
||||
(x) {
|
||||
x.write(sink);
|
||||
},
|
||||
);
|
||||
sink.writeUInt30(1 + importKeywordOffset);
|
||||
sink.writeBool(isSyntheticDartCore);
|
||||
sink.writeOptionalObject<UnlinkedImportDirectivePrefix>(
|
||||
prefix,
|
||||
(x) => x.write(sink),
|
||||
);
|
||||
sink.writeOptionalStringUtf8(uri);
|
||||
}
|
||||
}
|
||||
|
||||
class UnlinkedImportDirectivePrefix {
|
||||
final int? deferredOffset;
|
||||
final int asOffset;
|
||||
final String name;
|
||||
final int nameOffset;
|
||||
|
||||
UnlinkedImportDirectivePrefix({
|
||||
required this.deferredOffset,
|
||||
required this.asOffset,
|
||||
required this.name,
|
||||
required this.nameOffset,
|
||||
});
|
||||
|
||||
factory UnlinkedImportDirectivePrefix.read(SummaryDataReader reader) {
|
||||
return UnlinkedImportDirectivePrefix(
|
||||
deferredOffset: reader.readOptionalUInt30(),
|
||||
asOffset: reader.readUInt30(),
|
||||
name: reader.readStringUtf8(),
|
||||
nameOffset: reader.readUInt30(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeOptionalUInt30(deferredOffset);
|
||||
sink.writeUInt30(asOffset);
|
||||
sink.writeStringUtf8(name);
|
||||
sink.writeUInt30(nameOffset);
|
||||
}
|
||||
}
|
||||
|
||||
class UnlinkedLibraryAugmentationDirective {
|
||||
final int augmentKeywordOffset;
|
||||
final int libraryKeywordOffset;
|
||||
|
@ -323,6 +200,129 @@ class UnlinkedLibraryDirective {
|
|||
}
|
||||
}
|
||||
|
||||
/// Unlinked information about an `export` directive.
|
||||
class UnlinkedLibraryExportDirective extends UnlinkedNamespaceDirective {
|
||||
final int exportKeywordOffset;
|
||||
|
||||
UnlinkedLibraryExportDirective({
|
||||
required super.combinators,
|
||||
required super.configurations,
|
||||
required this.exportKeywordOffset,
|
||||
required super.uri,
|
||||
});
|
||||
|
||||
factory UnlinkedLibraryExportDirective.read(SummaryDataReader reader) {
|
||||
return UnlinkedLibraryExportDirective(
|
||||
combinators: reader.readTypedList(
|
||||
() => UnlinkedCombinator.read(reader),
|
||||
),
|
||||
configurations: reader.readTypedList(
|
||||
() => UnlinkedNamespaceDirectiveConfiguration.read(reader),
|
||||
),
|
||||
exportKeywordOffset: reader.readUInt30(),
|
||||
uri: reader.readOptionalStringUtf8(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeList<UnlinkedCombinator>(
|
||||
combinators,
|
||||
(x) => x.write(sink),
|
||||
);
|
||||
sink.writeList<UnlinkedNamespaceDirectiveConfiguration>(
|
||||
configurations,
|
||||
(x) {
|
||||
x.write(sink);
|
||||
},
|
||||
);
|
||||
sink.writeUInt30(exportKeywordOffset);
|
||||
sink.writeOptionalStringUtf8(uri);
|
||||
}
|
||||
}
|
||||
|
||||
/// Unlinked information about an 'import' directive.
|
||||
class UnlinkedLibraryImportDirective extends UnlinkedNamespaceDirective {
|
||||
final int importKeywordOffset;
|
||||
final bool isSyntheticDartCore;
|
||||
final UnlinkedLibraryImportPrefix? prefix;
|
||||
|
||||
UnlinkedLibraryImportDirective({
|
||||
required super.combinators,
|
||||
required super.configurations,
|
||||
required this.importKeywordOffset,
|
||||
this.isSyntheticDartCore = false,
|
||||
required this.prefix,
|
||||
required super.uri,
|
||||
});
|
||||
|
||||
factory UnlinkedLibraryImportDirective.read(SummaryDataReader reader) {
|
||||
return UnlinkedLibraryImportDirective(
|
||||
combinators: reader.readTypedList(
|
||||
() => UnlinkedCombinator.read(reader),
|
||||
),
|
||||
configurations: reader.readTypedList(
|
||||
() => UnlinkedNamespaceDirectiveConfiguration.read(reader),
|
||||
),
|
||||
importKeywordOffset: reader.readUInt30() - 1,
|
||||
isSyntheticDartCore: reader.readBool(),
|
||||
prefix: reader.readOptionalObject(
|
||||
UnlinkedLibraryImportPrefix.read,
|
||||
),
|
||||
uri: reader.readOptionalStringUtf8(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeList<UnlinkedCombinator>(
|
||||
combinators,
|
||||
(x) => x.write(sink),
|
||||
);
|
||||
sink.writeList<UnlinkedNamespaceDirectiveConfiguration>(
|
||||
configurations,
|
||||
(x) {
|
||||
x.write(sink);
|
||||
},
|
||||
);
|
||||
sink.writeUInt30(1 + importKeywordOffset);
|
||||
sink.writeBool(isSyntheticDartCore);
|
||||
sink.writeOptionalObject<UnlinkedLibraryImportPrefix>(
|
||||
prefix,
|
||||
(x) => x.write(sink),
|
||||
);
|
||||
sink.writeOptionalStringUtf8(uri);
|
||||
}
|
||||
}
|
||||
|
||||
class UnlinkedLibraryImportPrefix {
|
||||
final int? deferredOffset;
|
||||
final int asOffset;
|
||||
final String name;
|
||||
final int nameOffset;
|
||||
|
||||
UnlinkedLibraryImportPrefix({
|
||||
required this.deferredOffset,
|
||||
required this.asOffset,
|
||||
required this.name,
|
||||
required this.nameOffset,
|
||||
});
|
||||
|
||||
factory UnlinkedLibraryImportPrefix.read(SummaryDataReader reader) {
|
||||
return UnlinkedLibraryImportPrefix(
|
||||
deferredOffset: reader.readOptionalUInt30(),
|
||||
asOffset: reader.readUInt30(),
|
||||
name: reader.readStringUtf8(),
|
||||
nameOffset: reader.readUInt30(),
|
||||
);
|
||||
}
|
||||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeOptionalUInt30(deferredOffset);
|
||||
sink.writeUInt30(asOffset);
|
||||
sink.writeStringUtf8(name);
|
||||
sink.writeUInt30(nameOffset);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class UnlinkedNamespaceDirective {
|
||||
final List<UnlinkedCombinator> combinators;
|
||||
final List<UnlinkedNamespaceDirectiveConfiguration> configurations;
|
||||
|
@ -481,13 +481,13 @@ class UnlinkedUnit {
|
|||
final Uint8List apiSignature;
|
||||
|
||||
/// `import augmentation` directives.
|
||||
final List<UnlinkedImportAugmentationDirective> augmentations;
|
||||
final List<UnlinkedAugmentationImportDirective> augmentations;
|
||||
|
||||
/// `export` directives.
|
||||
final List<UnlinkedExportDirective> exports;
|
||||
final List<UnlinkedLibraryExportDirective> exports;
|
||||
|
||||
/// `import` directives.
|
||||
final List<UnlinkedImportDirective> imports;
|
||||
final List<UnlinkedLibraryImportDirective> imports;
|
||||
|
||||
/// Encoded informative data.
|
||||
final Uint8List informativeBytes;
|
||||
|
@ -536,13 +536,13 @@ class UnlinkedUnit {
|
|||
return UnlinkedUnit(
|
||||
apiSignature: reader.readUint8List(),
|
||||
augmentations: reader.readTypedList(
|
||||
() => UnlinkedImportAugmentationDirective.read(reader),
|
||||
() => UnlinkedAugmentationImportDirective.read(reader),
|
||||
),
|
||||
exports: reader.readTypedList(
|
||||
() => UnlinkedExportDirective.read(reader),
|
||||
() => UnlinkedLibraryExportDirective.read(reader),
|
||||
),
|
||||
imports: reader.readTypedList(
|
||||
() => UnlinkedImportDirective.read(reader),
|
||||
() => UnlinkedLibraryImportDirective.read(reader),
|
||||
),
|
||||
informativeBytes: reader.readUint8List(),
|
||||
libraryAugmentationDirective: reader.readOptionalObject(
|
||||
|
@ -570,13 +570,13 @@ class UnlinkedUnit {
|
|||
|
||||
void write(BufferedSink sink) {
|
||||
sink.writeUint8List(apiSignature);
|
||||
sink.writeList<UnlinkedImportAugmentationDirective>(augmentations, (x) {
|
||||
sink.writeList<UnlinkedAugmentationImportDirective>(augmentations, (x) {
|
||||
x.write(sink);
|
||||
});
|
||||
sink.writeList<UnlinkedExportDirective>(exports, (x) {
|
||||
sink.writeList<UnlinkedLibraryExportDirective>(exports, (x) {
|
||||
x.write(sink);
|
||||
});
|
||||
sink.writeList<UnlinkedImportDirective>(imports, (x) {
|
||||
sink.writeList<UnlinkedLibraryImportDirective>(imports, (x) {
|
||||
x.write(sink);
|
||||
});
|
||||
sink.writeUint8List(informativeBytes);
|
||||
|
|
|
@ -317,7 +317,7 @@ class FileResolver {
|
|||
);
|
||||
var file = fileContext.file;
|
||||
// TODO(scheglov) Casts are unsafe.
|
||||
final kind = file.kind as LibraryFileStateKind;
|
||||
final kind = file.kind as LibraryFileKind;
|
||||
|
||||
final errorsSignatureBuilder = ApiSignature();
|
||||
errorsSignatureBuilder.addString(kind.libraryCycle.apiSignature);
|
||||
|
@ -413,7 +413,7 @@ class FileResolver {
|
|||
var file = fileContext.file;
|
||||
|
||||
final kind = file.kind;
|
||||
if (kind is! LibraryFileStateKind) {
|
||||
if (kind is! LibraryFileKind) {
|
||||
throw ArgumentError('$uri is not a library.');
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ class FileResolver {
|
|||
);
|
||||
|
||||
// TODO(scheglov) Casts are unsafe.
|
||||
final kind = file.kind as LibraryFileStateKind;
|
||||
final kind = file.kind as LibraryFileKind;
|
||||
return kind.libraryCycle.apiSignature;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class ImplicitEnumNodes {
|
|||
|
||||
class LibraryBuilder {
|
||||
final Linker linker;
|
||||
final LibraryFileStateKind kind;
|
||||
final LibraryFileKind kind;
|
||||
final Uri uri;
|
||||
final Reference reference;
|
||||
final LibraryElementImpl element;
|
||||
|
@ -437,10 +437,10 @@ class LibraryBuilder {
|
|||
|
||||
AugmentationImportElementImpl _buildAugmentationImport(
|
||||
LibraryOrAugmentationElementImpl augmentedElement,
|
||||
ImportAugmentationDirectiveState state,
|
||||
AugmentationImportState state,
|
||||
) {
|
||||
final DirectiveUri uri;
|
||||
if (state is ImportAugmentationDirectiveWithFile) {
|
||||
if (state is AugmentationImportWithFile) {
|
||||
final importedAugmentation = state.importedAugmentation;
|
||||
if (importedAugmentation != null) {
|
||||
final importedFile = importedAugmentation.file;
|
||||
|
@ -460,7 +460,7 @@ class LibraryBuilder {
|
|||
|
||||
final augmentation = LibraryAugmentationElementImpl(
|
||||
augmented: augmentedElement,
|
||||
nameOffset: importedAugmentation.directive.libraryKeywordOffset,
|
||||
nameOffset: importedAugmentation.unlinked.libraryKeywordOffset,
|
||||
);
|
||||
augmentation.definingCompilationUnit = unitElement;
|
||||
|
||||
|
@ -508,7 +508,7 @@ class LibraryBuilder {
|
|||
}
|
||||
|
||||
return AugmentationImportElementImpl(
|
||||
importKeywordOffset: state.directive.importKeywordOffset,
|
||||
importKeywordOffset: state.unlinked.importKeywordOffset,
|
||||
uri: uri,
|
||||
);
|
||||
}
|
||||
|
@ -535,21 +535,21 @@ class LibraryBuilder {
|
|||
required LibraryOrAugmentationFileKind kind,
|
||||
required LibraryOrAugmentationElementImpl element,
|
||||
}) {
|
||||
element.exports2 = kind.exports.map(_buildExport).toList();
|
||||
element.imports2 = kind.imports.map(_buildImport).toList();
|
||||
element.exports2 = kind.libraryExports.map(_buildExport).toList();
|
||||
element.imports2 = kind.libraryImports.map(_buildImport).toList();
|
||||
|
||||
element.augmentationImports = kind.augmentations.map((state) {
|
||||
element.augmentationImports = kind.augmentationImports.map((state) {
|
||||
return _buildAugmentationImport(element, state);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
ExportElement2Impl _buildExport(ExportDirectiveState state) {
|
||||
ExportElement2Impl _buildExport(LibraryExportState state) {
|
||||
final combinators = _buildCombinators(
|
||||
state.directive.combinators,
|
||||
state.unlinked.combinators,
|
||||
);
|
||||
|
||||
final DirectiveUri uri;
|
||||
if (state is ExportDirectiveWithFile) {
|
||||
if (state is LibraryExportWithFile) {
|
||||
final exportedLibraryKind = state.exportedLibrary;
|
||||
if (exportedLibraryKind != null) {
|
||||
final exportedFile = exportedLibraryKind.file;
|
||||
|
@ -569,7 +569,7 @@ class LibraryBuilder {
|
|||
source: state.exportedSource,
|
||||
);
|
||||
}
|
||||
} else if (state is ExportDirectiveWithInSummarySource) {
|
||||
} else if (state is LibraryExportWithInSummarySource) {
|
||||
final exportedLibrarySource = state.exportedLibrarySource;
|
||||
if (exportedLibrarySource != null) {
|
||||
final exportedUri = exportedLibrarySource.uri;
|
||||
|
@ -605,13 +605,13 @@ class LibraryBuilder {
|
|||
}
|
||||
|
||||
return ExportElement2Impl(
|
||||
exportKeywordOffset: state.directive.exportKeywordOffset,
|
||||
exportKeywordOffset: state.unlinked.exportKeywordOffset,
|
||||
uri: uri,
|
||||
)..combinators = combinators;
|
||||
}
|
||||
|
||||
ImportElement2Impl _buildImport(ImportDirectiveState state) {
|
||||
final importPrefix = state.directive.prefix.mapOrNull((unlinked) {
|
||||
ImportElement2Impl _buildImport(LibraryImportState state) {
|
||||
final importPrefix = state.unlinked.prefix.mapOrNull((unlinked) {
|
||||
if (unlinked.deferredOffset != null) {
|
||||
return DeferredImportElementPrefixImpl(
|
||||
element: _buildPrefix(
|
||||
|
@ -630,11 +630,11 @@ class LibraryBuilder {
|
|||
});
|
||||
|
||||
final combinators = _buildCombinators(
|
||||
state.directive.combinators,
|
||||
state.unlinked.combinators,
|
||||
);
|
||||
|
||||
final DirectiveUri uri;
|
||||
if (state is ImportDirectiveWithFile) {
|
||||
if (state is LibraryImportWithFile) {
|
||||
final importedLibraryKind = state.importedLibrary;
|
||||
if (importedLibraryKind != null) {
|
||||
final importedFile = importedLibraryKind.file;
|
||||
|
@ -654,7 +654,7 @@ class LibraryBuilder {
|
|||
source: state.importedSource,
|
||||
);
|
||||
}
|
||||
} else if (state is ImportDirectiveWithInSummarySource) {
|
||||
} else if (state is LibraryImportWithInSummarySource) {
|
||||
final importedLibrarySource = state.importedLibrarySource;
|
||||
if (importedLibrarySource != null) {
|
||||
final importedUri = importedLibrarySource.uri;
|
||||
|
@ -690,7 +690,7 @@ class LibraryBuilder {
|
|||
}
|
||||
|
||||
return ImportElement2Impl(
|
||||
importKeywordOffset: state.directive.importKeywordOffset,
|
||||
importKeywordOffset: state.unlinked.importKeywordOffset,
|
||||
uri: uri,
|
||||
prefix: importPrefix,
|
||||
)
|
||||
|
@ -730,7 +730,7 @@ class LibraryBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
static void build(Linker linker, LibraryFileStateKind inputLibrary) {
|
||||
static void build(Linker linker, LibraryFileKind inputLibrary) {
|
||||
final elementFactory = linker.elementFactory;
|
||||
final rootReference = linker.rootReference;
|
||||
|
||||
|
@ -797,7 +797,7 @@ class LibraryBuilder {
|
|||
final uriState = partState.uri;
|
||||
|
||||
final DirectiveUri directiveUri;
|
||||
if (partState is PartDirectiveWithFile) {
|
||||
if (partState is PartWithFile) {
|
||||
final includedPart = partState.includedPart;
|
||||
if (includedPart != null) {
|
||||
final partFile = includedPart.file;
|
||||
|
|
|
@ -30,7 +30,7 @@ import 'package:analyzer/src/util/performance/operation_performance.dart';
|
|||
Future<LinkResult> link({
|
||||
required LinkedElementFactory elementFactory,
|
||||
required OperationPerformanceImpl performance,
|
||||
required List<LibraryFileStateKind> inputLibraries,
|
||||
required List<LibraryFileKind> inputLibraries,
|
||||
macro.MultiMacroExecutor? macroExecutor,
|
||||
}) async {
|
||||
final linker = Linker(elementFactory, macroExecutor);
|
||||
|
@ -85,7 +85,7 @@ class Linker {
|
|||
|
||||
Future<void> link({
|
||||
required OperationPerformanceImpl performance,
|
||||
required List<LibraryFileStateKind> inputLibraries,
|
||||
required List<LibraryFileKind> inputLibraries,
|
||||
}) async {
|
||||
for (var inputLibrary in inputLibraries) {
|
||||
LibraryBuilder.build(this, inputLibrary);
|
||||
|
|
|
@ -93,12 +93,12 @@ class AnalyzerStatePrinter {
|
|||
_indent = indent;
|
||||
}
|
||||
|
||||
void _writeAugmentations(LibraryOrAugmentationFileKind container) {
|
||||
_writeElements<ImportAugmentationDirectiveState>(
|
||||
'augmentations',
|
||||
container.augmentations,
|
||||
void _writeAugmentationImports(LibraryOrAugmentationFileKind container) {
|
||||
_writeElements<AugmentationImportState>(
|
||||
'augmentationImports',
|
||||
container.augmentationImports,
|
||||
(import) {
|
||||
if (import is ImportAugmentationDirectiveWithFile) {
|
||||
if (import is AugmentationImportWithFile) {
|
||||
expect(import.container, same(container));
|
||||
final file = import.importedFile;
|
||||
sink.write(_indent);
|
||||
|
@ -106,12 +106,12 @@ class AnalyzerStatePrinter {
|
|||
final importedAugmentation = import.importedAugmentation;
|
||||
if (importedAugmentation != null) {
|
||||
expect(importedAugmentation.file, file);
|
||||
sink.write(idProvider.fileStateKind(importedAugmentation));
|
||||
sink.write(idProvider.fileKind(importedAugmentation));
|
||||
} else {
|
||||
sink.write('notAugmentation ${idProvider.fileState(file)}');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (import is ImportAugmentationWithUri) {
|
||||
} else if (import is AugmentationImportWithUri) {
|
||||
final uriStr = _stringOfUriStr(import.uri.relativeUriStr);
|
||||
_writelnWithIndent('uri: $uriStr');
|
||||
} else {
|
||||
|
@ -171,115 +171,16 @@ class AnalyzerStatePrinter {
|
|||
});
|
||||
}
|
||||
|
||||
void _writeFileExports(LibraryOrAugmentationFileKind container) {
|
||||
_writeElements<ExportDirectiveState>(
|
||||
'exports',
|
||||
container.exports,
|
||||
(export) {
|
||||
if (export is ExportDirectiveWithFile) {
|
||||
expect(export.container, same(container));
|
||||
final file = export.exportedFile;
|
||||
sink.write(_indent);
|
||||
|
||||
final exportedLibrary = export.exportedLibrary;
|
||||
if (exportedLibrary != null) {
|
||||
expect(exportedLibrary.file, file);
|
||||
sink.write(idProvider.fileStateKind(exportedLibrary));
|
||||
} else {
|
||||
sink.write('notLibrary ${idProvider.fileState(file)}');
|
||||
}
|
||||
|
||||
if (omitSdkFiles && file.uri.isScheme('dart')) {
|
||||
sink.write(' ${file.uri}');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (export is ExportDirectiveWithInSummarySource) {
|
||||
sink.write(_indent);
|
||||
sink.write('inSummary ${export.exportedSource.uri}');
|
||||
|
||||
final librarySource = export.exportedLibrarySource;
|
||||
if (librarySource != null) {
|
||||
expect(librarySource, same(export.exportedSource));
|
||||
} else {
|
||||
sink.write(' notLibrary');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (export is ExportDirectiveWithUri) {
|
||||
final uriStr = _stringOfUriStr(export.selectedUri.relativeUriStr);
|
||||
_writelnWithIndent('uri: $uriStr');
|
||||
} else {
|
||||
_writelnWithIndent('noUri');
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _writeFileImports(LibraryOrAugmentationFileKind container) {
|
||||
_writeElements<ImportDirectiveState>(
|
||||
'imports',
|
||||
container.imports,
|
||||
(import) {
|
||||
if (import is ImportDirectiveWithFile) {
|
||||
expect(import.container, same(container));
|
||||
final file = import.importedFile;
|
||||
sink.write(_indent);
|
||||
|
||||
final importedLibrary = import.importedLibrary;
|
||||
if (importedLibrary != null) {
|
||||
expect(importedLibrary.file, file);
|
||||
sink.write(idProvider.fileStateKind(importedLibrary));
|
||||
} else {
|
||||
sink.write('notLibrary ${idProvider.fileState(file)}');
|
||||
}
|
||||
|
||||
if (omitSdkFiles && file.uri.isScheme('dart')) {
|
||||
sink.write(' ${file.uri}');
|
||||
}
|
||||
|
||||
if (import.isSyntheticDartCore) {
|
||||
sink.write(' synthetic');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (import is ImportDirectiveWithInSummarySource) {
|
||||
sink.write(_indent);
|
||||
sink.write('inSummary ${import.importedSource.uri}');
|
||||
|
||||
final librarySource = import.importedLibrarySource;
|
||||
if (librarySource != null) {
|
||||
expect(librarySource, same(import.importedSource));
|
||||
} else {
|
||||
sink.write(' notLibrary');
|
||||
}
|
||||
|
||||
if (import.isSyntheticDartCore) {
|
||||
sink.write(' synthetic');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (import is ImportDirectiveWithUri) {
|
||||
final uriStr = _stringOfUriStr(import.selectedUri.relativeUriStr);
|
||||
sink.write(_indent);
|
||||
sink.write('uri: $uriStr');
|
||||
if (import.isSyntheticDartCore) {
|
||||
sink.write(' synthetic');
|
||||
}
|
||||
sink.writeln();
|
||||
} else {
|
||||
_writelnWithIndent('noUri');
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _writeFileKind(FileState file) {
|
||||
final kind = file.kind;
|
||||
expect(kind.file, same(file));
|
||||
|
||||
_writelnWithIndent('kind: ${idProvider.fileStateKind(kind)}');
|
||||
if (kind is AugmentationKnownFileStateKind) {
|
||||
_writelnWithIndent('kind: ${idProvider.fileKind(kind)}');
|
||||
if (kind is AugmentationKnownFileKind) {
|
||||
_withIndent(() {
|
||||
final augmented = kind.augmented;
|
||||
if (augmented != null) {
|
||||
final id = idProvider.fileStateKind(augmented);
|
||||
final id = idProvider.fileKind(augmented);
|
||||
_writelnWithIndent('augmented: $id');
|
||||
} else {
|
||||
final id = idProvider.fileState(kind.uriFile);
|
||||
|
@ -288,19 +189,19 @@ class AnalyzerStatePrinter {
|
|||
|
||||
final library = kind.library;
|
||||
if (library != null) {
|
||||
final id = idProvider.fileStateKind(library);
|
||||
final id = idProvider.fileKind(library);
|
||||
_writelnWithIndent('library: $id');
|
||||
}
|
||||
|
||||
_writeFileImports(kind);
|
||||
_writeFileExports(kind);
|
||||
_writeAugmentations(kind);
|
||||
_writeLibraryImports(kind);
|
||||
_writeLibraryExports(kind);
|
||||
_writeAugmentationImports(kind);
|
||||
});
|
||||
} else if (kind is AugmentationUnknownFileStateKind) {
|
||||
} else if (kind is AugmentationUnknownFileKind) {
|
||||
_withIndent(() {
|
||||
_writelnWithIndent('uri: ${kind.directive.uri}');
|
||||
_writelnWithIndent('uri: ${kind.unlinked.uri}');
|
||||
});
|
||||
} else if (kind is LibraryFileStateKind) {
|
||||
} else if (kind is LibraryFileKind) {
|
||||
expect(kind.library, same(kind));
|
||||
|
||||
_withIndent(() {
|
||||
|
@ -309,18 +210,18 @@ class AnalyzerStatePrinter {
|
|||
_writelnWithIndent('name: $name');
|
||||
}
|
||||
|
||||
_writeFileImports(kind);
|
||||
_writeFileExports(kind);
|
||||
_writeLibraryImports(kind);
|
||||
_writeLibraryExports(kind);
|
||||
_writeAugmentationImports(kind);
|
||||
_writeLibraryParts(kind);
|
||||
_writeAugmentations(kind);
|
||||
_writeLibraryCycle(kind);
|
||||
});
|
||||
} else if (kind is PartOfNameFileStateKind) {
|
||||
} else if (kind is PartOfNameFileKind) {
|
||||
_withIndent(() {
|
||||
final libraries = kind.libraries;
|
||||
if (libraries.isNotEmpty) {
|
||||
final keys = libraries
|
||||
.map(idProvider.fileStateKind)
|
||||
.map(idProvider.fileKind)
|
||||
.sorted(compareNatural)
|
||||
.join(' ');
|
||||
_writelnWithIndent('libraries: $keys');
|
||||
|
@ -328,26 +229,26 @@ class AnalyzerStatePrinter {
|
|||
|
||||
final library = kind.library;
|
||||
if (library != null) {
|
||||
final id = idProvider.fileStateKind(library);
|
||||
final id = idProvider.fileKind(library);
|
||||
_writelnWithIndent('library: $id');
|
||||
} else {
|
||||
_writelnWithIndent('name: ${kind.directive.name}');
|
||||
_writelnWithIndent('name: ${kind.unlinked.name}');
|
||||
}
|
||||
});
|
||||
} else if (kind is PartOfUriKnownFileStateKind) {
|
||||
} else if (kind is PartOfUriKnownFileKind) {
|
||||
_withIndent(() {
|
||||
final library = kind.library;
|
||||
if (library != null) {
|
||||
final id = idProvider.fileStateKind(library);
|
||||
final id = idProvider.fileKind(library);
|
||||
_writelnWithIndent('library: $id');
|
||||
} else {
|
||||
final id = idProvider.fileState(kind.uriFile);
|
||||
_writelnWithIndent('uriFile: $id');
|
||||
}
|
||||
});
|
||||
} else if (kind is PartOfUriUnknownFileStateKind) {
|
||||
} else if (kind is PartOfUriUnknownFileKind) {
|
||||
_withIndent(() {
|
||||
_writelnWithIndent('uri: ${kind.directive.uri}');
|
||||
_writelnWithIndent('uri: ${kind.unlinked.uri}');
|
||||
expect(kind.library, isNull);
|
||||
});
|
||||
} else {
|
||||
|
@ -364,7 +265,7 @@ class AnalyzerStatePrinter {
|
|||
final current = fileSystemState.getExisting(fileData.file);
|
||||
if (current != null) {
|
||||
final kind = current.kind;
|
||||
if (kind is PartOfNameFileStateKind) {
|
||||
if (kind is PartOfNameFileKind) {
|
||||
kind.discoverLibraries();
|
||||
}
|
||||
}
|
||||
|
@ -416,8 +317,8 @@ class AnalyzerStatePrinter {
|
|||
if (current != null) {
|
||||
idProvider.registerFileState(current);
|
||||
final kind = current.kind;
|
||||
idProvider.registerFileStateKind(kind);
|
||||
if (kind is LibraryFileStateKind) {
|
||||
idProvider.registerFileKind(kind);
|
||||
if (kind is LibraryFileKind) {
|
||||
idProvider.registerLibraryCycle(kind.libraryCycle);
|
||||
}
|
||||
}
|
||||
|
@ -507,7 +408,7 @@ class AnalyzerStatePrinter {
|
|||
});
|
||||
}
|
||||
|
||||
void _writeLibraryCycle(LibraryFileStateKind library) {
|
||||
void _writeLibraryCycle(LibraryFileKind library) {
|
||||
final cycle = library.libraryCycle;
|
||||
_writelnWithIndent(idProvider.libraryCycle(cycle));
|
||||
|
||||
|
@ -527,7 +428,7 @@ class AnalyzerStatePrinter {
|
|||
}
|
||||
|
||||
final libraryIds = cycle.libraries
|
||||
.map(idProvider.fileStateKind)
|
||||
.map(idProvider.fileKind)
|
||||
.sorted(compareNatural)
|
||||
.join(' ');
|
||||
_writelnWithIndent('libraries: $libraryIds');
|
||||
|
@ -544,22 +445,121 @@ class AnalyzerStatePrinter {
|
|||
});
|
||||
}
|
||||
|
||||
void _writeLibraryParts(LibraryFileStateKind library) {
|
||||
_writeElements<PartDirectiveState>('parts', library.parts, (part) {
|
||||
void _writeLibraryExports(LibraryOrAugmentationFileKind container) {
|
||||
_writeElements<LibraryExportState>(
|
||||
'libraryExports',
|
||||
container.libraryExports,
|
||||
(export) {
|
||||
if (export is LibraryExportWithFile) {
|
||||
expect(export.container, same(container));
|
||||
final file = export.exportedFile;
|
||||
sink.write(_indent);
|
||||
|
||||
final exportedLibrary = export.exportedLibrary;
|
||||
if (exportedLibrary != null) {
|
||||
expect(exportedLibrary.file, file);
|
||||
sink.write(idProvider.fileKind(exportedLibrary));
|
||||
} else {
|
||||
sink.write('notLibrary ${idProvider.fileState(file)}');
|
||||
}
|
||||
|
||||
if (omitSdkFiles && file.uri.isScheme('dart')) {
|
||||
sink.write(' ${file.uri}');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (export is LibraryExportWithInSummarySource) {
|
||||
sink.write(_indent);
|
||||
sink.write('inSummary ${export.exportedSource.uri}');
|
||||
|
||||
final librarySource = export.exportedLibrarySource;
|
||||
if (librarySource != null) {
|
||||
expect(librarySource, same(export.exportedSource));
|
||||
} else {
|
||||
sink.write(' notLibrary');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (export is LibraryExportWithUri) {
|
||||
final uriStr = _stringOfUriStr(export.selectedUri.relativeUriStr);
|
||||
_writelnWithIndent('uri: $uriStr');
|
||||
} else {
|
||||
_writelnWithIndent('noUri');
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _writeLibraryImports(LibraryOrAugmentationFileKind container) {
|
||||
_writeElements<LibraryImportState>(
|
||||
'libraryImports',
|
||||
container.libraryImports,
|
||||
(import) {
|
||||
if (import is LibraryImportWithFile) {
|
||||
expect(import.container, same(container));
|
||||
final file = import.importedFile;
|
||||
sink.write(_indent);
|
||||
|
||||
final importedLibrary = import.importedLibrary;
|
||||
if (importedLibrary != null) {
|
||||
expect(importedLibrary.file, file);
|
||||
sink.write(idProvider.fileKind(importedLibrary));
|
||||
} else {
|
||||
sink.write('notLibrary ${idProvider.fileState(file)}');
|
||||
}
|
||||
|
||||
if (omitSdkFiles && file.uri.isScheme('dart')) {
|
||||
sink.write(' ${file.uri}');
|
||||
}
|
||||
|
||||
if (import.isSyntheticDartCore) {
|
||||
sink.write(' synthetic');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (import is LibraryImportWithInSummarySource) {
|
||||
sink.write(_indent);
|
||||
sink.write('inSummary ${import.importedSource.uri}');
|
||||
|
||||
final librarySource = import.importedLibrarySource;
|
||||
if (librarySource != null) {
|
||||
expect(librarySource, same(import.importedSource));
|
||||
} else {
|
||||
sink.write(' notLibrary');
|
||||
}
|
||||
|
||||
if (import.isSyntheticDartCore) {
|
||||
sink.write(' synthetic');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (import is LibraryImportWithUri) {
|
||||
final uriStr = _stringOfUriStr(import.selectedUri.relativeUriStr);
|
||||
sink.write(_indent);
|
||||
sink.write('uri: $uriStr');
|
||||
if (import.isSyntheticDartCore) {
|
||||
sink.write(' synthetic');
|
||||
}
|
||||
sink.writeln();
|
||||
} else {
|
||||
_writelnWithIndent('noUri');
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _writeLibraryParts(LibraryFileKind library) {
|
||||
_writeElements<PartState>('parts', library.parts, (part) {
|
||||
expect(part.library, same(library));
|
||||
if (part is PartDirectiveWithFile) {
|
||||
if (part is PartWithFile) {
|
||||
final file = part.includedFile;
|
||||
sink.write(_indent);
|
||||
|
||||
final includedPart = part.includedPart;
|
||||
if (includedPart != null) {
|
||||
expect(includedPart.file, file);
|
||||
sink.write(idProvider.fileStateKind(includedPart));
|
||||
sink.write(idProvider.fileKind(includedPart));
|
||||
} else {
|
||||
sink.write('notPart ${idProvider.fileState(file)}');
|
||||
}
|
||||
sink.writeln();
|
||||
} else if (part is PartDirectiveWithUri) {
|
||||
} else if (part is PartWithUri) {
|
||||
final uriStr = _stringOfUriStr(part.uri.relativeUriStr);
|
||||
_writelnWithIndent('uri: $uriStr');
|
||||
} else {
|
||||
|
@ -609,13 +609,13 @@ class AnalyzerStatePrinter {
|
|||
class IdProvider {
|
||||
final Map<FileState, String> _fileState = Map.identity();
|
||||
final Map<LibraryCycle, String> _libraryCycle = Map.identity();
|
||||
final Map<FileStateKind, String> _fileStateKind = Map.identity();
|
||||
final Map<FileKind, String> _fileKind = Map.identity();
|
||||
final Map<String, String> _keyToShort = {};
|
||||
final Map<String, String> _shortToKey = {};
|
||||
final Map<String, String> _apiSignature = {};
|
||||
|
||||
Set<FileState> _currentFiles = {};
|
||||
Set<FileStateKind> _currentKinds = {};
|
||||
Set<FileKind> _currentFileKinds = {};
|
||||
Set<LibraryCycle> _currentCycles = {};
|
||||
|
||||
String apiSignature(String signature) {
|
||||
|
@ -623,6 +623,29 @@ class IdProvider {
|
|||
return _apiSignature[signature] ??= 'apiSignature_$length';
|
||||
}
|
||||
|
||||
String fileKind(FileKind kind) {
|
||||
if (!_currentFileKinds.contains(kind)) {
|
||||
throw StateError('$kind');
|
||||
}
|
||||
return _fileKind[kind] ??= () {
|
||||
if (kind is AugmentationKnownFileKind) {
|
||||
return 'augmentation_${_fileKind.length}';
|
||||
} else if (kind is AugmentationUnknownFileKind) {
|
||||
return 'augmentationUnknown_${_fileKind.length}';
|
||||
} else if (kind is LibraryFileKind) {
|
||||
return 'library_${_fileKind.length}';
|
||||
} else if (kind is PartOfNameFileKind) {
|
||||
return 'partOfName_${_fileKind.length}';
|
||||
} else if (kind is PartOfUriKnownFileKind) {
|
||||
return 'partOfUriKnown_${_fileKind.length}';
|
||||
} else if (kind is PartFileKind) {
|
||||
return 'partOfUriUnknown_${_fileKind.length}';
|
||||
} else {
|
||||
throw UnimplementedError('${kind.runtimeType}');
|
||||
}
|
||||
}();
|
||||
}
|
||||
|
||||
String fileState(FileState file) {
|
||||
if (!_currentFiles.contains(file)) {
|
||||
throw StateError('$file');
|
||||
|
@ -630,29 +653,6 @@ class IdProvider {
|
|||
return _fileState[file] ??= 'file_${_fileState.length}';
|
||||
}
|
||||
|
||||
String fileStateKind(FileStateKind kind) {
|
||||
if (!_currentKinds.contains(kind)) {
|
||||
throw StateError('$kind');
|
||||
}
|
||||
return _fileStateKind[kind] ??= () {
|
||||
if (kind is AugmentationKnownFileStateKind) {
|
||||
return 'augmentation_${_fileStateKind.length}';
|
||||
} else if (kind is AugmentationUnknownFileStateKind) {
|
||||
return 'augmentationUnknown_${_fileStateKind.length}';
|
||||
} else if (kind is LibraryFileStateKind) {
|
||||
return 'library_${_fileStateKind.length}';
|
||||
} else if (kind is PartOfNameFileStateKind) {
|
||||
return 'partOfName_${_fileStateKind.length}';
|
||||
} else if (kind is PartOfUriKnownFileStateKind) {
|
||||
return 'partOfUriKnown_${_fileStateKind.length}';
|
||||
} else if (kind is PartFileStateKind) {
|
||||
return 'partOfUriUnknown_${_fileStateKind.length}';
|
||||
} else {
|
||||
throw UnimplementedError('${kind.runtimeType}');
|
||||
}
|
||||
}();
|
||||
}
|
||||
|
||||
String libraryCycle(LibraryCycle cycle) {
|
||||
if (!_currentCycles.contains(cycle)) {
|
||||
throw StateError('$cycle');
|
||||
|
@ -660,6 +660,15 @@ class IdProvider {
|
|||
return _libraryCycle[cycle] ??= 'cycle_${_libraryCycle.length}';
|
||||
}
|
||||
|
||||
/// Register that [kind] is an object that can be referenced.
|
||||
void registerFileKind(FileKind kind) {
|
||||
if (_currentFileKinds.contains(kind)) {
|
||||
throw StateError('Duplicate: $kind');
|
||||
}
|
||||
_currentFileKinds.add(kind);
|
||||
fileKind(kind);
|
||||
}
|
||||
|
||||
/// Register that [file] is an object that can be referenced.
|
||||
void registerFileState(FileState file) {
|
||||
if (_currentFiles.contains(file)) {
|
||||
|
@ -669,15 +678,6 @@ class IdProvider {
|
|||
fileState(file);
|
||||
}
|
||||
|
||||
/// Register that [kind] is an object that can be referenced.
|
||||
void registerFileStateKind(FileStateKind kind) {
|
||||
if (_currentKinds.contains(kind)) {
|
||||
throw StateError('Duplicate: $kind');
|
||||
}
|
||||
_currentKinds.add(kind);
|
||||
fileStateKind(kind);
|
||||
}
|
||||
|
||||
/// Register that [cycle] is an object that can be referenced.
|
||||
void registerLibraryCycle(LibraryCycle cycle) {
|
||||
_currentCycles.add(cycle);
|
||||
|
@ -686,7 +686,7 @@ class IdProvider {
|
|||
|
||||
void resetRegisteredObject() {
|
||||
_currentFiles = {};
|
||||
_currentKinds = {};
|
||||
_currentFileKinds = {};
|
||||
_currentCycles = {};
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -52,7 +52,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -68,7 +68,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
dependencies: dart:core
|
||||
|
@ -84,7 +84,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_1
|
||||
library_3 dart:core synthetic
|
||||
|
@ -129,7 +129,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -145,7 +145,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
dependencies: dart:core
|
||||
|
@ -161,7 +161,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_1
|
||||
library_3 dart:core synthetic
|
||||
|
@ -206,7 +206,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -222,7 +222,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
dependencies: dart:core
|
||||
|
@ -238,7 +238,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_1
|
||||
library_3 dart:core synthetic
|
||||
|
@ -287,7 +287,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
dependencies: dart:core
|
||||
|
@ -328,7 +328,7 @@ files
|
|||
current
|
||||
id: file_8
|
||||
kind: library_8
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_4
|
||||
dependencies: dart:core
|
||||
|
@ -344,7 +344,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
dependencies: dart:core
|
||||
|
@ -360,7 +360,7 @@ files
|
|||
current
|
||||
id: file_9
|
||||
kind: library_9
|
||||
imports
|
||||
libraryImports
|
||||
library_8
|
||||
library_1
|
||||
library_3 dart:core synthetic
|
||||
|
@ -523,7 +523,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_2 dart:core synthetic
|
||||
parts
|
||||
partOfUriKnown_1
|
||||
|
@ -587,7 +587,7 @@ files
|
|||
current
|
||||
id: file_7
|
||||
kind: library_7
|
||||
imports
|
||||
libraryImports
|
||||
library_2 dart:core synthetic
|
||||
parts
|
||||
partOfUriKnown_8
|
||||
|
@ -647,7 +647,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
parts
|
||||
partOfUriKnown_1
|
||||
|
@ -675,7 +675,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
|
@ -741,7 +741,7 @@ files
|
|||
current
|
||||
id: file_8
|
||||
kind: library_8
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
parts
|
||||
partOfUriKnown_9
|
||||
|
@ -769,7 +769,7 @@ files
|
|||
current
|
||||
id: file_10
|
||||
kind: library_10
|
||||
imports
|
||||
libraryImports
|
||||
library_8
|
||||
library_3 dart:core synthetic
|
||||
cycle_4
|
||||
|
@ -924,7 +924,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1466,7 +1466,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1498,7 +1498,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1534,7 +1534,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1550,7 +1550,7 @@ files
|
|||
current
|
||||
id: file_6
|
||||
kind: library_6
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_1 dart:core synthetic
|
||||
cycle_2
|
||||
|
@ -1598,7 +1598,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1614,7 +1614,7 @@ files
|
|||
current
|
||||
id: file_6
|
||||
kind: library_6
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_1 dart:core synthetic
|
||||
cycle_2
|
||||
|
@ -1666,7 +1666,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1704,7 +1704,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1847,7 +1847,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1863,7 +1863,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_3 dart:core synthetic
|
||||
cycle_1
|
||||
|
@ -1878,7 +1878,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_3 dart:core synthetic
|
||||
cycle_2
|
||||
|
@ -1923,7 +1923,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -1943,7 +1943,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_3 dart:core synthetic
|
||||
cycle_2
|
||||
|
@ -2012,7 +2012,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_6 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -2028,7 +2028,7 @@ files
|
|||
current
|
||||
id: file_1
|
||||
kind: library_1
|
||||
imports
|
||||
libraryImports
|
||||
library_6 dart:core synthetic
|
||||
cycle_1
|
||||
dependencies: dart:core
|
||||
|
@ -2044,7 +2044,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_6 dart:core synthetic
|
||||
cycle_2
|
||||
dependencies: dart:core
|
||||
|
@ -2060,7 +2060,7 @@ files
|
|||
current
|
||||
id: file_3
|
||||
kind: library_3
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_6 dart:core synthetic
|
||||
cycle_3
|
||||
|
@ -2075,7 +2075,7 @@ files
|
|||
current
|
||||
id: file_4
|
||||
kind: library_4
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_1
|
||||
library_6 dart:core synthetic
|
||||
|
@ -2091,7 +2091,7 @@ files
|
|||
current
|
||||
id: file_5
|
||||
kind: library_5
|
||||
imports
|
||||
libraryImports
|
||||
library_2
|
||||
library_6 dart:core synthetic
|
||||
cycle_5
|
||||
|
@ -2153,7 +2153,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_6 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -2173,7 +2173,7 @@ files
|
|||
current
|
||||
id: file_2
|
||||
kind: library_2
|
||||
imports
|
||||
libraryImports
|
||||
library_6 dart:core synthetic
|
||||
cycle_2
|
||||
dependencies: dart:core
|
||||
|
@ -2189,7 +2189,7 @@ files
|
|||
current
|
||||
id: file_3
|
||||
kind: library_3
|
||||
imports
|
||||
libraryImports
|
||||
library_0
|
||||
library_6 dart:core synthetic
|
||||
cycle_3
|
||||
|
@ -2208,7 +2208,7 @@ files
|
|||
current
|
||||
id: file_5
|
||||
kind: library_5
|
||||
imports
|
||||
libraryImports
|
||||
library_2
|
||||
library_6 dart:core synthetic
|
||||
cycle_5
|
||||
|
@ -2274,7 +2274,7 @@ files
|
|||
current
|
||||
id: file_0
|
||||
kind: library_0
|
||||
imports
|
||||
libraryImports
|
||||
library_1 dart:core synthetic
|
||||
cycle_0
|
||||
dependencies: dart:core
|
||||
|
@ -2339,7 +2339,7 @@ void func() {
|
|||
// TODO(scheglov) Use textual dump
|
||||
final fsState = fileResolver.fsState!;
|
||||
final testState = fsState.getExisting(testFile)!;
|
||||
final testKind = testState.kind as PartFileStateKind;
|
||||
final testKind = testState.kind as PartFileKind;
|
||||
expect(testKind.library?.file, fsState.getExisting(a));
|
||||
}
|
||||
|
||||
|
@ -2364,7 +2364,7 @@ void func() {
|
|||
// TODO(scheglov) Use textual dump
|
||||
final fsState = fileResolver.fsState!;
|
||||
final testState = fsState.getExisting(testFile)!;
|
||||
final testKind = testState.kind as PartFileStateKind;
|
||||
final testKind = testState.kind as PartFileKind;
|
||||
expect(testKind.library?.file, fsState.getExisting(a));
|
||||
}
|
||||
|
||||
|
|
|
@ -339,11 +339,11 @@ class Driver implements CommandLineStarter {
|
|||
var file = analysisDriver.fsState.getFileForPath(path);
|
||||
|
||||
final kind = file.kind;
|
||||
if (kind is LibraryFileStateKind) {
|
||||
if (kind is LibraryFileKind) {
|
||||
var status = await _runAnalyzer(file, options, formatter);
|
||||
allResult = allResult.max(status);
|
||||
analyzedFiles.addAll(kind.files);
|
||||
} else if (kind is PartFileStateKind) {
|
||||
} else if (kind is PartFileKind) {
|
||||
partFiles.add(file);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue