vscode-phpfmt icon indicating copy to clipboard operation
vscode-phpfmt copied to clipboard

Formatter removes whitespace after colon when named argument is called "empty"

Open metanomial opened this issue 6 months ago • 1 comments

e.g.,

Before formatting:

function foo() {
    bar(
        baz: 42,
        qux: 'hello',
        corge: [1, 2, 3],
        empty: false,
    );
    bar(baz: 42, qux: 'hello', corge: [1, 2, 3], empty: true);
}

function bar(
    int $baz,
    string $qux,
    mixed $corge,
    bool $empty,
) {
    noop();
}

After formatting:

function foo() {
    bar(
        baz: 42,
        qux: 'hello',
        corge: [1, 2, 3],
        empty:false,
    );
    bar(baz: 42, qux: 'hello', corge: [1, 2, 3], empty:true);
}

function bar(
    int $baz,
    string $qux,
    mixed $corge,
    bool $empty,
) {
    noop();
}

This one is baffling to me. Disabling all default passes has no effect.

metanomial avatar Jun 15 '25 19:06 metanomial

Hi @metanomial, this should be fixed in the latest release

driade avatar Jun 23 '25 18:06 driade