Kotlin and Java code templates in Android Studio.
I tried to create a code template for the truth library that would work like the val template works i.e,
functionName().val
.val f = functionName()
.How would I replicate this behaviour on the truth library such that when I type f.assert
for instance, I get Truth.assertThat(f)
?
This feature is named "Postfix completion"
You can find details here https://www.jetbrains.com/help/idea/settings-postfix-completion.html
I have tried now and it's allowed me to add and edit java and groovy templates but kotlin is not supported.
The other perfect feature of Idea is Live templates you can use them to implement required templates.
You can find details here https://www.jetbrains.com/help/idea/using-live-templates.html
Update: I have checked the current version of Idea, kotlin is not supported yet.