IntelliJ postfix completions

IntelliJ’s postfix completions were announced in 2014 but remain relatively unknown. Postfix code completion helps reduce backward caret jumps as you write code. You use it as if you’re auto-completing a method name, but with the name of a postfix template.

Here are a few postfix completions I’ve added for Java. They are available for download here.

Before: $EXPR$.rethrow

After: throw new RuntimeException($EXPR$);

Applicable type: java.lang.Exception

Before: $EXPR$.adapt

After: org.eclipse.collections.impl.list.mutable.ListAdapter.adapt($EXPR$)

Applicable type: java.util.List

In addition to ListAdapter, I have equivalent rules for SetAdapter, MapAdapter, and ArrayAdapter. Since each applies to a specific type, it’s not a problem for all 4 to share the same key “adapt”.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store