shufo / vscode-blade-formatter

An opinionated Blade file formatter for VSCode

Home Page:https://marketplace.visualstudio.com/items?itemName=shufo.vscode-blade-formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Formatting Bug]: Long conditions

wfern opened this issue · comments

Platform

MacOS

Template before formatting

@if ($isBoleto)
    @if (
        $isAwaitingPayment
        && $hasPaymentProvider
        && $hasPaymentProviderLink
    )
        <a  target="_blank" class="btn btn-secondary"><i class="fas fa-fw fa-print"></i>Reimprimir boleto</a>
    @endif
@endif

Template after formatting

@if ($isBoleto)
    @if ($isAwaitingPayment && $hasPaymentProvider && $hasPaymentProviderLink)
        <a target="_blank" class="btn btn-secondary"><i class="fas fa-fw fa-print"></i>Reimprimir boleto</a>
    @endif
@endif

Expected Behaviour

Hello! First, thanks for this awesome extension!

Would be lovely if long conditions could maintain the formatting like PSR-12 specifies: https://www.php-fig.org/psr/psr-12/#51-if-elseif-else

And if you want I could move those issues to the blade-formatter repository.

Relevant log output

No response

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days