bmewburn / vscode-intelephense

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

intelephense not indexing any files #2254

Open some0ne2 opened 2 years ago

some0ne2 commented 2 years ago

Intelephense is not indexing any files inside my project.

"intelephense.telemetry.enabled": false, "intelephense.files.maxSize": 100000000, "intelephense.maxMemory": 512, "intelephense.diagnostics.implementationErrors": false, "intelephense.files.associations": [ ".php", ".phtml" ]`

Output from intelephense window:

[Info - 19:38:25] Initialising intelephense 1.8.2 [Info - 19:38:25] Reading state from /home/someuser/.config/Code - OSS/User/workspaceStorage/f9a4abeeec506a0a81f82ea0ac81fa37/bmewburn.vscode-intelephense-client/10abaa58. [Info - 19:38:25] Initialised in 41 ms [Info - 19:38:26] Environment changed. Refreshing 2 in memory documents. [Info - 19:38:26] Searching file:///home/someuser/.vscode-oss/extensions/bmewburn.vscode-intelephense-client-1.8.2/node_modules/intelephense/lib/stub for files to index. [Info - 19:38:26] Searching file:///run/user/1000/gvfs/nfs%3Ahost%3D192.168.56.101%2Cprefix%3D%252Fvar%252Fwww%252Fhtml/project1 for files to index.

Files are normal .php ending files (laravel project). What I tried already:

Thanks for any help on how to debug further!

sven-ahrens commented 2 years ago

I'm not sure if this is part of it, but I'd guess so. Since a few days, every class of my composer packages are marked red. "undefined type PackageName\Class intelephense 1009"

Packages of course are installed and they work but intelephense doesn't recognize them.

Bildschirmfoto 2022-07-05 um 14 30 50

Levdbas commented 2 years ago

I have the same issue, my vendor folder isn't getting indexed. :(


Edit: Found a temporary workaround:

I found out that my main vendor folder wasn't being displayed in my workspace sidebar. Another project where indexing still works does show the vendor folder but grayed out. When I manually added 'vendor' to the include paths. The vendor folder is located the same level where my workspace lives. the indexing process ran again and the references where working again.

gofunz commented 2 years ago

I'm not sure if this is part of it, but I'd guess so. Since a few days, every class of my composer packages are marked red. "undefined type PackageName\Class intelephense 1009"

Packages of course are installed and they work but intelephense doesn't recognize them.

Bildschirmfoto 2022-07-05 um 14 30 50

Hi, I refer to this VsCode composer psr-4 autoload of external libraries does not perform code completion and it works!

This is my solution.

  1. Set intelephense.environment.includePaths

    image
  2. Execute intelephense: Index Workspace

    image
KeremArdicli commented 1 year ago

For those who would like indexing from a folder that is not in your working folder, just add that folder to the includedPaths:

image

rogazth commented 1 year ago

@KeremArdicli Thank you so much, I was struggling with this problem for months