Eclipse代码折叠插件 [英] Code folding plugin for Eclipse?

查看:485
本文介绍了Eclipse代码折叠插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不喜欢Eclipse的代码折叠功能,因为关闭文件时不会保存折叠状态,就像Visual Studio使用其 #region 指令一样。每个文件的状态,这样当我打开它时,代码保持折叠状态?

解决方案

尝试使用: http://code.google.com/p/coffee-bytes/



您必须下载源代码,导入项目进入Eclipse并构建它。之后导出代码作为Eclipse的可部署插件。您将有一个安装包。


  1. 将其安装到Eclipse中。

  2. 转到Eclipse首选项...

  3. 输入搜索折叠

  4. 选择Jave->编辑 - >折叠

  5. 在ComboBox中选择
    咖啡字节Java折叠

  6. 在常规选项卡设置复选框 - 用户
    定义的区域

  7. 在用户定义的区域选项卡中,输入#region作为
    开始标记,#endregion作为结束标记

在设置特殊注释后,代码折叠将可用:

  / / #region 
...一些代码...
// #endregion


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?

解决方案

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.

  1. Install it into Eclipse.
  2. Go To Eclipse Preferences...
  3. Type in search "Folding"
  4. Select Jave->Editor->Folding
  5. Select in ComboBox "Coffee Bytes Java Folding"
  6. On General Tab set checkbox - "User Defined Regions"
  7. 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

这篇关于Eclipse代码折叠插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆