Search code examples
intellij-ideareformat

Make IntelliJ reformat the current line on line-completion


Is there a way to have my line reformatted upon completing it in IntelliJ? (For those familiar, this kind of feature is available on FlashDevelop.)

Let's says I just entered this code in PHP:

$var=array("a","b","c");

Upon entering the semicolon, I would like the editor to reformat it to (or whatever my configuration states):

$var = array("a", "b", "c");

This auto-reformat trigger could also be executed on brackets and other line-terminators characters.


Solution

  • There is no such feature in IDEA. You can use Reformat Code (Ctrl + Alt + L) action when needed.