Drop Annotations.Companion.find/getUseSiteTargetedAnnotation(s)

This commit is contained in:
Alexander Udalov
2018-08-14 18:06:22 +02:00
parent 7271995ff0
commit 83fbabd628
5 changed files with 3 additions and 69 deletions
@@ -29,8 +29,6 @@ import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
@@ -78,10 +76,7 @@ private fun KtExpression.getBundleNameByContext(): String? {
val callable = resolvedCall.resultingDescriptor
if ((resolvedCall.extensionReceiver as? ExpressionReceiver)?.expression == expression) {
val returnTypeAnnotations = callable.returnType?.annotations ?: return null
return Annotations
.findUseSiteTargetedAnnotation(returnTypeAnnotations, AnnotationUseSiteTarget.RECEIVER, PROPERTY_KEY)
?.getBundleName()
return callable.extensionReceiverParameter?.annotations?.findAnnotation(PROPERTY_KEY)?.getBundleName()
}
return resolvedCall.valueArguments.entries