From eff8336be748753643d5f9e3b6149795f1d3fc0a Mon Sep 17 00:00:00 2001 From: Toshiaki Kameyama Date: Wed, 28 Feb 2018 18:36:21 +0300 Subject: [PATCH] Move getCallableDescriptor function declaration to Utils GitOrigin-RevId: 151c12f97acdfd95f4bf934eb7b3184230f42208 --- .../kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt | 3 --- .../idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt index 358f2637fe47..17aa46b5516f 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt +++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt @@ -17,12 +17,9 @@ package org.jetbrains.kotlin.idea.intentions import com.intellij.openapi.editor.Editor -import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe -internal fun KtExpression.getCallableDescriptor() = resolveToCall()?.resultingDescriptor - internal fun KtExpression.getArguments() = when (this) { is KtBinaryExpression -> this.left to this.right is KtDotQualifiedExpression -> this.receiverExpression to this.callExpression?.valueArguments?.singleOrNull()?.getArgumentExpression() diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt index c636233dce59..720b69674f6b 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt +++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt @@ -306,3 +306,5 @@ fun KtBlockExpression.getParentLambdaLabelName(): String? { val lambdaLabelName = (valueArgument.getArgumentExpression() as? KtLabeledExpression)?.getLabelName() return lambdaLabelName ?: callExpression.getCallNameExpression()?.text } + +internal fun KtExpression.getCallableDescriptor() = resolveToCall()?.resultingDescriptor \ No newline at end of file