IntelliJ IDEA 15 EAP Adds Postfix Code Completion for Scala

Posted on by Maksim Sobolevskiy

For Java, in addition to the regular completion, IntelliJ IDEA provides so-called Postfix completion: it lets you modify a previously entered expression by adding a “postfix” to it and pressing Tab. This way you can transform your code without unnecessary backward caret jumps.

Many users’ve asked us to support this feature for Scala as well. You asked, we did it:

hachiko

When a transformation can be applied to several expressions, the IDE will offer you a choice:

Postfix1

Postfix completion suggestions are included in the common completion list, and if you want to see only postfix completion applicable in the context, press Ctrl + J (Cmd + J for OS X):

Postfix3

To see the full list of postfix completion templates, go to Settings → Editor → General → Postfix Completion:

Postfix2

Remember, we welcome your feedback on our discussion forum and your bug reports in the issue tracker.

Develop with Pleasure!

Comments below can no longer be edited.

3 Responses to IntelliJ IDEA 15 EAP Adds Postfix Code Completion for Scala

  1. jotomo says:

    October 4, 2015

    Great stuff!
    The postfix completions don’t show when the expression spans multiple lines. Is that a known limitation or a bug?

    • Roman Shein says:

      October 5, 2015

      Hello, jotomo.
      Thank you for the feedback.

      This is not supposed to happen as long as the expression you are trying to apply completion for is valid for the completion. It would be great if you could provide an example of expression failing to spawn completion suggestions (or, even better, create a ticket on our bug-tracker https://youtrack.jetbrains.com/issues/SCL) so that I can look into it and deliver a better coding experience for you.