I'm trying to find
@BindView($ResId) internal lateinit var $FieldName: $Class
And replace with
private val $FieldName by bindView<$Class>($ResId)
What's the syntax to do that with Intellij Find & Replace feature?
First, we have to activate the checkbox Regex in the Find & Replace bar if it should only affect the current file, or in the Replace in Path dialog for the whole project:
Using this regular expression with 3 capturing groups in the Find text field should work:
@BindView\((.*)\) internal lateinit var (.*): (.*)
Now we can use the variables $1
for $ResId, $2
for $FieldName and $3
for $Class in the Replace text field:
private val $2 by bindView<$3>($1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With