How to collapse blocks of code in Eclipse?

2019-01-21 10:17发布

Some days ago my Eclipse was working fine and a +/- appeared in every block that could be collapsed (functions, classes, etc.)... but now it does appear, and I don't know how to activate that feature again.

It's Eclipse Helios, running on a Gentoo Linux box.

11条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-01-21 10:30

If you want folding an all your editors, I found you can enable Folding in

Preferences > Editors > Structured Text Editors

Enable Folding

查看更多
霸刀☆藐视天下
3楼-- · 2019-01-21 10:31

Preferences -> C++ -> Editor -> Folding ?

Make a right click in the editor window and go to preferences there, then only the editor-relevant section of the preferences dialog will appear. This works for JDT, CDT etc...

查看更多
小情绪 Triste *
4楼-- · 2019-01-21 10:31

You can do Ctrl + Numpad_Divide to enable folding. Also if you right-click on the area where the +/- was supposed to be, you can see there is a folding option.

查看更多
做个烂人
5楼-- · 2019-01-21 10:31

In CFEclipse: Preferences > CFEclipse > Editor > Code Folding > Initially Collapse column, you can uncheck to see all expanded when opening, or check all boxes to close all when opening a file.

查看更多
乱世女痞
6楼-- · 2019-01-21 10:31

I was using salesforce apex classes with Eclipse Neon 3.3 for Java.
I found an option "define folding region" on right click in the editor, I selected the block of code i wanted to collapse and selected this property for that code. Now I am seeing + and - symbol to expand and collapse that block of code

查看更多
Deceive 欺骗
7楼-- · 2019-01-21 10:35

I assume you are using Java, but look under the settings for your particular language.

Under the Window menu, select Preferences.

Under Java->Editor->Folding. Select "Enable Folding".

查看更多
登录 后发表回答