kokororin / vscode-phpfmt

Integrates phpfmt into VS Code
https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt
BSD 3-Clause "New" or "Revised" License
130 stars 30 forks source link

RemoveSemicolonAfterCurly removes a semicolon which it shouldn't #95

Closed sogerc1 closed 1 year ago

sogerc1 commented 2 years ago

My code is:

$menu    = [];
$recurse = function ($parent, $path) use (&$recurse, &$menu, $res) {
    foreach ($res as $v) {
        if ($v['parent'] == $parent) {
            $name           = "$path/{$v['name']}";
            $menu[$v['id']] = $name;
            $recurse($v['id'], $name);
        }
    }
}; // this semicolon should not be removed
$recurse(0, '');

After formatting the code my semicolon marked with the comment is removed. However if I change the $name assignment to:

$name = $path.'/'.$v['name'];

then the semicolon is preserved.