Add intentions to move property from/to primary constructor
#KT-4578 Fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.MovePropertyToClassBodyIntention
|
||||
@@ -0,0 +1,6 @@
|
||||
annotation class Annotation1(val a: Int = 0)
|
||||
annotation class Annotation2(val a: Int = 0)
|
||||
annotation class Annotation3(val a: Int = 0)
|
||||
|
||||
|
||||
class TestClass(private @param:Annotation1(42) @property:Annotation1(42) @field:Annotation2(42) @Annotation3(42) val <caret>text: String = "LoremIpsum")
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
annotation class Annotation1(val a: Int = 0)
|
||||
annotation class Annotation2(val a: Int = 0)
|
||||
annotation class Annotation3(val a: Int = 0)
|
||||
|
||||
|
||||
class TestClass(@Annotation1(42) @Annotation3(42) text: String = "LoremIpsum") {
|
||||
private @Annotation1(42) @field:Annotation2(42) val text = text
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
@Target(AnnotationTarget.VALUE_PARAMETER)
|
||||
annotation class ParameterAnnotation(val a: Int = 0)
|
||||
|
||||
class TestClass(private @ParameterAnnotation(42) val <caret>text: String = "LoremIpsum", val flag: Boolean)
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
@Target(AnnotationTarget.VALUE_PARAMETER)
|
||||
annotation class ParameterAnnotation(val a: Int = 0)
|
||||
|
||||
class TestClass(@ParameterAnnotation(42) text: String = "LoremIpsum", val flag: Boolean) {
|
||||
private val text = text
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FIELD)
|
||||
annotation class PropertyAnnotation(val a: Int = 0)
|
||||
|
||||
class TestClass(private @PropertyAnnotation(42) val <caret>text: String = "LoremIpsum")
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FIELD)
|
||||
annotation class PropertyAnnotation(val a: Int = 0)
|
||||
|
||||
class TestClass(text: String = "LoremIpsum") {
|
||||
private @PropertyAnnotation(42) val text = text
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class TestClass(val <caret>text: String)
|
||||
@@ -0,0 +1,3 @@
|
||||
class TestClass(text: String) {
|
||||
val text = text
|
||||
}
|
||||
Reference in New Issue
Block a user