VERY rough implementation of annotations with parameters in ReplaceWIth pattern
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'test.Bar(1)'" "true"
|
||||
|
||||
package test
|
||||
|
||||
@Deprecated("Replace with bar", ReplaceWith("test.Bar(1)"))
|
||||
annotation class Foo
|
||||
|
||||
annotation class Bar(val p: Int)
|
||||
|
||||
@Foo<caret> class C {}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'test.Bar(1)'" "true"
|
||||
|
||||
package test
|
||||
|
||||
@Deprecated("Replace with bar", ReplaceWith("test.Bar(1)"))
|
||||
annotation class Foo
|
||||
|
||||
annotation class Bar(val p: Int)
|
||||
|
||||
@Bar(1) class C {}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'test.Bar(p, "")'" "true"
|
||||
|
||||
package test
|
||||
|
||||
@Deprecated("Replace with bar", ReplaceWith("test.Bar(p, \"\")"))
|
||||
annotation class Foo(val p: Int)
|
||||
|
||||
annotation class Bar(val p: Int, val s: String)
|
||||
|
||||
@Foo<caret>(1) class C {}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'test.Bar(p, "")'" "true"
|
||||
|
||||
package test
|
||||
|
||||
@Deprecated("Replace with bar", ReplaceWith("test.Bar(p, \"\")"))
|
||||
annotation class Foo(val p: Int)
|
||||
|
||||
annotation class Bar(val p: Int, val s: String)
|
||||
|
||||
@Bar(1, "") class C {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'NewClass(p + 1)'" "true"
|
||||
package ppp
|
||||
|
||||
@Deprecated("", ReplaceWith("NewClass(p + 1)"))
|
||||
class OldClass(p: Int)
|
||||
|
||||
class NewClass(p: Int)
|
||||
|
||||
fun foo() {
|
||||
<caret>OldClass(1)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'NewClass(p + 1)'" "true"
|
||||
package ppp
|
||||
|
||||
@Deprecated("", ReplaceWith("NewClass(p + 1)"))
|
||||
class OldClass(p: Int)
|
||||
|
||||
class NewClass(p: Int)
|
||||
|
||||
fun foo() {
|
||||
<caret>NewClass(1 + 1)
|
||||
}
|
||||
Reference in New Issue
Block a user