Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
omark96 opened this issue Oct 26, 2024 · 7 comments

Comments

@omark96
Copy link

omark96 commented Oct 26, 2024

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
Copy link
Author

omark96 commented Oct 26, 2024

phpstorm.mp4

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
Copy link
Member

adelf commented Oct 26, 2024

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

@omark96
Copy link
Author

omark96 commented Oct 26, 2024

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
Copy link
Member

adelf commented Oct 26, 2024

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

I'll try to ask PhpStorm team about it.

@omark96
Copy link
Author

omark96 commented Oct 27, 2024

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
Copy link
Author

omark96 commented Oct 28, 2024

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
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants