bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.57k stars 93 forks source link

1.10.3 finds classes in Laravel app to be undefined #2830

Open mariordev opened 3 months ago

mariordev commented 3 months ago

Describe the bug After upgrading to 1.10.3, now virtually all classes are reported as undefined. The code has not changed, and this was working perfectly fine before version 1.10.3.

To Reproduce Use any class, like Log::debug('this is a test') in a Laravel app. The Log class is reported as undefiined, even with proper use Illuminate\Support\Facades\Log statement in place.

Or, use Laravel's helper function app(YourClassName::class) and the app function is reported as not found (or undefined).

Expected behavior Classes that have a proper corresponding use statement should not be reported as undefined.

Platform and version MacOS and Intelephense versions 1.10.3 and 1.10.4.

bmewburn commented 3 months ago

Upgrade to 1.10.4 and try reindexing. ctrl + shift + p -> Index workspace.

mariordev commented 3 months ago

Upgrade to 1.10.4 and try reindexing. ctrl + shift + p -> Index workspace.

Hi @bmewburn, thanks for your reply. I did that, but still having the same issue unfortunately. Here's an example, but basically it's not finding any classes/functions.

Screen Shot 2024-03-29 at 2 32 42 PM
kirkkhua commented 1 month ago

same issue for me Screenshot 2024-06-12 at 19 33 19

guixiaomin commented 1 week ago

Me too. Mac M3 Pro

bmewburn commented 1 week ago

@kirkkhua Laravel global namespaced facades are generated by laravel at runtime so if they are not found it's likely you need a helper file which declares them. Packages like https://github.com/barryvdh/laravel-ide-helper can create one for you or you can do it manually.

@mariordev Does the 1.11 pre-release fix your issue?

kirkkhua commented 1 week ago

@bmewburn thanks Ben! The one you recommended conflicts with carbon.

mariordev commented 1 week ago

@kirkkhua Laravel global namespaced facades are generated by laravel at runtime so if they are not found it's likely you need a helper file which declares them. Packages like https://github.com/barryvdh/laravel-ide-helper can create one for you or you can do it manually.

@mariordev Does the 1.11 pre-release fix your issue?

Hey Ben, thanks! Unfortunately, it's still the same :(

Screen Shot 2024-07-04 at 4 47 05 PM Screen Shot 2024-07-04 at 4 45 00 PM
bmewburn commented 1 week ago

@mariordev , I'm having trouble reproducing the issue. A few things you could try are: