Cold Folding collapses or "folds" the display of a block of code. Instead, the editor displays only the first line instead of the entire block. This reduces visual clutter by enabling users to selectively hide and display complicated text while still viewing those subsections of the text that are specifically relevant.
Cold Folding is enabled for classes, functions and PHPDocBlocks.
Opened, unfolded code has a minus sign [-] on the Editor's left annotation bar.
The default Code Folding preferences are set from: Windows > Preferences > PHP > Editor > Folding (see Setting Preferences).
Place the cursor on the left Annotations Bar and
right click. Select:
Folding < Enable Folding from the drop down menu.
To fold a block, click the minus sign. The first line of code will remain visible, the other lines will not be displayed; a fold indicator will appear at the end of the line when the code is folded.
|
Unfolded |
Folded |
To unfold a block, click the plus sign. The folded code will become visible again; the fold indicator will disappear.
To fold nested functions, click on one of the minus signs. All levels below this level will be folded into it. You can continue to fold until all levels have been folded into the topmost level.
|
|
|
To unfold nested functions, click on the plus sign. The folded code will open in the same order that it was folded.
Classes and Functions are marked from the end of the first line to the end of the last line that defines the class / function (the line with the closing curly bracket) at that level.
PHPDoc folds are marked from the end of the first line to the end of the last line that defines the doc (e.g., the */ ).