Add ReplaceInvoke adn ReplaceCallWithUnaryOperator intention support
Surprisingly all test passed
This commit is contained in:
@@ -1246,7 +1246,7 @@ fun main(args: Array<String>) {
|
|||||||
testGroup("idea/idea-fir-fe10-binding/tests", "idea") {
|
testGroup("idea/idea-fir-fe10-binding/tests", "idea") {
|
||||||
testClass<AbstractFe10BindingIntentionTest> {
|
testClass<AbstractFe10BindingIntentionTest> {
|
||||||
val pattern = "^([\\w\\-_]+)\\.(kt|kts)$"
|
val pattern = "^([\\w\\-_]+)\\.(kt|kts)$"
|
||||||
model("testData/intentions/conventionNameCalls/replaceContains", pattern = pattern)
|
model("testData/intentions/conventionNameCalls", pattern = pattern)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+195
-1
@@ -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 */
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("idea/testData/intentions/conventionNameCalls/replaceContains")
|
@TestMetadata("idea/testData/intentions/conventionNameCalls")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public class Fe10BindingIntentionTestGenerated extends AbstractFe10BindingIntentionTest {
|
public class Fe10BindingIntentionTestGenerated extends AbstractFe10BindingIntentionTest {
|
||||||
@@ -25,6 +25,106 @@ public class Fe10BindingIntentionTestGenerated extends AbstractFe10BindingIntent
|
|||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInConventionNameCalls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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("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 {
|
public void testAllFilesPresentInReplaceContains() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceContains"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceContains"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
|
||||||
}
|
}
|
||||||
@@ -134,3 +234,97 @@ public class Fe10BindingIntentionTestGenerated extends AbstractFe10BindingIntent
|
|||||||
runTest("idea/testData/intentions/conventionNameCalls/replaceContains/withoutOperatorModifier.kt");
|
runTest("idea/testData/intentions/conventionNameCalls/replaceContains/withoutOperatorModifier.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInReplaceInvoke() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/conventionNameCalls/replaceInvoke"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("dotQualifiedReceiver.kt")
|
||||||
|
public void testDotQualifiedReceiver() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/dotQualifiedReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("dotQualifiedReceiver2.kt")
|
||||||
|
public void testDotQualifiedReceiver2() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/dotQualifiedReceiver2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("dotQualifiedReceiver3.kt")
|
||||||
|
public void testDotQualifiedReceiver3() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/dotQualifiedReceiver3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("expressionReceiver.kt")
|
||||||
|
public void testExpressionReceiver() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/expressionReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionFunction.kt")
|
||||||
|
public void testExtensionFunction() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/extensionFunction.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("functionLiteralInvoke.kt")
|
||||||
|
public void testFunctionLiteralInvoke() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/functionLiteralInvoke.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("invokeInExpression.kt")
|
||||||
|
public void testInvokeInExpression() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/invokeInExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("java.kt")
|
||||||
|
public void testJava() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/java.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("namedArgumentInvoke.kt")
|
||||||
|
public void testNamedArgumentInvoke() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/namedArgumentInvoke.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("noArgumentInvoke.kt")
|
||||||
|
public void testNoArgumentInvoke() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/noArgumentInvoke.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("notOperator.kt")
|
||||||
|
public void testNotOperator() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/notOperator.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeAndValueArgument.kt")
|
||||||
|
public void testTypeAndValueArgument() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/typeAndValueArgument.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeArgumentAndFunctionLiteral.kt")
|
||||||
|
public void testTypeArgumentAndFunctionLiteral() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/typeArgumentAndFunctionLiteral.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valueAndFunctionLiteralInvoke.kt")
|
||||||
|
public void testValueAndFunctionLiteralInvoke() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/valueAndFunctionLiteralInvoke.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("valueArgumentInvoke.kt")
|
||||||
|
public void testValueArgumentInvoke() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/valueArgumentInvoke.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("varargInvoke.kt")
|
||||||
|
public void testVarargInvoke() throws Exception {
|
||||||
|
runTest("idea/testData/intentions/conventionNameCalls/replaceInvoke/varargInvoke.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,5 +10,15 @@
|
|||||||
<category>Kotlin</category>
|
<category>Kotlin</category>
|
||||||
</intentionAction>
|
</intentionAction>
|
||||||
|
|
||||||
|
<intentionAction>
|
||||||
|
<className>org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceInvokeIntention</className>
|
||||||
|
<category>Kotlin</category>
|
||||||
|
</intentionAction>
|
||||||
|
|
||||||
|
<intentionAction>
|
||||||
|
<className>org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceCallWithUnaryOperatorIntention</className>
|
||||||
|
<category>Kotlin</category>
|
||||||
|
</intentionAction>
|
||||||
|
|
||||||
</extensions>
|
</extensions>
|
||||||
</idea-plugin>
|
</idea-plugin>
|
||||||
Reference in New Issue
Block a user