在Visual Studio中,您可以使用#region
和#endregion
来包装开发人员定义的代码块。
我很乐意在PhpStorm中看到这项功能,它是组织大型源文件(例如大量接口实现)的理想方式。
有没有可能让PhpStorm这样做呢?
发布于 2011-08-17 00:32:12
对不起,目前不能这样做。
请投票并观看这张彩票:https://youtrack.jetbrains.com/issue/WI-261
更新
它现在已经实现了(自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。
发布于 2012-03-07 09:29:55
我也在寻找它,并发现它现在可以在版本4EAP中使用。
工作示例:
// region Private members
private $db;
private $cache;
// endregion
https://stackoverflow.com/questions/7076754
复制相似问题