#KT-9938 Fixed
Code review fixes
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
class A {
|
class A {
|
||||||
val foo: Int
|
val foo: Int
|
||||||
get() = 1
|
<spot>get() = 1</spot>
|
||||||
}
|
}
|
||||||
-1
@@ -33,7 +33,6 @@ class ConvertPropertyInitializerToGetterIntention : SelfTargetingIntention<KtPro
|
|||||||
&& element.getter == null
|
&& element.getter == null
|
||||||
&& !element.isExtensionDeclaration()
|
&& !element.isExtensionDeclaration()
|
||||||
&& !element.isLocal
|
&& !element.isLocal
|
||||||
&& !element.isTopLevel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun applyTo(property: KtProperty, editor: Editor) {
|
override fun applyTo(property: KtProperty, editor: Editor) {
|
||||||
|
|||||||
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
// IS_APPLICABLE: false
|
|
||||||
|
|
||||||
val x: Int = 1<caret>
|
|
||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create class 'SomeTest'
|
// ACTION: Create class 'SomeTest'
|
||||||
// ERROR: Unresolved reference: SomeTest
|
// ERROR: Unresolved reference: SomeTest
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
@@ -1,6 +1,7 @@
|
|||||||
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
||||||
// ERROR: Unresolved reference: SomeTest
|
// ERROR: Unresolved reference: SomeTest
|
||||||
// ERROR: Expression expected, but a package name found
|
// ERROR: Expression expected, but a package name found
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create class 'SomeTest'
|
// ACTION: Create class 'SomeTest'
|
||||||
// ACTION: Replace safe access expression with 'if' expression
|
// ACTION: Replace safe access expression with 'if' expression
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create class 'SomeClass'
|
// ACTION: Create class 'SomeClass'
|
||||||
// ACTION: Create function 'SomeClass'
|
// ACTION: Create function 'SomeClass'
|
||||||
// ERROR: Unresolved reference: SomeClass
|
// ERROR: Unresolved reference: SomeClass
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create class 'ExcludedClass'
|
// ACTION: Create class 'ExcludedClass'
|
||||||
// ACTION: Create function 'ExcludedClass'
|
// ACTION: Create function 'ExcludedClass'
|
||||||
// ERROR: Unresolved reference: ExcludedClass
|
// ERROR: Unresolved reference: ExcludedClass
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false"
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create function 'someFunction'
|
// ACTION: Create function 'someFunction'
|
||||||
// ERROR: Unresolved reference: someFunction
|
// ERROR: Unresolved reference: someFunction
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Create local variable 'foo'" "false"
|
// "Create local variable 'foo'" "false"
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create property 'foo'
|
// ACTION: Create property 'foo'
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Create parameter 'foo'" "false"
|
// "Create parameter 'foo'" "false"
|
||||||
|
// ACTION: Convert property initializer to getter
|
||||||
// ACTION: Create property 'foo'
|
// ACTION: Create property 'foo'
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
|
|||||||
@@ -3739,12 +3739,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
|||||||
doTest(fileName);
|
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")
|
@TestMetadata("propertyWithInitializerWithSetter.kt")
|
||||||
public void testPropertyWithInitializerWithSetter() throws Exception {
|
public void testPropertyWithInitializerWithSetter() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertPropertyInitializerToGetter/propertyWithInitializerWithSetter.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user