Using Code Folding
Code Folding collapses or "folds" the display of a block of code.
To enable code folding, go to the Folding Preferences page, accessible from Window | Preferences | PHP | Editor | Code Folding .
If Code Folding is enabled, minus signs will appear in the Annotation Bar next to code blocks which can be folded. In addition, certain elements will be folded by default according to the Folding Preferences settings.
Folding a Block of Code
|
|
|
To fold a block of code:
|
The first line of code will remain visible but the other lines will not be displayed. A fold indicator will appear at the end of the line when the code is folded to indicate that there is hidden code. To temporarily view folded code, hover over the plus sign that denotes a folded block. The folded code will be displayed in a floating block.
|
Unfolding a Block of Code
|
|
|
To unfold a block of code:
To view the scope of a fold:
|
|
|
|
An unfolded function |
A folded function |
Folding/Unfolding Nested Functions
|
To fold/unfold nested functions:
|
|
|
|
|
To fold/unfold all code within a file:
|
|
Note:
Line numbers are folded together with the code. Folding and unfolding does not change line numbers, it can only hide/display them.
Note:
If the folded code contains an error, the displayed window will be syntax highlighted on both the left and right Annotation bars.