VERY rough implementation of annotations with parameters in ReplaceWIth pattern

This commit is contained in:
Valentin Kipyatkov
2015-10-09 22:24:14 +03:00
parent c8c3e88c82
commit 4290601807
11 changed files with 186 additions and 54 deletions
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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)
}
@@ -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)
}