Intentions to generate accessors for a property #KT-17322 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
fe0f44da94
commit
5a5a27b983
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.AddPropertyAccessorsIntention
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
abstract class Test {
|
||||
abstract var x<caret>: Int
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
import kotlin.reflect.KProperty
|
||||
class Test {
|
||||
var x<caret>: String by Delegate()
|
||||
}
|
||||
class Delegate {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = ""
|
||||
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Foo
|
||||
class Test {
|
||||
lateinit var x<caret>: Foo
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
fun test() {
|
||||
var x<caret> = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var x<caret> = 1
|
||||
@@ -0,0 +1,5 @@
|
||||
var x = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
val x<caret> = 1
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.AddPropertyGetterIntention
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
abstract class Test {
|
||||
abstract var x<caret>: Int
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
import kotlin.reflect.KProperty
|
||||
class Test {
|
||||
var x<caret>: String by Delegate()
|
||||
}
|
||||
class Delegate {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = ""
|
||||
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Foo
|
||||
class Test {
|
||||
lateinit var x<caret>: Foo
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
fun test() {
|
||||
var x<caret> = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var x<caret> = 1
|
||||
@@ -0,0 +1,2 @@
|
||||
var x = 1
|
||||
get() = field
|
||||
@@ -0,0 +1,3 @@
|
||||
class Test {
|
||||
val x<caret> = 1
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
val x<caret> = 1
|
||||
get() = field
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.AddPropertySetterIntention
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
abstract class Test {
|
||||
abstract var x<caret>: Int
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
import kotlin.reflect.KProperty
|
||||
class Test {
|
||||
var x<caret>: String by Delegate()
|
||||
}
|
||||
class Delegate {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = ""
|
||||
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Foo
|
||||
class Test {
|
||||
lateinit var x<caret>: Foo
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
fun test() {
|
||||
var x<caret> = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var x<caret> = 1
|
||||
@@ -0,0 +1,4 @@
|
||||
var x = 1
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
class Test {
|
||||
val x<caret> = 1
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
var x<caret> = 1
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user