Reformat File

How to reformat a file or section of code

Sometimes code formatting can get out of sync, but there's an easy fix in IntelliJ IDEA. You can use ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings.

You can also display the Reformat File dialog with ⌘⌥⇧L (macOS) / Ctrl+Alt+Shift+L (Windows/Linux).

Related Resources

Quick Documentation
Pull up Quick Documentation in the editor
Type Information
Pull up Type Information for an expression
Split and move right
View two files side by side