intelephense-docs icon indicating copy to clipboard operation
intelephense-docs copied to clipboard

Expand single line (if, while, foreach, etc..) blocks

Open kaan-atakan opened this issue 4 years ago • 0 comments

Hello, I am a big fan of your vscode extension and a premium user but I tend to prefer phpfmt to the formatter included in the extension for two reasons. This is an issue about the second one:

Phpfmt will expand the following code:

if($bool) doSomething(); else doSomethingElse();
while(isTrue()) doSomething();
foreach($array as $key => $val) doSomethingWith($key, $val);

to

if ($bool) {
    doSomething();
} else {
    doSomethingElse();
}

while (isTrue()) {
    doSomething();
}

foreach ($array as $key => $val) {
    doSomethingWith($key, $val);
}

It would be great if you had this functionality as well.

kaan-atakan avatar Jul 06 '20 10:07 kaan-atakan