diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java index ccd2d287562..def0631cf8f 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java @@ -121,6 +121,7 @@ public class QuickFixes { JetIntentionActionFactory changeToPropertyNameFactory = ChangeToPropertyNameFix.createFactory(); factories.put(NO_BACKING_FIELD_ABSTRACT_PROPERTY, changeToPropertyNameFactory); + factories.put(NO_BACKING_FIELD_CUSTOM_ACCESSORS, changeToPropertyNameFactory); JetIntentionActionFactory unresolvedReferenceFactory = ImportClassAndFunFix.createFactory(); factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory); diff --git a/idea/testData/quickfix/variables/changeToPropertyName/afterCustomAccessors.kt b/idea/testData/quickfix/variables/changeToPropertyName/afterCustomAccessors.kt new file mode 100644 index 00000000000..3563ff95eaf --- /dev/null +++ b/idea/testData/quickfix/variables/changeToPropertyName/afterCustomAccessors.kt @@ -0,0 +1,7 @@ +// "Change '$foo' to 'foo'" "true" +class A { + val foo : Int + get() = 5 + val bar : Int + get() = foo +} \ No newline at end of file diff --git a/idea/testData/quickfix/variables/changeToPropertyName/beforeCustomAccessors.kt b/idea/testData/quickfix/variables/changeToPropertyName/beforeCustomAccessors.kt new file mode 100644 index 00000000000..1e26332be86 --- /dev/null +++ b/idea/testData/quickfix/variables/changeToPropertyName/beforeCustomAccessors.kt @@ -0,0 +1,7 @@ +// "Change '$foo' to 'foo'" "true" +class A { + val foo : Int + get() = 5 + val bar : Int + get() = $foo +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java index c8ba83a57f1..5c9a6712bc6 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java @@ -835,6 +835,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables/changeToPropertyName"), Pattern.compile("^before(\\w+)\\.kt$"), true); } + @TestMetadata("beforeCustomAccessors.kt") + public void testCustomAccessors() throws Exception { + doTest("idea/testData/quickfix/variables/changeToPropertyName/beforeCustomAccessors.kt"); + } + } public static Test innerSuite() {