refactor ConvertFunctionToPropertyIntention and fix 'Convert function to property shouldn't insert explicit type if it was inferred previously' (#1011)

Fixes #KT-14820
This commit is contained in:
Kirill Rakhman
2017-05-19 20:32:11 +02:00
committed by Dmitry Jemerov
parent 927cd04405
commit 4cbdbaa057
12 changed files with 99 additions and 37 deletions
@@ -4151,12 +4151,24 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/convertFunctionToProperty"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("annotationLineBreak.kt")
public void testAnnotationLineBreak() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertFunctionToProperty/annotationLineBreak.kt");
doTest(fileName);
}
@TestMetadata("blockBody.kt")
public void testBlockBody() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertFunctionToProperty/blockBody.kt");
doTest(fileName);
}
@TestMetadata("comments.kt")
public void testComments() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertFunctionToProperty/comments.kt");
doTest(fileName);
}
@TestMetadata("existingPropertyConflict.kt")
public void testExistingPropertyConflict() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertFunctionToProperty/existingPropertyConflict.kt");
@@ -4223,6 +4235,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
@TestMetadata("noExplicitType.kt")
public void testNoExplicitType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertFunctionToProperty/noExplicitType.kt");
doTest(fileName);
}
@TestMetadata("nothingFun.kt")
public void testNothingFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertFunctionToProperty/nothingFun.kt");