Move getCallableDescriptor function declaration to Utils

This commit is contained in:
Toshiaki Kameyama
2018-02-28 18:36:21 +03:00
committed by Mikhail Glukhikh
parent f48eacfbd4
commit dd4ceb8c0f
2 changed files with 2 additions and 3 deletions
@@ -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()
@@ -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