By Robert Blackburn
This week in CFEclipse Features we will be looking at code folding. I have seen quite a few developers get frustrated with this feature, though it's quite simple.
As you type code, you will notice a little grey
icon in
the gutter to the left of the editor pane (where you
might see line numbers). (See Figure 1.) That icon will show up any time you write a code block of a specific size. It can be clicked, and the corresponding block of code will collapse
down to a single line, as shown in Figure 2. If you want to expand that block again, just click the icon a second time and the code block is returned. If you would like to see what code is inside a collapsed block, you can hover over the icon and an insight window will pop up with the contents of the block, as shown in Figure 3.
The great part is you can configure how large a block of code most be before it is foldable. You can even set certain types of blocks to be folded by default. To configure this, click Window
> Preferences
> CFEclipse
> Code Folding
.
It can be frustrating when you're working with large files, especially CFCs and UDF Libraries, where multiple blocks of code can look very similar. With the code folding feature you can hide the code not important to your current work.
In the next CFEclipse Features article we will cover in-line code help, which can provide details about a ColdFusion tag or function right inside the editor pane.
If you liked this article, you might like the rest of Robert Blackburn's CFEclipse Series: