# Postfix Completion

> For the complete documentation index, see [llms.txt](https://plugins.jetbrains.com/docs/intellij/llms.txt).

> **TL;DR**
> Product Help: [Postfix Completion](https://www.jetbrains.com/help/idea/auto-completing-code.html#postfix_completion)

The Postfix Completion functionality allows developers to wrap a code fragment with a predefined template by typing a template abbreviation just after an expression meant to be wrapped, expanded, or modified. It relieves developers from typing repetitive or non-trivial code or helps to create the code faster, e.g., often it is convenient to write a code part and surround it with the required block without navigating the caret backward.

Consider a situation where a developer is not very familiar with a current Java project API and doesn't know how to name a variable that will be a result of an expression they want to type. The postfix completion makes it possible to write an expression at first and create a variable assignment with suggested names by adding a postfix template abbreviation at the end of the expression.

Assume that a user typed the following Java code:

```JAVA
void confirmOrder(Cart cart) {
  cart.getDeliveryType().getDeliveryCost()<caret>
}
```

To avoid moving the caret to the beginning of the line, the user can quickly create a variable assignment by adding the `.var` postfix abbreviation and expanding the template:

```JAVA
void confirmOrder(Cart cart) {
  cart.getDeliveryType().getDeliveryCost().var<ENTER>
}
```

When the template is applied, the above code is expanded to:

```JAVA
void confirmOrder(Cart cart) {
  Money deliveryCost = cart.getDeliveryType().getDeliveryCost();<caret>
}
```

In addition, the user can choose the best matching variable name from the name suggestions popup.

These sections describe how to implement Postfix Templates, and their associated building blocks, to plugins:

* [Postfix Templates](postfix-templates.html)

* [Advanced Postfix Templates](advanced-postfix-templates.html)

