您可以像在Visual Studio中一样在Netbeans中设置某种自定义代码折叠吗

您可以像在Visual Studio中一样在Netbeans中设置某种自定义代码折叠吗

问题描述:

在使用C#时,我经常这样做:

When working on C#, I often do this:

#region Properties
  public int Property1{get;set;}
  ...(more properties)
#endregion

这使Visual Studio添加了将代码折叠在区域内的选项. 当然,您可以将区域用于任何事物,而不仅限于属性"或任何事物.

This makes Visual Studio add the option to fold the code inside the region. Offcourse, you can use regions for anything, it's not limited to Properties or anything at all.

我想知道两件事:

  1. 这仅仅是使Visual Studio将代码折叠添加到编辑器的某个区域还是影响编译器吗?
  2. 我可以在Netbeans中做类似的事情吗?

  1. (至少在Netbeans中)纯粹是程序员的帮助,对编译没有影响
  2. 是的

一个关于折叠参考的警告:

One caveat to the folding reference:

请注意,以上示例适用于Java语言.在其他语言中,可能不支持自定义折页,或者您可能必须使用不同的字符来标记行注释.

Please note that the above examples are for java language. In other languages custom folds may not be supported or you may have to use different characters for marking line comments.