vscode-better-align icon indicating copy to clipboard operation
vscode-better-align copied to clipboard

php Code formatting error

Open geekchenzx opened this issue 2 years ago • 3 comments
trafficstars

Hey, when I try to format the code like this, the "=>" will fail to format

public static function getRefundStatusDesc($value = true) { $data = [ self::LAUNCH => '发起退款', self::WAIT => '未退款', self::FAIL => '退款失败', self::AGREE => '同意退款', self::REFUSE => '拒绝退款', ]; if ($value === true) { return $data; } return $data[$value]; } }

result:

public static function getRefundStatusDesc($value = true)
{
    $data = [
        self:: LAUNCH  => '发起退款',
        self:: WAIT   => '未退款',
        self:: FAIL => '退款失败',
        self:: AGREE => '同意退款',
        self:: REFUSE => '拒绝退款',
    ];
    if ($value === true) {
        return $data;
    }
    return $data[$value];
}

"::" with a space to the right, "=>" formatting has not taken effect

geekchenzx avatar Jan 11 '23 05:01 geekchenzx

Could you please try install this one? And check if this fix your problem. https://github.com/chouzz/vscode-better-align/suites/10306798377/artifacts/506818699

You can install this extension by run Extensions: Install from VSIX command in the Command Palette

chouzz avatar Jan 11 '23 12:01 chouzz

Could you please try install this one? And check if this fix your problem. https://github.com/chouzz/vscode-better-align/suites/10306798377/artifacts/506818699

You can install this extension by run Extensions: Install from VSIX command in the Command Palette

okay,The problem of installing this extension has been solved

geekchenzx avatar Jan 12 '23 05:01 geekchenzx

OK. This will be fixed in next version.

chouzz avatar Jan 12 '23 11:01 chouzz