Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove deleted files from emacs-projectile's cache if `projectile-invalidate-cache` doesn't do the trick?

Pretty much what the title says. For whatever reason projectile-invalidate-cache does not remove dead files from projectile's cache, or at least not from the results it presents me. I am using Spacemacs, an extension of Emacs, but I believe this issue is specific to projectile.

Restarting the editor does not fix the issue.

like image 947
Styx_ Avatar asked Oct 01 '16 15:10

Styx_


2 Answers

One thing to try would be to make sure you are running projectile-invalidate-cache from the project you want to clear out files for (i.e., from a buffer that is visiting a file in that project. From the docs for projectile-invalidate-cache:

Remove the current project's files from `projectile-projects-cache'.

Note it is supposed to work only for the "current project".

However, I have also not had much luck with this command (potentially this is me not using the command correctly). What I often end up doing is deleting the actual cache file (in my case this is ~/.emacs.d/projectile.cache. I have not noticed any negative effects of this, and your cache will be rebuilt without the deleted files next time you use projectile.

like image 99
elethan Avatar answered Oct 22 '22 20:10

elethan


If your project is a git project, try to commit your change. It works for me.

like image 3
Jenkins K Avatar answered Oct 22 '22 20:10

Jenkins K