DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
79 stars 10 forks source link

Feedback/Errors 1.45.15380 (May 03, 2024) (Pre-Release) #547

Closed trollfalgar closed 5 months ago

trollfalgar commented 5 months ago

Nice release, but I have some problems.

BLADE FORMATTER

When formatting a .blade.php file, I see the following erros:

On Windows:

image

On Windows (with WSL) and Linux

image

In this case, the syntax error is about Livewire actions call:

image image image

Another problem (actually the same problem), PHP dosn't recognize a specific token { or : image

Beacause of the false errors, the files can not be formatted.

THE MAIN PROBLEM

Because PHP needs the language of the file be PHP, other extensions doens't works. They need .blade.php files be identify as BLADE. And if we do that, PHP stops to working properly.

The extensions I refer to is: GoTo Blade Components, or Livewire Language Support, GoTo Livewire Component, Livewire Switcher, or Laravel Component Switcher, and others.

Working with Laravel/Blade is very nice these extensions to speed up the work flow.

SUGGESTIONS

jakubmisek commented 5 months ago

Thank you for checking the pre-release so quickly!

May I ask for the (minimal) blade file with those errors? The syntax error is caused by "something" occurring before the actual error.

trollfalgar commented 5 months ago

@jakubmisek, I'm sending two simple files as exemple. One is just a icon component with a svg code. The other is a Livewire component with a simple table.

ExemplesErrosPHP.zip

jakubmisek commented 5 months ago

Thanks! I think I reproduced the error as well:

        <a
            wire:click="deleteClick({{ $list->id }})"
            href="{{ route('login') }}">
        </a>

"Syntax error: unexpected token '{'

jakubmisek commented 5 months ago

We'll try to prepare new pre-release asap.

trollfalgar commented 5 months ago

We'll try to prepare new pre-release asap.

Thank you!

jakubmisek commented 5 months ago

Syntax error fixed in the latest pre-release 1.45.15382, thanks!

If you'll get the warning Couldn't format the code due to unexpected change on line ..., please let me know. That's something else.

jakubmisek commented 5 months ago

Note - I have noticed, we don't fold/indent @forelse/@empty/@endforelse - working on it.