Support external annotations in IDE when approximating flexible types
This commit is contained in:
+11
-2
@@ -32,9 +32,14 @@ class LazyJavaAnnotations(
|
||||
c.resolveAnnotation(annotation)
|
||||
}
|
||||
|
||||
override fun findAnnotation(fqName: FqName) = annotationOwner.findAnnotation(fqName)?.let(annotationDescriptors)
|
||||
override fun findAnnotation(fqName: FqName) =
|
||||
annotationOwner.findAnnotation(fqName)?.let(annotationDescriptors)
|
||||
|
||||
override fun iterator() = annotationOwner.getAnnotations().sequence().map(annotationDescriptors).filterNotNull().iterator()
|
||||
override fun findExternalAnnotation(fqName: FqName) =
|
||||
c.externalAnnotationResolver.findExternalAnnotation(annotationOwner, fqName)?.let(annotationDescriptors)
|
||||
|
||||
override fun iterator() =
|
||||
annotationOwner.getAnnotations().sequence().map(annotationDescriptors).filterNotNull().iterator()
|
||||
|
||||
override fun isEmpty() = !iterator().hasNext()
|
||||
}
|
||||
@@ -47,6 +52,10 @@ class FilteredAnnotations(
|
||||
if (fqNameFilter(fqName)) delegate.findAnnotation(fqName)
|
||||
else null
|
||||
|
||||
override fun findExternalAnnotation(fqName: FqName) =
|
||||
if (fqNameFilter(fqName)) delegate.findExternalAnnotation(fqName)
|
||||
else null
|
||||
|
||||
override fun iterator() = delegate.sequence()
|
||||
.filter { annotation ->
|
||||
val descriptor = annotation.getType().getConstructor().getDeclarationDescriptor()
|
||||
|
||||
Reference in New Issue
Block a user