I have a code like below:
notif("Hello", 2000).show()
but I can also use it like below:
val n = notif("Hello", 2000)
n.show()
So I made another fun that simplifies the first one into this:
showNotif("Hello", 2000)
Now I have added a lint rule that detects the first one and warns the user to change it to showNotif. but I don't know how to make a LintFix to that. I tried this:
LintFix.create()
.name("Use `showNotif()` function")
.replace()
.pattern("notif|show")
.with("showToast\k")
.shortenNames()
.reformat(true)
.robot(true)
.independent(false)
.build()
But It gives me this error: Illegal escape: \k
So how can I change multiple parts of a code?