Correct strikethrough when unwrapping lambdas KTIJ-21561

closes https://github.com/JetBrains/intellij-community/pull/1996

GitOrigin-RevId: 9a77468e51b338a8ab7d847fba3f80762421004b
This commit is contained in:
Christian Vonrüti
2022-07-20 15:25:33 +00:00
committed by intellij-monorepo-bot
parent eb9313d7dc
commit 499529bd07
@@ -8,6 +8,8 @@ import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.psi.*;
import java.util.List;
public class KotlinLambdaUnwrapper extends KotlinUnwrapRemoveBase {
public KotlinLambdaUnwrapper(String key) {
super(key);
@@ -53,4 +55,10 @@ public class KotlinLambdaUnwrapper extends KotlinUnwrapRemoveBase {
context.extractFromBlock(body, enclosingExpression);
context.delete(enclosingExpression);
}
@Override
public PsiElement collectAffectedElements(@NotNull PsiElement e, @NotNull List<PsiElement> toExtract) {
super.collectAffectedElements(e, toExtract);
return getLambdaEnclosingElement((KtLambdaExpression) e);
}
}