haidubogdan / netbeans-php-blade-plugin

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

`unknown directive` on custom blade directives #34

Closed angeljqv closed 8 months ago

angeljqv commented 8 months ago
haidubogdan commented 8 months ago

It's strange if the blade is added in autocompletion It should be considered a custom directive.

You can try to re-add the service provider class where you define the blade directives with Project -> Properties -> Laravel Blade -> Custom Directives


The current system is designed that on Ctrl+Click over a custom directive to go the the Service Provider Class where the custom directive was defined.

angeljqv commented 8 months ago

From spatie/laravel-permission/src/PermissionServiceProvider.php#L129-L138 image image

I already tried to add the service provider again, I also tried to clear the entire netbeans cache, I am using Netbeans 19


The current system is designed that on Ctrl+Click over a custom directive to go the the Service Provider Class where the custom directive was defined.

I didn't know it, Ctrl + Click does exactly what you say, open the service provider


Maybe it is not possible, but what about this idea

It doesn't work with relative paths Files with custom directives always are inside project root path, so, we can use relative paths instead of absolute paths(same with views path)

After that, what if instead of saving in private.properties it save it in project.properties, so it could be on the repository tree, everyone with the plugin could use custom directives autocompletion automatically

angeljqv commented 8 months ago

There is no way to disable that message image

angeljqv commented 8 months ago

I updated to a newer netbeans, the message disappeared, but there is a strange underline

image

haidubogdan commented 8 months ago

cool, this is just to have a soft identification that it is a custom directive.

angeljqv commented 8 months ago

I have these 3 custom directives image

image @card like no blade directive, @cardTitle strange underline, and @endcard is fine

If i remove @cardTitle args, no more blade directive image

If i add (), @card starts working, maybe related to #37 image


image

parallels999 commented 8 months ago

@card like no blade directive, @cardTitle strange underline, and @endcard is fine If i remove @cardTitle args, no more blade directive If i add ( ), @card starts working, maybe related to https://github.com/haidubogdan/netbeans-php-blade-plugin/issues/37

+1

haidubogdan commented 8 months ago

For the moment I've prepared a pre-release to recognize custom directives whiteout arguments

https://github.com/haidubogdan/netbeans-php-blade-plugin/releases/tag/nb180-v.2.0.7-pre .

There are some things which are still work in progress

haidubogdan commented 8 months ago

Closing the ticket. From v.2.1.21 there is the option to disable these types of warnings :

Editor -> Hints -> Language Blade :

image

josevv28 commented 8 months ago

It doesn't work with relative paths Files with custom directives always are inside project root path, so, we can use relative paths instead of absolute paths(same with views path)

After that, what if instead of saving in private.properties it save it in project.properties, so it could be on the repository tree, everyone with the plugin could use custom directives autocompletion automatically

Sounds like a great idea

angeljqv commented 8 months ago

Hi @haidubogdan, the problem is back, There should not be any type of tests to prevent already solved bugs from returning.

image image

@card
  @cardTitle([

I have these 3 custom directives image

image @card like no blade directive, @cardTitle strange underline, and @endcard is fine

If i remove @cardTitle args, no more blade directive image

If i add (), @card starts working, maybe related to #37 image

image

haidubogdan commented 8 months ago

Hi, you are right, some tests should be implemented in the future.

angeljqv commented 8 months ago

It works again, thanks