In Visual Studio you can use #region
and #endregion
to wrap developer defined blocks of code.
I would love to see this functionality in PhpStorm, it is an ideal way to organise a large source file (for example lots of interface implementations).
Is it possible to make PhpStorm behave this way?
Sorry, currently it is not possible.
Please vote and watch this ticket: https://youtrack.jetbrains.com/issue/WI-261
UPDATE
It's now implemented (since PhpStorm v4) -- check PhpStorm's blog for details: 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>
Default collapse state is also properly supported now (as of PhpStorm v8, IIRC), although you have to add such part yourself manually. e.g.
//<editor-fold defaultstate="collapsed" desc="Region">
P.S. #region
syntax (Old MSDN link / current 2022 docs link) is also supported.
I was looking for this too, and find that it's available for use now in version 4 EAP.
Working example:
// region Private members
private $db;
private $cache;
// endregion
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With