laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
177 stars 7 forks source link

[Bug]: Laravel Idea breaks insert paired brackets and quotes inside blade.php files #1092

Open omark96 opened 1 month ago

omark96 commented 1 month ago

Bug description

Pressing [, ' or any other bracket inside a blade.php does not auto-close. Expected output: [] Current output: [

It works as expected inside a normal php file as well inside json. Before the plugin has indexed all files it works within blade.php as well, but as soon as it's all indexed it stops working.

After disabling the plugin everything works as expected.

Plugin version

8.4.0.241

Operating system

Windows

Steps to reproduce

Enable auto-closing in PhpStorm and have Laravel Idea enabled and create a blade.php file and try to type [ or any other bracket.

Relevant log output

No response

omark96 commented 1 month ago

https://github.com/user-attachments/assets/271924fc-becf-4bc3-80a5-def42de1d843

In this video I first have a blade.php file open without Laravel Idea enabled and the auto-closing of [ works perfectly. I then enable Laravel Idea and restart PhpStorm (There's a small cut to not show my desktop) and the auto-closing works while the files are being indexed. Once the indexing is done and the blue bar down to the right is gone it only works sporadically if spammed.

adelf commented 1 month ago

Hello. I couldn't repeat it. And honestly, I can't imagine how Laravel Idea can break something like that...

omark96 commented 1 month ago

I understand, I'm at a loss too. I have tried reinstalling PhpStorm (removing all configs) and Laravel Idea as well, but still the same issue. I guess the only thing I have left to try is to reinstall Windows,

adelf commented 1 month ago

Please don't reinstall Windows. It won't help.

I'll try to ask PhpStorm team about it.

omark96 commented 4 weeks ago

I did some more digging and there seems to be some kind of issue with PhpStorm detecting that I am inside an injected PHP file when using Volt components while Laravel Idea is enabled. When I have Laravel Idea enabled and click around inside the php parts I can see the following at the bottom: image But when Laravel Idea is disabled it consistently detects that I am inside injected php: image The bracket pairing breaks because it does not work while you are inside a blade.php part, not even when Laravel Idea is disabled for me.

EDIT:

I also now found out that if I disable the Blade plugin and restart PhpStorm the bracket pairing works again with Laravel Idea enabled. If I then enable the Blade plugin auto-pairing still works, but I get showered by exceptions from Laravel Idea and the auto-complete is not working at all anymore.

omark96 commented 4 weeks ago

I was able to replicate the problem on my laptop as well and it seems to be Livewire Volt component files that has this issue. These are the steps I took as exact as I can recall:

Fresh install of PhpStorm, Laravel Idea and Laravel Herd.

laravel new maryuidemo
cd maryuidemo
composer require robsontenorio/mary
php artisan mary:install (Install Volt during the installer)
npm run dev

Open resources/views/livewire/users/index.blade.php and make sure that Laravel Idea has finished indexing the project. Inside the PHP section the auto-pairing is now not working, now if you disable Laravel Idea and restart it works again.

Sorry, should have properly described how to reproduce it.

iurigustavo commented 3 weeks ago
image