Replace when using lint fix

67 views
Skip to first unread message

Victor Oben

unread,
Jul 8, 2019, 1:59:52 PM7/8/19
to lint-dev
I'm trying to replace the occurrence `this` in my class with a function called `getMyValue()` which I'm guessing in kotlin would be `myValue`. The function getMyValue() is a function is the parent class. The issue is, when I do alt+ enter to fix, the IDE correctly fixes it but spits out an unresolved reference. I'm guess it doesn't know where to find the method. What am I missing here and how would I fix this?

val fix =
fix()
.replace()
.name("Replace with `myValue`")
.text("this")
.shortenNames()
.reformat(true)
.with("myValue")
.build()

context.report(
LintIssueRegistry.ISSUE, node, context.getLocation(node),
"Use `myValue` instead of `this`", fix
)

Victor Oben

unread,
Jul 9, 2019, 1:06:02 PM7/9/19
to lint-dev
There was a typo on my end. Fixed
Reply all
Reply to author
Forward
0 new messages