How to collapse / expand all comment blocks in a file in PhpStorm?

In PhpStorm, what is a quick way to collapse or expand all comment blocks (docs) in a file?

The docs here say:

Folding and expanding code blocks works for entire classes, inner and
anonymous classes, method bodies, import lists, comments, HTML and XML tags,
closures and language injections.

And further down says:

If you hold the Alt modifier and click a toggle button in the gutter, the code block
will be collapsed or expanded recursively, ie all sub-blocks within the parent 
block will also be collapsed or expanded.

But I do not see how this one works Alt modifer? I hold Alt, then press the toggle button, and only this block crashes once. I tried this in the doc block of the upper class, as well as in the doc blocks of the properties / methods. Did I miss something?

+4
source share
1 answer

In PhpStorm, what is a quick way to collapse or expand all comment blocks (docs) in a file?

Code | Folding | Collapse / Expand doc comments

enter image description here

By default, it does not have a shortcut, but you can easily add it to Settings (Preferences on Mac) | Appearance and behavior | Keymap is any shortcut you want.


, Alt modifer? Alt, , . doc , doc /. - ?

.

?

, .

, , , . Alt -.

?

:

<?php
class SomeClass
{
    public static function makeImageName($id, $sequence = 0, $sizeId = '')
    {
        $group = floor($id / 100);

        if ((int)$sequence > 0) {
            $suffix = '-' . $sequence . $sizeId;
        }
        else {
            $suffix = $sizeId;
        }

        return "/catalog/product/{$group}/{$id}/{$id}{$suffix}.jpg";
    }
}

Alt + Click node:

enter image description here

"" Click:

enter image description here

, if else .

+12

All Articles