Refactor: extract AnnotationDescriptor.annotationClass utility
This commit is contained in:
+2
-1
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
|
||||
class KotlinAnnotatedElementsSearcher : QueryExecutor<PsiModifierListOwner, AnnotatedElementsSearch.Parameters> {
|
||||
@@ -101,7 +102,7 @@ class KotlinAnnotatedElementsSearcher : QueryExecutor<PsiModifierListOwner, Anno
|
||||
val context = elt.analyze(BodyResolveMode.PARTIAL)
|
||||
val annotationDescriptor = context.get(BindingContext.ANNOTATION, elt) ?: return true
|
||||
|
||||
val descriptor = annotationDescriptor.type.constructor.declarationDescriptor ?: return true
|
||||
val descriptor = annotationDescriptor.annotationClass ?: return true
|
||||
if (DescriptorUtils.getFqName(descriptor).asString() != annotationFQN) return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user