From 9d46c901652ecf37f34379e72178aab0b935b2f8 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 19 Jun 2013 15:13:49 +0400 Subject: [PATCH] Implement Unwrap/Remove for lambdas --- .../jet/generators/tests/GenerateTests.java | 3 +- .../unwrap/KotlinLambdaUnwrapper.java | 70 +++++++++++++++++++ .../unwrap/KotlinUnwrapDescriptor.java | 1 + .../unwrapLambda/lambdaCallCompoundInBlock.kt | 7 ++ .../lambdaCallCompoundInBlock.kt.after | 5 ++ .../lambdaCallCompoundInReturn.kt | 7 ++ .../unwrapLambda/lambdaCallInBlock.kt | 6 ++ .../unwrapLambda/lambdaCallInBlock.kt.after | 4 ++ .../unwrapLambda/lambdaCallInBlock2.kt | 6 ++ .../unwrapLambda/lambdaCallInBlock2.kt.after | 4 ++ .../unwrapLambda/lambdaCallSimpleInReturn.kt | 6 ++ .../lambdaCallSimpleInReturn.kt.after | 4 ++ .../unwrapLambda/lambdaInBlock.kt | 6 ++ .../unwrapLambda/lambdaInBlock.kt.after | 4 ++ .../lambdaNonLocalPropertyCompoundInBlock.kt | 5 ++ .../lambdaNonLocalPropertyInBlock.kt | 4 ++ .../lambdaNonLocalPropertyInBlock.kt.after | 2 + .../lambdaPropertyCompoundInBlock.kt | 7 ++ .../lambdaPropertyCompoundInBlock.kt.after | 5 ++ .../unwrapLambda/lambdaPropertyInBlock.kt | 6 ++ .../lambdaPropertyInBlock.kt.after | 4 ++ .../unwrap/AbstractUnwrapRemoveTest.java | 4 ++ .../unwrap/UnwrapRemoveTestGenerated.java | 61 +++++++++++++++- 23 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinLambdaUnwrapper.java create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInReturn.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyCompoundInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt.after create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt create mode 100644 idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt.after diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index c50df4959b5..89d576bba48 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -378,7 +378,8 @@ public class GenerateTests { testModel("idea/testData/codeInsight/unwrapAndRemove/unwrapThen", "doTestThenUnwrapper"), testModel("idea/testData/codeInsight/unwrapAndRemove/unwrapElse", "doTestElseUnwrapper"), testModel("idea/testData/codeInsight/unwrapAndRemove/removeElse", "doTestElseRemover"), - testModel("idea/testData/codeInsight/unwrapAndRemove/unwrapLoop", "doTestLoopUnwrapper") + testModel("idea/testData/codeInsight/unwrapAndRemove/unwrapLoop", "doTestLoopUnwrapper"), + testModel("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda", "doTestLambdaUnwrapper") ); } diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinLambdaUnwrapper.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinLambdaUnwrapper.java new file mode 100644 index 00000000000..f262fba9b48 --- /dev/null +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinLambdaUnwrapper.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.plugin.codeInsight.unwrap; + +import com.intellij.psi.PsiElement; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.psi.*; + +public class KotlinLambdaUnwrapper extends KotlinUnwrapRemoveBase { + public KotlinLambdaUnwrapper(String key) { + super(key); + } + + private static JetElement getLambdaEnclosingElement(@NotNull JetFunctionLiteralExpression lambda) { + PsiElement parent = lambda.getParent(); + + if (parent instanceof JetValueArgument) { + return PsiTreeUtil.getParentOfType(parent, JetCallExpression.class, true); + } + + if (parent instanceof JetCallExpression) { + return (JetElement) parent; + } + + if (parent instanceof JetProperty && ((JetProperty) parent).isLocal()) { + return (JetElement) parent; + } + + return lambda; + } + + @Override + public boolean isApplicableTo(PsiElement e) { + if (!(e instanceof JetFunctionLiteralExpression)) return false; + + JetFunctionLiteralExpression lambda = (JetFunctionLiteralExpression) e; + JetBlockExpression body = lambda.getBodyExpression(); + JetElement enclosingElement = getLambdaEnclosingElement((JetFunctionLiteralExpression) e); + + if (body == null || enclosingElement == null) return false; + + return canExtractExpression(body, (JetElement)enclosingElement.getParent()); + } + + @Override + protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException { + JetFunctionLiteralExpression lambda = (JetFunctionLiteralExpression) element; + JetBlockExpression body = lambda.getBodyExpression(); + JetElement enclosingExpression = getLambdaEnclosingElement(lambda); + + context.extractFromBlock(body, enclosingExpression); + context.delete(enclosingExpression); + } +} diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinUnwrapDescriptor.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinUnwrapDescriptor.java index 337c33de3a0..d3f661f6433 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinUnwrapDescriptor.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/unwrap/KotlinUnwrapDescriptor.java @@ -27,6 +27,7 @@ public class KotlinUnwrapDescriptor extends UnwrapDescriptorBase { new KoitlinUnwrappers.KotlinElseRemover("remove.else"), new KoitlinUnwrappers.KotlinElseUnwrapper("unwrap.else"), new KoitlinUnwrappers.KotlinLoopUnwrapper("unwrap.expression"), + new KotlinLambdaUnwrapper("unwrap.expression"), }; } } diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt new file mode 100644 index 00000000000..cb28bebdc7f --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt @@ -0,0 +1,7 @@ +// OPTION: 0 +fun foo() { + run(1, 2) { + println("lambda") + println("another lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt.after new file mode 100644 index 00000000000..921c5bac342 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt.after @@ -0,0 +1,5 @@ +// OPTION: 0 +fun foo() { + println("lambda") + println("another lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInReturn.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInReturn.kt new file mode 100644 index 00000000000..2ad75880d74 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInReturn.kt @@ -0,0 +1,7 @@ +// IS_APPLICABLE: false +fun foo() { + return run(1, 2) { + println("lambda") + println("another lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt new file mode 100644 index 00000000000..4e2bff439c0 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt @@ -0,0 +1,6 @@ +// OPTION: 0 +fun foo() { + run(1, 2) { + println("lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt.after new file mode 100644 index 00000000000..b65ed1f3154 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt.after @@ -0,0 +1,4 @@ +// OPTION: 0 +fun foo() { + println("lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt new file mode 100644 index 00000000000..2dad0fed3e1 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt @@ -0,0 +1,6 @@ +// OPTION: 0 +fun foo() { + run({ + println("lambda") + }, 1) +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt.after new file mode 100644 index 00000000000..b65ed1f3154 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt.after @@ -0,0 +1,4 @@ +// OPTION: 0 +fun foo() { + println("lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt new file mode 100644 index 00000000000..340be5d64e1 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt @@ -0,0 +1,6 @@ +// OPTION: 0 +fun foo() { + return run(1, 2) { + println("lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt.after new file mode 100644 index 00000000000..391cca9da17 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt.after @@ -0,0 +1,4 @@ +// OPTION: 0 +fun foo() { + return println("lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt new file mode 100644 index 00000000000..d0cfb1fdec5 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt @@ -0,0 +1,6 @@ +// OPTION: 1 +fun foo() { + { + println("lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt.after new file mode 100644 index 00000000000..9613f1898d7 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt.after @@ -0,0 +1,4 @@ +// OPTION: 1 +fun foo() { + println("lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyCompoundInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyCompoundInBlock.kt new file mode 100644 index 00000000000..1d64a4c5819 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyCompoundInBlock.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false +val x = { + println("lambda") + println("another lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt new file mode 100644 index 00000000000..c8d7ed1c58b --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt @@ -0,0 +1,4 @@ +// OPTION: 0 +val x = { + println("lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt.after new file mode 100644 index 00000000000..e35380fe13e --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt.after @@ -0,0 +1,2 @@ +// OPTION: 0 +val x = println("lambda") diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt new file mode 100644 index 00000000000..518f0a85fd6 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt @@ -0,0 +1,7 @@ +// OPTION: 0 +fun foo() { + val x = { + println("lambda") + println("another lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt.after new file mode 100644 index 00000000000..921c5bac342 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt.after @@ -0,0 +1,5 @@ +// OPTION: 0 +fun foo() { + println("lambda") + println("another lambda") +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt new file mode 100644 index 00000000000..e196b88c954 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt @@ -0,0 +1,6 @@ +// OPTION: 0 +fun foo() { + val x = { + println("lambda") + } +} diff --git a/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt.after b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt.after new file mode 100644 index 00000000000..b65ed1f3154 --- /dev/null +++ b/idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt.after @@ -0,0 +1,4 @@ +// OPTION: 0 +fun foo() { + println("lambda") +} diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/AbstractUnwrapRemoveTest.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/AbstractUnwrapRemoveTest.java index c3a610bab7f..fdb85ac02f2 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/AbstractUnwrapRemoveTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/AbstractUnwrapRemoveTest.java @@ -46,6 +46,10 @@ public abstract class AbstractUnwrapRemoveTest extends LightCodeInsightTestCase doTest(path, KoitlinUnwrappers.KotlinLoopUnwrapper.class); } + public void doTestLambdaUnwrapper(@NotNull String path) throws Exception { + doTest(path, KotlinLambdaUnwrapper.class); + } + private void doTest(@NotNull String path, final Class unwrapperClass) throws Exception { configureByFile(path); diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/UnwrapRemoveTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/UnwrapRemoveTestGenerated.java index f91dadce89a..79a7e9fd9b4 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/UnwrapRemoveTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/unwrap/UnwrapRemoveTestGenerated.java @@ -30,7 +30,7 @@ import org.jetbrains.jet.plugin.codeInsight.unwrap.AbstractUnwrapRemoveTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@InnerTestClasses({UnwrapRemoveTestGenerated.UnwrapThen.class, UnwrapRemoveTestGenerated.UnwrapElse.class, UnwrapRemoveTestGenerated.RemoveElse.class, UnwrapRemoveTestGenerated.UnwrapLoop.class}) +@InnerTestClasses({UnwrapRemoveTestGenerated.UnwrapThen.class, UnwrapRemoveTestGenerated.UnwrapElse.class, UnwrapRemoveTestGenerated.RemoveElse.class, UnwrapRemoveTestGenerated.UnwrapLoop.class, UnwrapRemoveTestGenerated.UnwrapLambda.class}) public class UnwrapRemoveTestGenerated extends AbstractUnwrapRemoveTest { @TestMetadata("idea/testData/codeInsight/unwrapAndRemove/unwrapThen") public static class UnwrapThen extends AbstractUnwrapRemoveTest { @@ -114,12 +114,71 @@ public class UnwrapRemoveTestGenerated extends AbstractUnwrapRemoveTest { } + @TestMetadata("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda") + public static class UnwrapLambda extends AbstractUnwrapRemoveTest { + public void testAllFilesPresentInUnwrapLambda() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("lambdaCallCompoundInBlock.kt") + public void testLambdaCallCompoundInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInBlock.kt"); + } + + @TestMetadata("lambdaCallCompoundInReturn.kt") + public void testLambdaCallCompoundInReturn() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallCompoundInReturn.kt"); + } + + @TestMetadata("lambdaCallInBlock.kt") + public void testLambdaCallInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock.kt"); + } + + @TestMetadata("lambdaCallInBlock2.kt") + public void testLambdaCallInBlock2() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallInBlock2.kt"); + } + + @TestMetadata("lambdaCallSimpleInReturn.kt") + public void testLambdaCallSimpleInReturn() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaCallSimpleInReturn.kt"); + } + + @TestMetadata("lambdaInBlock.kt") + public void testLambdaInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaInBlock.kt"); + } + + @TestMetadata("lambdaNonLocalPropertyCompoundInBlock.kt") + public void testLambdaNonLocalPropertyCompoundInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyCompoundInBlock.kt"); + } + + @TestMetadata("lambdaNonLocalPropertyInBlock.kt") + public void testLambdaNonLocalPropertyInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaNonLocalPropertyInBlock.kt"); + } + + @TestMetadata("lambdaPropertyCompoundInBlock.kt") + public void testLambdaPropertyCompoundInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyCompoundInBlock.kt"); + } + + @TestMetadata("lambdaPropertyInBlock.kt") + public void testLambdaPropertyInBlock() throws Exception { + doTestLambdaUnwrapper("idea/testData/codeInsight/unwrapAndRemove/unwrapLambda/lambdaPropertyInBlock.kt"); + } + + } + public static Test suite() { TestSuite suite = new TestSuite("UnwrapRemoveTestGenerated"); suite.addTestSuite(UnwrapThen.class); suite.addTestSuite(UnwrapElse.class); suite.addTestSuite(RemoveElse.class); suite.addTestSuite(UnwrapLoop.class); + suite.addTestSuite(UnwrapLambda.class); return suite; } }