vscode-blade-formatter icon indicating copy to clipboard operation
vscode-blade-formatter copied to clipboard

[Formatting Bug]:

Open fe2-Nyxar opened this issue 1 year ago • 1 comments

Platform

Windows

Template before formatting

<table>
    <tr>
        <td>Number</td>
        <td>Nom</td>
        <td>prenom</td>
        <td>Company</td>
        <td>Ville</td>
        <td>Salaire</td>
        <td>Action</td>
    </tr>
    @foreach($data as $d)
    <tr>
        <td>{{$d->id}}</td>
        <td>{{$d->Name}}</td>
        <td>{{$d->Lastname}}</td>
        <td>{{$d->Company}}</td>
        <td>{{$d->Ville}}</td>
        <td>{{$d->Salaire}}</td>
        <td><button></button>
            <button></button>
            <button></button></td>
    </tr>
    @endforeach

</table>

Template after formatting

<table>
    <tr>
        <td>Number</td>
        <td>Nom</td>
        <td>prenom</td>
        <td>Company</td>
        <td>Ville</td>
        <td>Salaire</td>
        <td>Action</td>
    </tr>
<?php
    @foreach($data->$d)
    <tr>
        <td>{{$d->id}}</td>
        <td>{{$d->Name}}</td>
        <td>{{$d->Lastname}}</td>
        <td>{{$d->Company}}</td>
        <td>{{$d->Ville}}</td>
        <td>{{$d->Salaire}}</td>
        <td><button></button>
            <button></button>
            <button></button></td>
    </tr>
    @endforeach

?>

</table>

Expected Behaviour

the "php" bracket wasn't expected and the change from as to -> for some reason :/

Relevant log output

No response

fe2-Nyxar avatar Feb 09 '24 10:02 fe2-Nyxar

Could not reproduced. I think other part of template or some option causes this.

 $  ./bin/blade-formatter.js test.blade.php
<table>
    <tr>
        <td>Number</td>
        <td>Nom</td>
        <td>prenom</td>
        <td>Company</td>
        <td>Ville</td>
        <td>Salaire</td>
        <td>Action</td>
    </tr>
    @foreach ($data as $d)
        <tr>
            <td>{{ $d->id }}</td>
            <td>{{ $d->Name }}</td>
            <td>{{ $d->Lastname }}</td>
            <td>{{ $d->Company }}</td>
            <td>{{ $d->Ville }}</td>
            <td>{{ $d->Salaire }}</td>
            <td><button></button>
                <button></button>
                <button></button>
            </td>
        </tr>
    @endforeach

</table>

Can you provide entire template? (please replace sensitive data)

shufo avatar Feb 09 '24 19:02 shufo

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

github-actions[bot] avatar Apr 10 '24 01:04 github-actions[bot]

this issue was caused by another extention it has nothing to do with this one.

fe2-Nyxar avatar Apr 14 '24 22:04 fe2-Nyxar