diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtProperty.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtProperty.java index 246d602d2b3..01c0ef8059e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtProperty.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtProperty.java @@ -243,7 +243,14 @@ public class KtProperty extends KtTypeParameterListOwnerStub return (KtExpression) oldInitializer.replace(initializer); } else { - deleteChildRange(findChildByType(EQ), oldInitializer); + PsiElement nextSibling = oldInitializer.getNextSibling(); + PsiElement last = + nextSibling != null + && nextSibling.getNode() != null + && nextSibling.getNode().getElementType() == KtTokens.SEMICOLON + ? nextSibling : oldInitializer; + + deleteChildRange(findChildByType(EQ), last); return null; } } diff --git a/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/after.kt.template b/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/after.kt.template new file mode 100644 index 00000000000..57717f73075 --- /dev/null +++ b/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/after.kt.template @@ -0,0 +1,4 @@ +class A { + val foo: Int + get() = 1 +} \ No newline at end of file diff --git a/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/before.kt.template b/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/before.kt.template new file mode 100644 index 00000000000..45a9b7d4aa5 --- /dev/null +++ b/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/before.kt.template @@ -0,0 +1,3 @@ +class A { + val foo: Int = 1 +} \ No newline at end of file diff --git a/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/description.html b/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/description.html new file mode 100644 index 00000000000..88ff37ca5a8 --- /dev/null +++ b/idea/resources/intentionDescriptions/ConvertPropertyInitializerToGetterIntention/description.html @@ -0,0 +1,5 @@ + + +This intention converts property initializer to getter. + + \ No newline at end of file diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 02c0e62bcb2..4faae67eaab 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -1000,6 +1000,11 @@ Kotlin + + org.jetbrains.kotlin.idea.intentions.ConvertPropertyInitializerToGetterIntention + Kotlin + + org.jetbrains.kotlin.idea.intentions.InvertIfConditionIntention Kotlin diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPropertyInitializerToGetterIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPropertyInitializerToGetterIntention.kt new file mode 100644 index 00000000000..0051d847b83 --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertPropertyInitializerToGetterIntention.kt @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.intentions + +import com.intellij.openapi.editor.Editor +import org.jetbrains.kotlin.descriptors.PropertyDescriptor +import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade +import org.jetbrains.kotlin.psi.KtClassOrObject +import org.jetbrains.kotlin.psi.KtProperty +import org.jetbrains.kotlin.psi.KtPsiFactory +import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType +import org.jetbrains.kotlin.psi.psiUtil.isExtensionDeclaration +import org.jetbrains.kotlin.resolve.BindingContext + +class ConvertPropertyInitializerToGetterIntention : SelfTargetingIntention(javaClass(), "Convert property initializer to getter") { + override fun isApplicableTo(element: KtProperty, caretOffset: Int): Boolean { + return element.initializer != null + && element.initializer?.textRange?.containsOffset(caretOffset) == true + && element.getter == null + && !element.isExtensionDeclaration() + && !element.isLocal + } + + override fun applyTo(property: KtProperty, editor: Editor) { + convertPropertyInitializerToGetter(property, editor) + } + + companion object { + fun convertPropertyInitializerToGetter(property: KtProperty, editor: Editor?) { + val type = SpecifyTypeExplicitlyIntention.getTypeForDeclaration(property) + SpecifyTypeExplicitlyIntention.addTypeAnnotation(editor, property, type) + + val initializer = property.initializer!! + val getter = KtPsiFactory(property).createPropertyGetter(initializer) + val setter = property.setter + + if (setter != null) { + property.addBefore(getter, setter) + } + else { + property.add(getter) + } + + property.setInitializer(null) + } + } +} diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ConvertExtensionPropertyInitializerToGetterFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/ConvertExtensionPropertyInitializerToGetterFix.kt index 2ba6e5435e2..0da8ee14c38 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ConvertExtensionPropertyInitializerToGetterFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ConvertExtensionPropertyInitializerToGetterFix.kt @@ -20,6 +20,7 @@ import com.intellij.codeInsight.intention.IntentionAction import com.intellij.openapi.editor.Editor import com.intellij.openapi.project.Project import org.jetbrains.kotlin.diagnostics.Diagnostic +import org.jetbrains.kotlin.idea.intentions.ConvertPropertyInitializerToGetterIntention import org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.psi.KtFile @@ -34,20 +35,7 @@ class ConvertExtensionPropertyInitializerToGetterFix(element: KtExpression) : Ko override fun invoke(project: Project, editor: Editor?, file: KtFile) { val property = element.getParentOfType(true) ?: return - val type = SpecifyTypeExplicitlyIntention.getTypeForDeclaration(property) - SpecifyTypeExplicitlyIntention.addTypeAnnotation(editor, property, type) - - val getter = KtPsiFactory(element).createPropertyGetter(element) - val setter = property.setter - - if (setter != null) { - property.addBefore(getter, setter) - } - else { - property.add(getter) - } - - property.setInitializer(null) + ConvertPropertyInitializerToGetterIntention.convertPropertyInitializerToGetter(property, editor) } companion object : KotlinSingleIntentionActionFactory() { diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/.intention b/idea/testData/intentions/convertPropertyInitializerToGetter/.intention new file mode 100644 index 00000000000..52c0daa487e --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/.intention @@ -0,0 +1 @@ +org.jetbrains.kotlin.idea.intentions.ConvertPropertyInitializerToGetterIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfExtensionProperty.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfExtensionProperty.kt new file mode 100644 index 00000000000..4a70ca68fa5 --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfExtensionProperty.kt @@ -0,0 +1,6 @@ +// IS_APPLICABLE: false +// ERROR: Extension property cannot be initialized because it has no backing field + +class A + +val A.a: Int = 0 diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInFun.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInFun.kt new file mode 100644 index 00000000000..0b861eae29e --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInFun.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false + +fun foo() { + val x: Int = 1 +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInInitBlock.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInInitBlock.kt new file mode 100644 index 00000000000..6b468c990b1 --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInInitBlock.kt @@ -0,0 +1,7 @@ +// IS_APPLICABLE: false + +class A { + init { + val x: Int = 1 + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfNoInitializer.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfNoInitializer.kt new file mode 100644 index 00000000000..e17f06e0b2e --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfNoInitializer.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false + +abstract class A { + abstract val a: Int +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt new file mode 100644 index 00000000000..81415531701 --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt @@ -0,0 +1,6 @@ +class A { + var a = 1 + set(value) { + field = value + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt.after b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt.after new file mode 100644 index 00000000000..247d9494355 --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt.after @@ -0,0 +1,7 @@ +class A { + var a: Int + get() = 1 + set(value) { + field = value + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt new file mode 100644 index 00000000000..049e06c456e --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt @@ -0,0 +1,3 @@ +class A { + val a: Int = 1 +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt.after b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt.after new file mode 100644 index 00000000000..97c360caedc --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt.after @@ -0,0 +1,4 @@ +class A { + val a: Int + get() = 1 +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt new file mode 100644 index 00000000000..fe71ea701ff --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt @@ -0,0 +1,3 @@ +class A { + val a: Int = 1; +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt.after b/idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt.after new file mode 100644 index 00000000000..97c360caedc --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt.after @@ -0,0 +1,4 @@ +class A { + val a: Int + get() = 1 +} \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt b/idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt new file mode 100644 index 00000000000..e24d69fbd4f --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt @@ -0,0 +1 @@ +val x: Int = 1 \ No newline at end of file diff --git a/idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt.after b/idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt.after new file mode 100644 index 00000000000..834c4b17fc4 --- /dev/null +++ b/idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt.after @@ -0,0 +1,2 @@ +val x: Int + get() = 1 \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt b/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt index 9cc68e2878e..94f4e67315f 100644 --- a/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt @@ -1,4 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// ACTION: Convert property initializer to getter // ACTION: Create class 'SomeTest' // ACTION: Rename reference // ERROR: Unresolved reference: SomeTest diff --git a/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt b/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt index e9ca2b55f5d..0b31d5c69c8 100644 --- a/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt @@ -1,6 +1,7 @@ // "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" // ERROR: Unresolved reference: SomeTest // ERROR: Expression expected, but a package name found +// ACTION: Convert property initializer to getter // ACTION: Create class 'SomeTest' // ACTION: Replace safe access expression with 'if' expression // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt b/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt index 651bd39cebd..c5d7f740de3 100644 --- a/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt @@ -1,4 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// ACTION: Convert property initializer to getter // ACTION: Create class 'SomeClass' // ACTION: Create function 'SomeClass' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt b/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt index 66d6ba00915..12a74633437 100644 --- a/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt @@ -1,4 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// ACTION: Convert property initializer to getter // ACTION: Create class 'ExcludedClass' // ACTION: Create function 'ExcludedClass' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt b/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt index edbfdceba53..4a7ef9fcd23 100644 --- a/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt @@ -1,4 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// ACTION: Convert property initializer to getter // ACTION: Create function 'someFunction' // ACTION: Rename reference // ERROR: Unresolved reference: someFunction diff --git a/idea/testData/quickfix/createFromUsage/createVariable/localVariable/inClass.kt b/idea/testData/quickfix/createFromUsage/createVariable/localVariable/inClass.kt index ad14b0d5b3c..a2d71d294a9 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/localVariable/inClass.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/localVariable/inClass.kt @@ -1,4 +1,5 @@ // "Create local variable 'foo'" "false" +// ACTION: Convert property initializer to getter // ACTION: Create parameter 'foo' // ACTION: Create property 'foo' // ACTION: Rename reference diff --git a/idea/testData/quickfix/createFromUsage/createVariable/localVariable/onTopLevel.kt b/idea/testData/quickfix/createFromUsage/createVariable/localVariable/onTopLevel.kt index b4673054388..0025db2a185 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/localVariable/onTopLevel.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/localVariable/onTopLevel.kt @@ -1,4 +1,5 @@ // "Create local variable 'foo'" "false" +// ACTION: Convert property initializer to getter // ACTION: Create property 'foo' // ACTION: Rename reference // ERROR: Unresolved reference: foo diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInClassObject.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInClassObject.kt index 1f86cc144a2..359ae220589 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInClassObject.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInClassObject.kt @@ -1,4 +1,5 @@ // "Create parameter 'foo'" "false" +// ACTION: Convert property initializer to getter // ACTION: Create property 'foo' // ACTION: Rename reference // ERROR: Unresolved reference: foo diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInObject.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInObject.kt index 2dcc26ae408..bcfbab62992 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInObject.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerInObject.kt @@ -1,4 +1,5 @@ // "Create parameter 'foo'" "false" +// ACTION: Convert property initializer to getter // ACTION: Create property 'foo' // ACTION: Rename reference // ERROR: Unresolved reference: foo diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerNoClass.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerNoClass.kt index ce789e73881..7636d64874a 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerNoClass.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inPropertyInitializerNoClass.kt @@ -1,4 +1,5 @@ // "Create parameter 'foo'" "false" +// ACTION: Convert property initializer to getter // ACTION: Create property 'foo' // ACTION: Rename reference // ERROR: Unresolved reference: foo diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index 5ad3af3c0c7..2543b7bbee0 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -3707,6 +3707,63 @@ public class IntentionTestGenerated extends AbstractIntentionTest { } } + @TestMetadata("idea/testData/intentions/convertPropertyInitializerToGetter") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ConvertPropertyInitializerToGetter extends AbstractIntentionTest { + public void testAllFilesPresentInConvertPropertyInitializerToGetter() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/convertPropertyInitializerToGetter"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true); + } + + @TestMetadata("inapplicableIfExtensionProperty.kt") + public void testInapplicableIfExtensionProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfExtensionProperty.kt"); + doTest(fileName); + } + + @TestMetadata("inapplicableIfLocalVariableInFun.kt") + public void testInapplicableIfLocalVariableInFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInFun.kt"); + doTest(fileName); + } + + @TestMetadata("inapplicableIfLocalVariableInInitBlock.kt") + public void testInapplicableIfLocalVariableInInitBlock() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfLocalVariableInInitBlock.kt"); + doTest(fileName); + } + + @TestMetadata("inapplicableIfNoInitializer.kt") + public void testInapplicableIfNoInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfNoInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("propertyWithInitializerWithSetter.kt") + public void testPropertyWithInitializerWithSetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt"); + doTest(fileName); + } + + @TestMetadata("propertyWithInitializerWithoutAccessors.kt") + public void testPropertyWithInitializerWithoutAccessors() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithoutAccessors.kt"); + doTest(fileName); + } + + @TestMetadata("semicolon.kt") + public void testSemicolon() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/semicolon.kt"); + doTest(fileName); + } + + @TestMetadata("topLevelDeclaration.kt") + public void testTopLevelDeclaration() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/topLevelDeclaration.kt"); + doTest(fileName); + } + } + @TestMetadata("idea/testData/intentions/convertPropertyToFunction") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)