Child pages
  • Code Formatting
Skip to end of metadata
Go to start of metadata

With Scala plugin you can reformat the code to make it more good-looking. For example, you may have a code block, with wrong indentation, spacing, etc.

All you have to do is to select it and press Ctrl+Alt+L

Icon

You can reformat a file, all files in a specified directory or a selected block of code---just select an appropriate option. Remember that you can always Undo this modification, even if it's made to a large number of files.

The formatting is fully customizable, so you can set the code style you like most.

  1. Press Ctrl+Alt+S to open the Settings Dialog,
  2. Expand Code Style and select Scala,
  3. Perform any adjustments you think necessary
Icon

These settings also affect the auto indentation when you press Enter (for example, if (condition) <Enter>)

Icon

When you reformat a multiline code block surrounded by { and }, it's expanded and the surrounding braces are placed on separate lines. Single line code blocks are left intact.

  • No labels