我可以配置 IntelliJ Idea 来识别自定义代码折叠区域指定吗?
我非常喜欢 c# #region...#endregion
工具(有些人说这是一个坏习惯,但我们不讨论这个)。当我编写其他语言时,我非常想念它。将其“添加”到其他语言的明显方法是使用编辑器可以理解的特殊格式的注释。我已经成功设置 Kate
来支持 Java/Scala 代码的 //#region...//#endregion
,类似的功能并不是实现的问题NetBeans
(这里是如何实现的)。我可以使用 IntelliJ Idea 11 执行此操作吗?
I like c# #region...#endregion
facility a lot (some people say that's a bad habit but let's not discuss that). I miss it a lot when coding other languages. The obvious way to "add" it to other languages is to use special-formed comments the editor would understand. I've managed to set up Kate
to support //#region...//#endregion
for Java/Scala code, alike feature is not a problem to achieve with NetBeans
(here is how). Can I do this with IntelliJ Idea 11?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此功能计划在 IDEA 11.1 中实现,将于 2012 年第一季度末发布:
This feature is planned for IDEA 11.1 that will be released in late Q1, 2012:
同时此功能在 IntelliJ IDEA 中实现并描述如下:
http://www.jetbrains.com/idea /webhelp/folding-custom-regions-with-line-comments.html
您可以使用两种样式定义代码区域:
VisualStudio 样式
NetBeans 样式
但它是建议不要混淆一个文件中的两种样式。 IntelliJ IDEA 将识别遇到的第一个折叠注释,并将其假定为为代码选择的样式。
Meanwhile this feature is implemented in IntelliJ IDEA and described here:
http://www.jetbrains.com/idea/webhelp/folding-custom-regions-with-line-comments.html
You can define code regions using two styles:
VisualStudio style
NetBeans style
But it is recommended to not mix up the two styles in one file. IntelliJ IDEA will recognize the first folding comment encountered, and will assume this as a style chosen for the code.