use of org.jetbrains.kotlin.psi.KtCallExpression in project kotlin by JetBrains.
the class KotlinExpressionSurrounder method isApplicable.
@Override
public boolean isApplicable(@NotNull PsiElement[] elements) {
if (elements.length != 1 || !(elements[0] instanceof KtExpression)) {
return false;
}
KtExpression expression = (KtExpression) elements[0];
if (expression instanceof KtCallExpression && expression.getParent() instanceof KtQualifiedExpression) {
return false;
}
KotlinType type = ResolutionUtils.analyze(expression, BodyResolveMode.PARTIAL).getType(expression);
if (type == null || isUnit(type)) {
return false;
}
return isApplicable(expression);
}
Aggregations