The Code Outlining feature helps you to work on only the necessary part of a code without being distracted to other functionality blocks. This option automatically divides your code into separate code blocks between methods, tags, etc. and gives you the ability to selectively hide the parts of a code that you don't need right now.
In the editor next to the line number, you can see the Code Outlining tool — a vertical line with a 'minus' on it. Hover a cursor on it, and you will see a code block that can be collapsed: a part of the code is highlighted.
You can collapse a code block in three different ways:
- click on a 'minus' on the code outlining tool,
- place a cursor in a necessary code block and press the Opt+Cmd+Left Arrow hotkey,
- use the options from the Main Menu:
Edit ⇒ Folding.
The selected code block will be collapsed and instead of it, you will see …. Hover a cursor on it, and you will see the hidden code block.
When you want to open a collapsed block, just do one of the actions mentioned above one more time.
The Code Outlining tool also recognizes multiline comments. You can collapse comments in a code by the same methods. The selected code block will be collapsed and instead of it, you will see the
/* multiline comment */ tooltip. Hover a cursor on it, and you will see the hidden block.
Code Outlining options
All the options related to the Code Outlining functionality can be found in the Main Menu:
Edit ⇒ Folding.
|Toggle Fold||Opt+Cmd+Left Arrow||Collapses / expands the selected code block.|
|Toggle All Folds||Opt+Shift+Cmd+Right Arrow||Sets all the blocks to the same state as the selected.|
|Collapse to Definitions||Opt+Shift+Cmd+Left Arrow||Collapses the members of all types.|
In this section:
This also may be useful: