From dd4ceb8c0f816f8c2556f2f408ab6acf05d92515 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 --- .../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/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt index 358f2637fe4..17aa46b5516 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceUntilWithRangeToIntention.kt +++ b/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/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt index c636233dce5..720b69674f6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/Utils.kt +++ b/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