Reformat code

How to reformat code

Reformat your file, or part of your file, at any time with ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) according to your code style settings. To remove custom line breaks, reformat the file or code again.

Display the Reformat File dialog with ⌘⌥⇧L (macOS) / Ctrl+Alt+Shift+L (Windows/Linux). In this dialog, we can select the scope we want to apply; either the whole file, or only changes that haven't been committed to VCS yet.

We can select a piece of code and use ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) to open the Adjust code style settings dialog.


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