haidubogdan / netbeans-php-blade-plugin

Netbeans 18+ module plugin for php blade template files
Apache License 2.0
26 stars 4 forks source link

@if formatting is not working #33

Closed Eugene-Melbourne closed 2 months ago

Eugene-Melbourne commented 6 months ago

@if formatting is not working

actual formatting

        @if ($params->allow_google_in_country)
        <div class="form-group row">
            aaa
        </div>
        @endIf

expected formatting

        @if ($params->allow_google_in_country)
            <div class="form-group row">
                aaa
            </div>
        @endIf
haidubogdan commented 6 months ago

The formatting and indentation for blade code is a feature which is in work in progress. It is not working yet.

haidubogdan commented 6 months ago

Hi,

With the release of https://github.com/haidubogdan/netbeans-php-blade-plugin/releases/tag/nb180-v2.1.21

I've added the formatting action. But you will have to enable it manually for the moment.

image

haidubogdan commented 6 months ago

v 2.1.21 still has some fornatting issues, do I recommend waiting for a later release .

haidubogdan commented 6 months ago

I've fixed the relevant issues so https://github.com/haidubogdan/netbeans-php-blade-plugin/releases/tag/nb180-v.2.1.3 Can be tested for the formatting flows.

wimurk commented 5 months ago

I just downloaded the latest release and tested with a simple blade

<x-base::layouts.app>
    <div class="max-w-9xl mx-auto px-4 sm:px-6 md:px-8">
        @include('base::components.breadcrumbs')

        <div class="mt-2 md:flex md:items-center md:justify-between">
            <div class="flex-1 min-w-0">
                <h2 class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate">
                    {{ __('invoices::collection-invoices.index.Collection invoices') }}
                </h2>
            </div>
        </div>
    </div>

    <div class="max-w-9xl mx-auto px-4 sm:px-6 md:px-8 py-5">
        <div class="p-6 bg-white border-b border-gray-200 shadow-sm rounded-md">
            <livewire:invoices::collection-invoice-table />
        </div>
    </div>
</x-base::layouts.app>

After formatting CTRL + SHIFT + F

<x-base::layouts.app>
    <div class="max-w-9xl mx-auto px-4 sm:px-6 md:px-8">
        @include('base::components.breadcrumbs')

        <div class="mt-2 md:flex md:items-center md:justify-between">
            <div class="flex-1 min-w-0">
                <h2 class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate">
                    {{ __('invoices::collection-invoices.index.Collection invoices') }}
                </h2>
            </div>
        </div>
    </div>

    <div class="max-w-9xl mx-auto px-4 sm:px-6 md:px-8 py-5">
        <div class="p-6 bg-white border-b border-gray-200 shadow-sm rounded-md">
                                                        <livewire:invoices::collection-invoice-table />
        </div>
    </div>
                                                </x-base::layouts.app>

Test number 2

Openend somewhat bigger blade Without formatting the blade looks like this image

When removing the @foreach image

haidubogdan commented 5 months ago

So many new stuff : )

I will prepare a fix for the formatting issue.

And it seems I have I to take care about components include in the future

@include('base::components.breadcrumbs')
wimurk commented 5 months ago

So many new stuff : )

I will prepare a fix for the formatting issue.

And it seems I have I to take care about components include in the future

@include('base::components.breadcrumbs')

You know you keep the relation between netbeans and laravel alive! otherwise i would have switchen months ago. Great work.

haidubogdan commented 5 months ago

I will put it on in progress as it's a bit "wonky".

Some existing issues:

haidubogdan commented 2 months ago

Closing this issue, some progress have been done, and new separate issues have been opened for other formatting errors.