code folding for switch "case" statements |
|
+1
One added suggestion: When folded still show the 'break;' so that you can still tell at a glance how the switch statement will be executed. For example: switch($test){ case 'one': $a = 1; case 'two': $b = 2; break; case 'three': $a=3; $b=3; break; default: $a=0; $b=0; } Would become something like the following if the first two cases and the default were collapsed: switch($test){ case 'one': ... case 'two': ... break; case 'three': $a=3; $b=3; break; default: ... } |
||||||||||||
|
Here's a possible solution |
|
From documentation on php.net:
http://www.php.net/manual/en/control-structures.intro.php
In other words, the following code is valid PHP code:
The curly braces define a statement group similar to when used with if, else, foreach, etc. It does not create a new variable scope, but can be used to format/organize code in some arbitrary way. Statement groups can contain almost anything (assuming nest conventions are followed). Some things that can't be used inside statement blocks are: namespace, use, (global) const, and __halt_compiler(). Anything in curly braces will have a fold mark in PhpED. That includes statement groups which then function just as one would hope/expect. One feature that would be nice is if PhpED showed the comment immediately after the starting brace while the group is folded. One can even make a shortcut to create a foldable statement group using code snippets in PhpED. For example, the following template could be created and assigned to the keyboard combination Ctrl+Alt+B
Thereafter one could highlight a block of code then hit Ctrl+Alt+B to wrap the highlighted statements in curly braces, creating a statement group. |
||||||||||||||||||
|
code folding for switch "case" statements |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by