resolveLibraryAt method
Future<ResolvedLibraryResult>
resolveLibraryAt(
- Uri uri
)
Implementation
Future<ResolvedLibraryResult> resolveLibraryAt(Uri uri) async {
assert(FileSystemEntity.isDirectorySync(
uri.toFilePath(windows: Platform.isWindows)));
for (final ctx in contexts.contexts) {
final path = getPath(uri);
if (_resolvedAsts.containsKey(path)) {
return _resolvedAsts[path]! as ResolvedLibraryResult;
}
final output = await ctx.currentSession.getResolvedLibrary2(path)
as ResolvedLibraryResult;
if (output.state == ResultState.VALID) {
return _resolvedAsts[path] = output;
}
}
throw ArgumentError("'uri' could not be resolved (contexts: "
"${contexts.contexts.map((c) => c.contextRoot.root.toUri()).join(", ")})");
}