Move getCallableDescriptor function declaration to Utils

GitOrigin-RevId: 151c12f97acdfd95f4bf934eb7b3184230f42208
This commit is contained in:
Toshiaki Kameyama
2018-03-07 15:41:07 +03:00
committed by intellij-monorepo-bot
parent 324fcb4924
commit eff8336be7
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