haidubogdan / netbeans-php-blade-plugin

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

Code highlighting | Namespace import #28

Closed wimurk closed 8 months ago

wimurk commented 1 year ago

First of all, this plugins is amazing!

Thanks for all the work guys. This plugin really helps with developing in laravel. I tested it in Netbeans 17 and it works great.

besides that is works great here are a few options that can be fixed in the next verisons.

Namespace use statements

When importing classes using the use the editor does not bind the classes you import. (No typehinting etc) Also the editor does not register the imported class as being used.

image

shorthand if statement

When using the ? : the highlighting does't work anymore.

image
haidubogdan commented 1 year ago

Hi wimurk, thanks for the observation. I agree, these are things which need to improve. External language embedding can be a challenge when implementing custom plugins, but I think it can be doable in the future. For the second issue ... there is a problem with Netbeans Ide freezing in some context when typing "::", so I added some harsh embedding limitations . I think this shorthand if statement is fixable, also;

parallels999 commented 1 year ago

When importing classes using the use the editor does not bind the classes you import.

Yes, but normally you shouldn't do that (good practice), you should use view composer, or use User::first() in the controller and send it to the view

Also you could simple do:

<?php
use App\Models\User;
?>
wimurk commented 1 year ago

When importing classes using the use the editor does not bind the classes you import.

Yes, but normally you shouldn't do that (good practice), you should use view composer, or use User::first() in the controller and send it to the view

Also you could simple do:

<?php
use App\Models\User;
?>

Yes, this was an example. Most of the times i have services that i use in my blade to process some data information. Have you guys already looked into the code formtting? Myself i use the psr12 provided by pint (default laravel). This sometimes gives weird markup in combination with <x- components. Might be an issue with netbeans itself tho.

haidubogdan commented 8 months ago

I will close the ticket as the plugin has changed a lot. Currently there is no Warning notice inside @php directive for unused Use Statement.