有没有办法在 Eclipse 中手动折叠代码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/206158/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:28:25  来源:igfitidea点击:

Is there any way to manually fold code in Eclipse?

eclipseformattingfolding

提问by WolfmanDragon

Is there any way to manually create fold points in code in Eclipse? I know how to enable folding and how to set the auto preferences, but i like being able to set my own fold points so I can ignore certain parts of my code. Think regions in VS.
I know there is in VS and NetBeans, but I cannot find a way to set manual fold points in Eclipse.

有没有办法在 Eclipse 中手动创建代码中的折叠点?我知道如何启用折叠以及如何设置自动首选项,但我喜欢能够设置自己的折叠点,这样我就可以忽略代码的某些部分。考虑 VS 中的区域。
我知道 VS 和 NetBeans 中有,但我找不到在 Eclipse 中设置手动折叠点的方法。

采纳答案by Instantsoup

I don't think Eclipse has built in manual folding, but I did use a previous version of the following plugin for it.

我认为 Eclipse 没有内置手动折叠功能,但我确实使用了以下插件的先前版本。

Per the comment: The plugin has been recompiled for Eclipse 3.5 and is available at the Apache Isis site. A direct download linkis also available. It also appears to work for Eclipse 3.6.

根据评论:该插件已针对 Eclipse 3.5 重新编译,可在Apache Isis 站点上获得。一个直接的下载链接也可以。它似乎也适用于 Eclipse 3.6。

回答by oneofmany

The coffee bytes folding plug-in for eclipse is still alive. But the pages have moved.

eclipse的coffee bytes折叠插件还活着。但是页面已经移动了。

An Overview and how to get it can be found here.

可以在此处找到概述以及如何获取它。

I've installed it in eclipse using the update page.

我已经使用更新页面在 eclipse 中安装了它。

In Eclipse go to Help -> Install new Software
Enter: eclipse.realjenius.com/update-site
Select the plugin and follow on-screen instruction.

在 Eclipse 中,转到 Help -> Install new Software
输入:eclipse.realjenius.com/update-site
选择插件并按照屏幕上的说明进行操作。

I'm still pretty new to eclipse development and had to install mylyn before installing the code folding plugin.

我对 Eclipse 开发还是很陌生,在安装代码折叠插件之前必须安装 mylyn。

回答by oneofmany

I'm new to Eclipse, but since the IDE lets you fold preprocessor directives, you can just do "#if 1 .... #endif" to effectively set up manual folding.

我是 Eclipse 的新手,但由于 IDE 允许您折叠预处理器指令,因此您只需执行“#if 1 .... #endif”即可有效地设置手动折叠。

回答by pdeva

No, eclipse does not have any option to provide manual folding plugins.

不,eclipse 没有提供手动折叠插件的任何选项。