kokororin / vscode-phpfmt

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

PHP8.1 Formatting Issue #151

Open m2cc opened 1 month ago

m2cc commented 1 month ago

Subject: Issue with PHP Formatting in PHP8.1, the plugin version is 1.2.12 我目前的配置如下:

"phpfmt.passes": [
        "SplitElseIf",
        "AlignEquals",
        "AlignGroupDoubleArrow",
        "AlignPHPCode",
        "AlignDoubleArrow",
        "AlignComments"
    ],

before:

$arr = [
  'a' => 1, //xxxx
  'aa' => 1,   // xxxx
  'aaaa' => 1,// xxxxxx
  'aaaaaa' => 1, // x
];

after format, it becomes like this:

$arr = [
    'a' => 1, //xxxx
    'aa' => 1, // xxxx
    'aaaa' => 1, // xxxxxx
    'aaaaaa' => 1, // x
];

exexpected: align comments and alian keys

$arr = [
    'a'      => 1, //xxxx
    'aa'     => 1, // xxxx
    'aaaa'   => 1, // xxxxxx
    'aaaaaa' => 1, // x
];
driade commented 1 month ago

Hi @m2cc , I'm on this. Related to https://github.com/driade/phpfmt8/issues/62

m2cc commented 1 month ago

Hi @m2cc , I'm on this. Related to driade/phpfmt8#62

thank you.