DeprecatedSymbolUsageFix preserves comments
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p4, p3, p2, p1, p0)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p4, p3, p2, p1, p0)"))
|
||||
fun oldFun(p0: Int, p1: Int, p2: Int, p3: Int, p4: Int){}
|
||||
|
||||
fun newFun(p4: Int, p3: Int, p2: Int, p1: Int, p0: Int){}
|
||||
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(/* 0 */ 0,
|
||||
/* 1 */ 1,
|
||||
2, // 2
|
||||
3, /* 4 */ 4)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p4, p3, p2, p1, p0)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p4, p3, p2, p1, p0)"))
|
||||
fun oldFun(p0: Int, p1: Int, p2: Int, p3: Int, p4: Int){}
|
||||
|
||||
fun newFun(p4: Int, p3: Int, p2: Int, p1: Int, p0: Int){}
|
||||
|
||||
|
||||
fun foo() {
|
||||
newFun(/* 4 */ 4, 3, 2, // 2
|
||||
/* 1 */ 1, /* 0 */ 0)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(O /* use zero */)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
newFun()/* use zero */
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'newFun(this, p1, p2)'" "true"
|
||||
|
||||
interface X {
|
||||
@deprecated("", ReplaceWith("newFun(this, p1, p2)"))
|
||||
fun oldFun(p1: Int, p2: Int)
|
||||
}
|
||||
|
||||
fun newFun(x: X, a: Int, b: Int){}
|
||||
|
||||
fun foo(x: X) {
|
||||
x/*receiver*/.<caret>oldFun(
|
||||
1, // pass 1
|
||||
2 // pass 2
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(this, p1, p2)'" "true"
|
||||
|
||||
interface X {
|
||||
@deprecated("", ReplaceWith("newFun(this, p1, p2)"))
|
||||
fun oldFun(p1: Int, p2: Int)
|
||||
}
|
||||
|
||||
fun newFun(x: X, a: Int, b: Int){}
|
||||
|
||||
fun foo(x: X) {
|
||||
newFun(x/*receiver*/, 1, // pass 1
|
||||
2 // pass 2
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun(p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p)
|
||||
}
|
||||
|
||||
fun newFun(p: Int){}
|
||||
}
|
||||
|
||||
fun foo(x: X) {
|
||||
x/*receiver*/.<caret>oldFun(1/*parameter*/)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun(p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p)
|
||||
}
|
||||
|
||||
fun newFun(p: Int){}
|
||||
}
|
||||
|
||||
fun foo(x: X) {
|
||||
x/*receiver*/.<caret>newFun(1/*parameter*/)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
fun newFun(p1: Int, p2: Int){}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(0/*use zero*/)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
fun newFun(p1: Int, p2: Int){}
|
||||
|
||||
fun foo() {
|
||||
newFun(0/*use zero*/, 0)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
fun newFun(p1: Int, p2: Int){}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(bar()/*use bar()*/)
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
fun newFun(p1: Int, p2: Int){}
|
||||
|
||||
fun foo() {
|
||||
val p = bar()/*use bar()*/
|
||||
newFun(p, p)
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
Reference in New Issue
Block a user