#KT-9938 Fixed

Code review fixes
This commit is contained in:
Anton Sukhonosenko
2015-12-07 22:48:47 +03:00
parent 6b49ac6b46
commit da5f71773a
11 changed files with 8 additions and 11 deletions
@@ -1,4 +1,4 @@
class A {
val foo: Int
get() = 1
<spot>get() = 1</spot>
}
@@ -33,7 +33,6 @@ class ConvertPropertyInitializerToGetterIntention : SelfTargetingIntention<KtPro
&& element.getter == null
&& !element.isExtensionDeclaration()
&& !element.isLocal
&& !element.isTopLevel
}
override fun applyTo(property: KtProperty, editor: Editor) {
@@ -1,3 +0,0 @@
// IS_APPLICABLE: false
val x: Int = 1<caret>
@@ -1,4 +1,5 @@
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
// ACTION: Convert property initializer to getter
// ACTION: Create class 'SomeTest'
// ERROR: Unresolved reference: SomeTest
@@ -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
@@ -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'
// ERROR: Unresolved reference: SomeClass
@@ -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'
// ERROR: Unresolved reference: ExcludedClass
@@ -1,4 +1,5 @@
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
// ACTION: Convert property initializer to getter
// ACTION: Create function 'someFunction'
// ERROR: Unresolved reference: someFunction
@@ -1,4 +1,5 @@
// "Create local variable 'foo'" "false"
// ACTION: Convert property initializer to getter
// ACTION: Create property 'foo'
// ERROR: Unresolved reference: foo
@@ -1,4 +1,5 @@
// "Create parameter 'foo'" "false"
// ACTION: Convert property initializer to getter
// ACTION: Create property 'foo'
// ERROR: Unresolved reference: foo
@@ -3739,12 +3739,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
@TestMetadata("inapplicableIfTopLevelDeclaration.kt")
public void testInapplicableIfTopLevelDeclaration() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/inapplicableIfTopLevelDeclaration.kt");
doTest(fileName);
}
@TestMetadata("propertyWithInitializerWithSetter.kt")
public void testPropertyWithInitializerWithSetter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt");