Issue
I dislike Eclipse's code folding feature, because the folding state isn't saved when you close the file, like Visual Studio does with its #region
directives.
Does anyone know of a plugin which saves the status of the code folding per file, so that when I open it, the code stays folded?
Solution
Try to use: http://code.google.com/p/coffee-bytes/
You have to download the source code, import project into Eclipse and build it. After that Export code as a deployable plug-in for Eclipse. You will have a package for installation.
- Install it into Eclipse.
- Go To Eclipse Preferences...
- Type in search "Folding"
- Select Java->Editor->Folding
- Select in ComboBox "Coffee Bytes Java Folding"
- On General Tab set checkbox - "User Defined Regions"
- In User Defined Regions tab - enter #region as a start tag and #endregion as an end tag
In code folding will be available after setting special comments into it:
// #region
... some code ...
// #endregion
Answered By - Oleksandr Kucherenko
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)