It seems I can't add custom postfix completions for Kotlin in neither IntelliJ IDEA (2018.3), nor in Android studio (3.2.1). If I go to preferences | Editor | General | Postfix Completion and I click the add button, there is no option for Kotlin (see screenshots below). Is it possible to add new postfix completions?
I'd like to add a .with
postfix completion, so that x.with
would expand to
with(x) {
// The caret should go here
}
Side note: I think it's a shame there is no postfix completion for with
out of the box.
Screenshots of IntelliJ IDEA (2018.3) and Android Studio (3.2.1):
I checked, and it's not possible in Android Studio nor IntelliJ. Probably the definition language doesn't have support for Kotlin yet.
However, what you could try, is try the following plugin: https://plugins.jetbrains.com/plugin/9862-custom-postfix-templates.
It seems to be well maintained, and has support for Scala, Kotlin, Groovy, etc. I haven't tried it myself, but based on the documentation, it seems to be what you're looking for.
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