shufo / prettier-plugin-blade

Format your blade template using Prettier
https://www.npmjs.com/package/@shufo/prettier-plugin-blade
MIT License
330 stars 8 forks source link

[Formatting Bug]: Indentation gets removed in @php blocks in blade files since v1.13 #266

Closed plorenz-etes closed 7 months ago

plorenz-etes commented 9 months ago

Version

1.13.5

Template before formatting

<html>
  <head></head>
  <body>
    @php
      $categories = App\Models\Category::whereIn('id', $catids)
        ->orderBy('description')
        ->get();
    @endphp
  </body>
</html>

Template after formatting

<html>
  <head></head>
  <body>
    @php
      $categories = App\Models\Category::whereIn('id', $catids)->orderBy('description')->get();
    @endphp
  </body>
</html>

Expected Behaviour

The indented function calls (query builder) should remain as-is. This was working correctly with 1.12.

Relevant log output

No response

claytonrcarter commented 9 months ago

I see the same thing, but I think that this is an issue w/ blade-formatter, not this plugin specifically. 1.12 was using blade-formatter 1.38, while 1.13 is using 1.40. Sure enough, the standalone blade-formatter puts this all on one line when using 1.40, but not when using 1.38.

Orrison commented 9 months ago

Seeing this same issue

github-actions[bot] commented 7 months ago

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