annotatedWith method

Iterable<AnnotatedElement> annotatedWith(
  1. TypeChecker checker, {
  2. bool throwOnUnresolved = true,
})

All of the declarations in this library annotated with checker.

Implementation

Iterable<AnnotatedElement> annotatedWith(
  TypeChecker checker, {
  bool throwOnUnresolved = true,
}) sync* {
  for (final element in allElements) {
    final annotation = checker.firstAnnotationOf(
      element,
      throwOnUnresolved: throwOnUnresolved,
    );
    if (annotation != null) {
      yield AnnotatedElement(ConstantReader(annotation), element);
    }
  }
}