VS Code Intelephense Clear Cache and Reload
Asked Answered
F

1

12

I use Visual Studio Code with Intelephense, and this works wonders on all of my projects except for one, where every class is shown as undefined until I open the file that contains the class. Therefore I have a suspicion that Intelephense is not scanning this project.

Some suggestions around the web mention to perform a "Clear Cache and Reload", however I cannot find this option anywhere. Can anyone show me where I can locate this, please?

I am using Windows 10, VS Code 1.46.1, and Intelephense 1.4.1

Fichte answered 26/6, 2020 at 11:56 Comment(0)
F
26

It appears to have been removed in version 1.0.0 (2019-02-20), as referenced in their change log in GitHub, in favour for "Index workspace". This can be activated by opening the command pallet (Ctrl + Shift + P) and typing "Intelephense: Index workspace".

However this did not resolve the indexing issue. This was in fact caused by a problematic symlink that somehow was linked to itself. When I have removed it and restarted VS Code, the indexing worked as expected.

Edit: To force Intelephense to re-index your code, you must have a PHP file active, otherwise the option will not show. Thank you for Artem Russakovskii for highlighting this, and truefusion for the workaround.

Fichte answered 29/7, 2020 at 15:11 Comment(5)
Good catch! I had a symlink to an sshfs partition which was not mounted 🤦Headband
The only intelephense command I see in VSC is Enter license key. i.imgur.com/6Ob2tg8.pngSwinish
Seems like perhaps a PHP file for the desired workspace needs to be the active, open document for the command to be listed.Mastermind
Thanks very useful - I'm new to VSCode and was searching for CLI commands, using the palette was interesting. If you are not sure the index clear ran you can view Output terminal and select intelephense from the drop down.Frazer
"Thank you for Artem Russakovskii for highlighting this, and truefusion for the workaround." Here I am 2 years later, googling the same issue and finding my own comment I don't remember leaving and a reference to that comment in the solution.Swinish

© 2022 - 2024 — McMap. All rights reserved.