angularArtifactsForKythe function
Future<AngularArtifacts?> ?
angularArtifactsForKythe(
- LibraryElement element, {
- UncaughtExceptionHandler? uncaughtExceptionHandler,
Implementation
Future<AngularArtifacts?>? angularArtifactsForKythe(LibraryElement element,
{UncaughtExceptionHandler? uncaughtExceptionHandler}) {
final assetId = _toAssetId(element.identifier);
if (assetId == null) return null;
final exceptionHandler = ComponentVisitorExceptionHandler();
return runWithContext(
CompileContext(
assetId,
policyExceptions: {},
policyExceptionsInPackages: {},
enableDevTools: false,
), () async {
try {
return findComponentsAndDirectives(
LibraryReader(element), exceptionHandler);
} catch (e, s) {
if (uncaughtExceptionHandler?.call(e, s) ?? false) {
return null;
} else {
rethrow;
}
}
});
}