diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 8d3dab08388..4e3aa1d473e 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -1246,7 +1246,7 @@ fun main(args: Array) { testGroup("idea/idea-fir-fe10-binding/tests", "idea") { testClass { val pattern = "^([\\w\\-_]+)\\.(kt|kts)$" - model("testData/intentions/conventionNameCalls/replaceContains", pattern = pattern) + model("testData/intentions/conventionNameCalls", pattern = pattern) } } diff --git a/idea/idea-fir-fe10-binding/tests/org/jetbrains/kotlin/idea/inspections/Fe10BindingIntentionTestGenerated.java b/idea/idea-fir-fe10-binding/tests/org/jetbrains/kotlin/idea/inspections/Fe10BindingIntentionTestGenerated.java index 16c9c6c5f1a..3543332273b 100644 --- a/idea/idea-fir-fe10-binding/tests/org/jetbrains/kotlin/idea/inspections/Fe10BindingIntentionTestGenerated.java +++ b/idea/idea-fir-fe10-binding/tests/org/jetbrains/kotlin/idea/inspections/Fe10BindingIntentionTestGenerated.java @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/intentions/conventionNameCalls/replaceContains") +@TestMetadata("idea/testData/intentions/conventionNameCalls") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class Fe10BindingIntentionTestGenerated extends AbstractFe10BindingIntentionTest { @@ -25,112 +25,306 @@ public class Fe10BindingIntentionTestGenerated extends AbstractFe10BindingIntent KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); } - public void testAllFilesPresentInReplaceContains() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceContains"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); + public void testAllFilesPresentInConventionNameCalls() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); } - @TestMetadata("containsFromJava.kt") - public void testContainsFromJava() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/containsFromJava.kt"); + @TestMetadata("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ReplaceCallWithUnaryOperator extends AbstractFe10BindingIntentionTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInReplaceCallWithUnaryOperator() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); + } + + @TestMetadata("complexPlus.kt") + public void testComplexPlus() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt"); + } + + @TestMetadata("dec.kt") + public void testDec() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/dec.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt"); + } + + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/functionLiteralArgument.kt"); + } + + @TestMetadata("inc.kt") + public void testInc() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/inc.kt"); + } + + @TestMetadata("minusSanityTest.kt") + public void testMinusSanityTest() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt"); + } + + @TestMetadata("namedValueArgument.kt") + public void testNamedValueArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/namedValueArgument.kt"); + } + + @TestMetadata("notSanityTest.kt") + public void testNotSanityTest() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/notSanityTest.kt"); + } + + @TestMetadata("plusPlus.kt") + public void testPlusPlus() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt"); + } + + @TestMetadata("plusSanityTest.kt") + public void testPlusSanityTest() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt"); + } + + @TestMetadata("qualifier.kt") + public void testQualifier() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt"); + } + + @TestMetadata("super.kt") + public void testSuper() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/super.kt"); + } + + @TestMetadata("typeArguments.kt") + public void testTypeArguments() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/typeArguments.kt"); + } + + @TestMetadata("unacceptableVararg.kt") + public void testUnacceptableVararg() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/unacceptableVararg.kt"); + } + + @TestMetadata("valueArgument.kt") + public void testValueArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/valueArgument.kt"); + } } - @TestMetadata("containsInExpression.kt") - public void testContainsInExpression() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/containsInExpression.kt"); + @TestMetadata("idea/testData/intentions/conventionNameCalls/replaceContains") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ReplaceContains extends AbstractFe10BindingIntentionTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInReplaceContains() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceContains"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); + } + + @TestMetadata("containsFromJava.kt") + public void testContainsFromJava() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/containsFromJava.kt"); + } + + @TestMetadata("containsInExpression.kt") + public void testContainsInExpression() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/containsInExpression.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/extensionFunction.kt"); + } + + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgument.kt"); + } + + @TestMetadata("functionLiteralArgumentAfterSemicolon.kt") + public void testFunctionLiteralArgumentAfterSemicolon() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgumentAfterSemicolon.kt"); + } + + @TestMetadata("functionLiteralArgumentAtStartOfBlock.kt") + public void testFunctionLiteralArgumentAtStartOfBlock() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgumentAtStartOfBlock.kt"); + } + + @TestMetadata("functionLiteralArgumentInExpression.kt") + public void testFunctionLiteralArgumentInExpression() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgumentInExpression.kt"); + } + + @TestMetadata("invalidArgument.kt") + public void testInvalidArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/invalidArgument.kt"); + } + + @TestMetadata("missingArgument.kt") + public void testMissingArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/missingArgument.kt"); + } + + @TestMetadata("missingDefaultArgument.kt") + public void testMissingDefaultArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/missingDefaultArgument.kt"); + } + + @TestMetadata("multipleArguments.kt") + public void testMultipleArguments() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/multipleArguments.kt"); + } + + @TestMetadata("notContains.kt") + public void testNotContains() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/notContains.kt"); + } + + @TestMetadata("qualifier.kt") + public void testQualifier() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/qualifier.kt"); + } + + @TestMetadata("simpleArgument.kt") + public void testSimpleArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/simpleArgument.kt"); + } + + @TestMetadata("simpleStringLiteral.kt") + public void testSimpleStringLiteral() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/simpleStringLiteral.kt"); + } + + @TestMetadata("super.kt") + public void testSuper() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/super.kt"); + } + + @TestMetadata("twoArgsContainsFromJava.kt") + public void testTwoArgsContainsFromJava() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/twoArgsContainsFromJava.kt"); + } + + @TestMetadata("typeArguments.kt") + public void testTypeArguments() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/typeArguments.kt"); + } + + @TestMetadata("unacceptableVararg1.kt") + public void testUnacceptableVararg1() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg1.kt"); + } + + @TestMetadata("unacceptableVararg2.kt") + public void testUnacceptableVararg2() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg2.kt"); + } + + @TestMetadata("withoutOperatorModifier.kt") + public void testWithoutOperatorModifier() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceContains/withoutOperatorModifier.kt"); + } } - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/extensionFunction.kt"); - } + @TestMetadata("idea/testData/intentions/conventionNameCalls/replaceInvoke") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ReplaceInvoke extends AbstractFe10BindingIntentionTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } - @TestMetadata("functionLiteralArgument.kt") - public void testFunctionLiteralArgument() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgument.kt"); - } + public void testAllFilesPresentInReplaceInvoke() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceInvoke"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); + } - @TestMetadata("functionLiteralArgumentAfterSemicolon.kt") - public void testFunctionLiteralArgumentAfterSemicolon() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgumentAfterSemicolon.kt"); - } + @TestMetadata("dotQualifiedReceiver.kt") + public void testDotQualifiedReceiver() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/dotQualifiedReceiver.kt"); + } - @TestMetadata("functionLiteralArgumentAtStartOfBlock.kt") - public void testFunctionLiteralArgumentAtStartOfBlock() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgumentAtStartOfBlock.kt"); - } + @TestMetadata("dotQualifiedReceiver2.kt") + public void testDotQualifiedReceiver2() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/dotQualifiedReceiver2.kt"); + } - @TestMetadata("functionLiteralArgumentInExpression.kt") - public void testFunctionLiteralArgumentInExpression() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/functionLiteralArgumentInExpression.kt"); - } + @TestMetadata("dotQualifiedReceiver3.kt") + public void testDotQualifiedReceiver3() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/dotQualifiedReceiver3.kt"); + } - @TestMetadata("invalidArgument.kt") - public void testInvalidArgument() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/invalidArgument.kt"); - } + @TestMetadata("expressionReceiver.kt") + public void testExpressionReceiver() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/expressionReceiver.kt"); + } - @TestMetadata("missingArgument.kt") - public void testMissingArgument() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/missingArgument.kt"); - } + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/extensionFunction.kt"); + } - @TestMetadata("missingDefaultArgument.kt") - public void testMissingDefaultArgument() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/missingDefaultArgument.kt"); - } + @TestMetadata("functionLiteralInvoke.kt") + public void testFunctionLiteralInvoke() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/functionLiteralInvoke.kt"); + } - @TestMetadata("multipleArguments.kt") - public void testMultipleArguments() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/multipleArguments.kt"); - } + @TestMetadata("invokeInExpression.kt") + public void testInvokeInExpression() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/invokeInExpression.kt"); + } - @TestMetadata("notContains.kt") - public void testNotContains() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/notContains.kt"); - } + @TestMetadata("java.kt") + public void testJava() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/java.kt"); + } - @TestMetadata("qualifier.kt") - public void testQualifier() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/qualifier.kt"); - } + @TestMetadata("namedArgumentInvoke.kt") + public void testNamedArgumentInvoke() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/namedArgumentInvoke.kt"); + } - @TestMetadata("simpleArgument.kt") - public void testSimpleArgument() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/simpleArgument.kt"); - } + @TestMetadata("noArgumentInvoke.kt") + public void testNoArgumentInvoke() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/noArgumentInvoke.kt"); + } - @TestMetadata("simpleStringLiteral.kt") - public void testSimpleStringLiteral() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/simpleStringLiteral.kt"); - } + @TestMetadata("notOperator.kt") + public void testNotOperator() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/notOperator.kt"); + } - @TestMetadata("super.kt") - public void testSuper() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/super.kt"); - } + @TestMetadata("typeAndValueArgument.kt") + public void testTypeAndValueArgument() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/typeAndValueArgument.kt"); + } - @TestMetadata("twoArgsContainsFromJava.kt") - public void testTwoArgsContainsFromJava() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/twoArgsContainsFromJava.kt"); - } + @TestMetadata("typeArgumentAndFunctionLiteral.kt") + public void testTypeArgumentAndFunctionLiteral() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/typeArgumentAndFunctionLiteral.kt"); + } - @TestMetadata("typeArguments.kt") - public void testTypeArguments() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/typeArguments.kt"); - } + @TestMetadata("valueAndFunctionLiteralInvoke.kt") + public void testValueAndFunctionLiteralInvoke() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/valueAndFunctionLiteralInvoke.kt"); + } - @TestMetadata("unacceptableVararg1.kt") - public void testUnacceptableVararg1() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg1.kt"); - } + @TestMetadata("valueArgumentInvoke.kt") + public void testValueArgumentInvoke() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/valueArgumentInvoke.kt"); + } - @TestMetadata("unacceptableVararg2.kt") - public void testUnacceptableVararg2() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg2.kt"); - } - - @TestMetadata("withoutOperatorModifier.kt") - public void testWithoutOperatorModifier() throws Exception { - runTest("idea/testData/intentions/conventionNameCalls/replaceContains/withoutOperatorModifier.kt"); + @TestMetadata("varargInvoke.kt") + public void testVarargInvoke() throws Exception { + runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/varargInvoke.kt"); + } } } diff --git a/idea/resources-fir/META-INF/fe10Binding.xml b/idea/resources-fir/META-INF/fe10Binding.xml index 598fdfa9f89..8bb6bd27a9a 100644 --- a/idea/resources-fir/META-INF/fe10Binding.xml +++ b/idea/resources-fir/META-INF/fe10Binding.xml @@ -10,5 +10,15 @@ Kotlin + + org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceInvokeIntention + Kotlin + + + + org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceCallWithUnaryOperatorIntention + Kotlin + + \ No newline at end of file