Open trollfalgar opened 4 months ago
@trollfalgar thank you for reporting the problems! I would break them down as follows.
@class()
followed with a non-whitespace HTML character, e.g. >
(parsing affects for diagnostics, IntelliSense, and formatting)@class( <multiline> )
@use
directiveauth()->user() /*Authenticatable*/
to User
: The warning is probably correct because Authenticatable
is not assignable to User
(the opposite works), but it is a common practice.Perfect!
In the case of Laravel: assign auth()->user() /Authenticatable/ to User``:
Laravel has a configuration file to specify this. config > auth.php
Maybe you can take advantage of this. Can be very flexible if the developer change the default.
The assignment from an interface to the actual class is common practice in PHP. It's not just the Authenticatable
:/
If you'd like to try some updates;
pre-release 1.46.15414
implements
@use
directive - fixes false diagnostics and provides code completion for class names@class
directive should be recognized correctlyPreview (completion works best without the quotes):
Hello, about @use
:
When starting to type the namespace, code completion works ok. But only give us parts. We have to type each folder untill we get to the file. Would be possible to give us all the possible namespaces when we start typing?
I personally prefer without quotes, but most people will follow the documentation, and will use quotes. But for a preview, this is nice already.
Obs.: GoTo on click is awesome.
@class()
are way better now, but, still strugle after formatting.
BEFORE AFTER
Thanks for the fast check!
@class
and any blade directive inside an HTML tag is not implemented yet, @use
will be done, good point.One more thing!
The variable $attribute
inside blade components has a strange behaviour.
Between attributes:
As the last attribute:
The variable $attribute inside blade components has a strange behaviour.
Weird it's happening only inside <svg>
tag
If you'd like to try some updates; pre-release
1.46.15414
implements
- more syntax highlighting for blade tags inside HTML tags
@use
directive - fixes false diagnostics and provides code completion for class names@class
directive should be recognized correctly
Please add directive @filamentStyles()
and @filamentScripts()
in Filament v3:
https://filamentphp.com/docs/3.x/notifications/upgrade-guide#new-filamentscripts-and-filamentstyles-blade-directives
@lyrihkaesa thank you for the feedback!
We'll add those directives.
The bug itself (that syntax error) is caused by empty parentheses ()
- will be fixed.
@lyrihkaesa thank you for the feedback!
We'll add those directives.
The bug itself (that syntax error) is caused by empty parentheses
()
- will be fixed.
Oh, it's caused by the empty parentheses ()
😢. Thank you very much. 👍
After I tried removing the empty parentheses, it still works fine. I thought there had to be parentheses in the blade directive, but it turns out they are not always necessary, even though the default tab suggestion includes them.
@lyrihkaesa The bug with empty parentheses is fixed in the latest pre-release 1.46.15498
. Thanks!
I will address some syntax highlighting problems
@class()
directive:The class colors are mess up.
In some cases,
@class()
is recognized to expect an array, but, after formatting, the code change and is a mess.Expressions inside parameters
Expressions inside blade component or livewire component parameters should be highlighted in diferente color, now is the same as string. And variables should have intelisense enabled. Exactly like blade directives.
But this still lack knowledge of the variables sent to the blade from the controller or the Blade/Livewire component.
Livewire Directives
Wthout mention autocomplete for Livewire methods, variables (with types for autocomplete/intelisense), etc (same variables coming from a controller, this would be huge), at least content inside livewire directives should have their own highlighting.
With AlpineJS part of Livewire these days, I beleave some highlighting would be nice
@use()
directiveThis directive is relatively new. The extension is not recognizing this. And because of that, we see a warning using the class.
User type
When assigning
auth()->user()
orAuth::user()
to a variable with typeUser
we get an warning.