Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to fold eclipse sub-blocks like an "if" statement?

Tags:

eclipse

ide

Currently Eclipse only fold the java doc and at function level, but when reading long methods, there could be quite a lot of if/else etc, is there a way to fold them?

like image 309
Shawn Avatar asked Mar 03 '10 05:03

Shawn


2 Answers

I found the Coffee-Bytes plugin. I downloaded it from this link and found this guide by the author, for using it.

You can find more details in these references:

What code folding plugins work on Eclipse 3.6?
How to use Coffee-Bytes code folding

like image 194
hasanghaforian Avatar answered Sep 21 '22 15:09

hasanghaforian


in updated versions of Eclipse

Change folding preferences at:

Window -> Preferences -> C/C++ -> Editor -> Folding -> Enable folding of preprocessor branches (#if/#else) 

Enable folding using ctrl + shift + /

like image 35
lahmania Avatar answered Sep 23 '22 15:09

lahmania