Search code examples
visual-studio-codeintelephense

VS Code Intelephense Clear Cache and Reload


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


Solution

  • 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.