Inline Property supported for properties with setter
#KT-2638 Fixed
This commit is contained in:
@@ -22,6 +22,7 @@ import com.intellij.codeInsight.TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED
|
||||
import com.intellij.lang.refactoring.InlineActionHandler
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.refactoring.BaseRefactoringProcessor
|
||||
import com.intellij.refactoring.util.CommonRefactoringUtil
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||
@@ -69,9 +70,14 @@ abstract class AbstractInlineTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
TestCase.assertEquals("Expected errors", 1, expectedErrors.size)
|
||||
TestCase.assertEquals("Error message", expectedErrors[0].replace("\\n", "\n"), e.message)
|
||||
}
|
||||
catch (e: BaseRefactoringProcessor.ConflictsInTestsException) {
|
||||
TestCase.assertFalse("Conflicts: ${e.message}", afterFileExists)
|
||||
TestCase.assertEquals("Expected errors", 1, expectedErrors.size)
|
||||
TestCase.assertEquals("Error message", expectedErrors[0].replace("\\n", "\n"), e.message)
|
||||
}
|
||||
}
|
||||
else {
|
||||
TestCase.assertFalse(afterFileExists)
|
||||
TestCase.assertFalse("No refactoring handler available", afterFileExists)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1030,6 +1030,12 @@ public class InlineTestGenerated extends AbstractInlineTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateSet.kt")
|
||||
public void testPrivateSet() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/PrivateSet.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("QualifiedUsage.kt")
|
||||
public void testQualifiedUsage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/QualifiedUsage.kt");
|
||||
@@ -1068,6 +1074,18 @@ public class InlineTestGenerated extends AbstractInlineTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("GetterAndSetter.kt")
|
||||
public void testGetterAndSetter() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/accessors/GetterAndSetter.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PlusPlus.kt")
|
||||
public void testPlusPlus() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/accessors/PlusPlus.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WithInitializer.kt")
|
||||
public void testWithInitializer() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/inlineVariableOrProperty/property/accessors/WithInitializer.kt");
|
||||
|
||||
Reference in New Issue
Block a user