Create from usage: Support generation of Java fields from usages in Kotlin code
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
}
|
||||
|
||||
val A.foo: String?
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().<caret>foo
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
}
|
||||
|
||||
val A.foo: String?
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().<caret>foo
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create property 'foo'" "false"
|
||||
// ACTION: Convert to expression body
|
||||
// ACTION: Create extension property 'foo'
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().<caret>foo
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create property 'foo'" "false"
|
||||
// ACTION: Convert to expression body
|
||||
// ACTION: Disable 'Convert to Expression Body'
|
||||
// ACTION: Edit intention settings
|
||||
// ACTION: Create extension property 'foo'
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(a: A): String? {
|
||||
return a.<caret>foo
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface A {
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class A {
|
||||
|
||||
@Nullable
|
||||
public final String foo;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
}
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): String? {
|
||||
return A().<caret>foo
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class A {
|
||||
|
||||
@NotNull
|
||||
public String foo;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test() {
|
||||
A().foo = ""
|
||||
}
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test() {
|
||||
A().<caret>foo = ""
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user