diff --git a/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties b/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties index b6931e688206..95bf291151c1 100644 --- a/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties +++ b/plugins/kotlin/base/resources/resources-en/messages/KotlinBundle.properties @@ -242,6 +242,7 @@ overridden.marker.overrides.choose.implementation.find.usages=Super Implementati remove.expression=Remove ''{0}'' unwrap.expression=Unwrap ''{0}'' +unwrap.parameter=Unwrap ''{0}'' arg ''{1}'' remove.else=Remove else in ''{0}'' unwrap.else=Unwrap else in ''{0}'' diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinFunctionParameterUnwrapper.kt b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinFunctionParameterUnwrapper.kt index 795f4b466714..94a4e924e438 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinFunctionParameterUnwrapper.kt +++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinFunctionParameterUnwrapper.kt @@ -186,6 +186,9 @@ class KotlinFunctionParameterUnwrapper(val key: String) : KotlinUnwrapRemoveBase // but because we support the caret to be on LPAR/COMMA and other tokens this doesn't work val target = argumentToUnwrap(e) ?: error("Description asked for a non applicable unwrapper") - return KotlinBundle.message(key, getExpressionShortText(target)) + val callee = target.getStrictParentOfType()?.calleeExpression + ?.let(::getExpressionShortText) ?: "?" + + return KotlinBundle.message(key, callee, getExpressionShortText(target)) } } diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinUnwrapDescriptor.java b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinUnwrapDescriptor.java index c289b18109e5..d05ca7fbd480 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinUnwrapDescriptor.java +++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinUnwrapDescriptor.java @@ -20,7 +20,7 @@ public class KotlinUnwrapDescriptor extends UnwrapDescriptorBase { new KotlinUnwrappers.KotlinFinallyUnwrapper("unwrap.expression"), new KotlinUnwrappers.KotlinFinallyRemover("remove.expression"), new KotlinLambdaUnwrapper("unwrap.expression"), - new KotlinFunctionParameterUnwrapper("unwrap.expression") + new KotlinFunctionParameterUnwrapper("unwrap.parameter") }; } }