Rearranging Code Using Arrangement Rules
On this page:
Defining rearrangement rules
- Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing for Windows and Linux or for macOS, and click Code Style under Editor.
- Under the Code Style node, choose.
You can invoke code rearrangement via the Find Action popup or as a part of code reformatting.
To invoke rearrangement via Find Action
Choose or press Ctrl+Shift+A, start typing
Rearrange Code, and then choose
Rearrange Code from the list.
To run rearrangement during code reformatting
Open the Reformat Code dialog box by pressing Ctrl+Shift+Alt+L and select the Rearrange Code checkbox. Your code will be rearranged every time the Reformat code action is invoked.