在Visual Studio中,您可以使用#region
和#endregion
来打包开发人员定义的代码块。PhpStorm可以定义可折叠的代码区域(Visual Studio样式区域)吗?
我很想看到在PhpStorm此功能,它是组织大量的源文件(例如大量的接口实现)的理想方式。
是否有可能使PhpStorm的行为如此?
在Visual Studio中,您可以使用#region
和#endregion
来打包开发人员定义的代码块。PhpStorm可以定义可折叠的代码区域(Visual Studio样式区域)吗?
我很想看到在PhpStorm此功能,它是组织大量的源文件(例如大量的接口实现)的理想方式。
是否有可能使PhpStorm的行为如此?
对不起,目前这是不可能的。
请投票,看这张票:https://youtrack.jetbrains.com/issue/WI-261
UPDATE
它现在实施(因为PhpStorm V4) - 检查PhpStorm的博客的详细信息:http://blog.jetbrains.com/webide/2012/03/new-in-4-0-custom-code-folding-regions/
//<editor-fold desc="Region">
// Your code goes here
//</editor-fold>
默认的崩溃状态现在也得到了正确支持(截至PhpStorm v8,IIRC),尽管您必须手动添加这样的部分。例如
//<editor-fold defaultstate="collapsed" desc="Region">
#region
syntax也支持。
我一直在寻找这也和发现它的可使用现在版本4 EAP。
工作例如:
// region Private members
private $db;
private $cache;
// endregion
这是一个很好的使用标签的方法!更像VS,在我看来,他们做得很好。 – Adam
它现在,顺便说一句。至少在EAP构建中。只需将代码包围在'#region'和'#endregion'中即可。 – mpen
@Nate请参阅使用正确的链接更新的答案:http://blog.jetbrains.com/webide/2012/03/new-in-4-0-custom-code-folding-regions/ – LazyOne
@LazyOne阿拜 - 也将喜欢注意'#范围'和'区域'也可用于折叠 –