haringsrob / laravel-dev-tools

Developer tools for easier Laravel development (Blade lsp)
Apache License 2.0
94 stars 6 forks source link

Component not found #18

Open gmnz opened 2 months ago

gmnz commented 2 months ago

Hi,

In lsp mode inside nvim I get this error message:

image

but when I run "laravel-dev-tools views . > views-my-my.json" in the project root dir the component is listed in the .json file:

"common.components.pagination.index": "\/home\/michael\/Code\/staremesto\/resources\/views\/common\/components\/pagination\/index.blade.php",

How can I make the lsp detect the component too instead of giving me an error?

arpangreat commented 2 months ago

Just do composer install in the root of the folder.

cbaconnier commented 1 month ago

I'm experimenting the same issue. Digging a bit, I'm getting the error when LSP is running

[ERROR][2024-10-24 10:25:17] .../vim/lsp/rpc.lua:770 "rpc" "/home/clement/.local/share/laravel-dev-tools/builds/laravel-dev-tools" "stderr" "PHP Fatal error: Cannot redeclare Amp\delay() (previously declared in phar:///home/clement/.local/share/laravel-dev-tools/builds/laravel-dev-tools/vendor/amphp/amp/lib/functions.php:132) in /home/clement/Projects/test-lsp/vendor/amphp/amp/src/functions.php on line 81\n"

This can also be replicated by running the command

./laravel-dev-tools helpers /home/clement/Projects/test-lsp

It may not be related at all, but I think the server conflict with newer versions of Laravel.

I have spatie/laravel-data and rector/rector in the project. Both use amphp/amp:v3.0 meanwhile laravel-dev-tools has the v1 in the dependencies through phpactor/language-server