Reputation: 968
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
Upvotes: 12
Views: 9948
Reputation: 11
The cache of the Intelephense is located in
Mac: ~/Library/Application Support/Code/User/workspaceStorage/{{sessionid}}/bmewburn.vscode-intelephense-client
PC: %APPDATA%\Code\User\workspaceStorage\{{sessionid}}\bmewburn.vscode-intelephense-client
...for those who likes to clear the cache cause a problem.
(as in my case after renaming files case sensitive.)
Upvotes: 0
Reputation: 968
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.
Upvotes: 27