Create from usage (function/property): Suggest separate actions for extensions and non-extension declarations
#KT-6023 Fixed
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// "Import" "false"
|
||||
// ACTION: Create extension function 'inc'
|
||||
// ACTION: Create function 'inc'
|
||||
// ACTION: Create local variable '++'
|
||||
// ACTION: Create parameter '++'
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// "Create class 'Foo'" "false"
|
||||
// ACTION: Create function 'Foo'
|
||||
// ACTION: Create extension function 'Foo'
|
||||
// ACTION: Replace with infix function call
|
||||
// ACTION: Split property declaration
|
||||
// ERROR: Unresolved reference: Foo
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// "Create class 'Foo'" "false"
|
||||
// ACTION: Create function 'Foo'
|
||||
// ACTION: Create extension function 'Foo'
|
||||
// ACTION: Convert to expression body
|
||||
// ERROR: Unresolved reference: Foo
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// "Create class 'Foo'" "false"
|
||||
// ACTION: Create function 'Foo'
|
||||
// ACTION: Create extension function 'Foo'
|
||||
// ERROR: Unresolved reference: Foo
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// "Create class 'A'" "false"
|
||||
// ACTION: Create extension property 'A'
|
||||
// ACTION: Create property 'A'
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// "Create enum constant 'A'" "false"
|
||||
// ACTION: Create extension property 'A'
|
||||
// ACTION: Create property 'A'
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// "Create object 'A'" "false"
|
||||
// ACTION: Create extension property 'A'
|
||||
// ACTION: Create property 'A'
|
||||
// ERROR: Unresolved reference: A
|
||||
package p
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'plus'" "true"
|
||||
// "Create extension function 'plus'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'plus'" "true"
|
||||
// "Create extension function 'plus'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
fun test() {
|
||||
val a: Int = Unit.foo(2)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
fun test() {
|
||||
val a: Int = Unit.<caret>foo(2)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'foo'" "true"
|
||||
// "Create extension function 'foo'" "true"
|
||||
|
||||
class A<T>(val items: List<T>) {
|
||||
fun test(): Int {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'component2'" "true"
|
||||
// "Create extension function 'component2'" "true"
|
||||
class FooIterator<T> {
|
||||
fun hasNext(): Boolean { return false }
|
||||
fun next(): Any {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'component2'" "true"
|
||||
// "Create extension function 'component2'" "true"
|
||||
class FooIterator<T> {
|
||||
fun hasNext(): Boolean { return false }
|
||||
fun next(): Any {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'get'" "true"
|
||||
// "Create extension function 'get'" "true"
|
||||
fun x (y: Any) {
|
||||
val z: Any = y[""]
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'get'" "true"
|
||||
// "Create extension function 'get'" "true"
|
||||
fun x (y: Any) {
|
||||
val z: Any = y<caret>[""]
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'invoke'" "true"
|
||||
// "Create extension function 'invoke'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'invoke'" "true"
|
||||
// "Create extension function 'invoke'" "true"
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'set'" "true"
|
||||
// "Create extension function 'set'" "true"
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'set'" "true"
|
||||
// "Create extension function 'set'" "true"
|
||||
|
||||
class Foo<T> {
|
||||
fun <T> x (y: Any, w: java.util.ArrayList<T>) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'minus'" "true"
|
||||
// "Create extension function 'minus'" "true"
|
||||
|
||||
fun test() {
|
||||
val a = -false
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create function 'minus'" "true"
|
||||
// "Create extension function 'minus'" "true"
|
||||
|
||||
fun test() {
|
||||
val a = <caret>-false
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// "Create local variable 'foo'" "false"
|
||||
// ACTION: Create extension property 'foo'
|
||||
// ACTION: Create property 'foo'
|
||||
// ACTION: Split property declaration
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// "Create parameter 'foo'" "false"
|
||||
// ACTION: Split property declaration
|
||||
// ACTION: Create extension property 'foo'
|
||||
// ACTION: Create property 'foo'
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
fun test() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// "Create property 'foo'" "false"
|
||||
// ACTION: Create extension function 'bar'
|
||||
// ACTION: Create function 'bar'
|
||||
// ACTION: Replace with infix function call
|
||||
// ERROR: Unresolved reference: bar
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
fun test() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
Reference in New Issue
Block a user