7

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.

Styx_
  • 135
  • 3
  • 9
  • Are these files in git? Did you move them somewhere else? If you stage the old file, and the new file, so that git knows its a rename, does that make projectile work correctly? – Bae Nov 06 '19 at 05:24

4 Answers4

5

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.

elethan
  • 16,408
  • 8
  • 64
  • 87
3

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

jerkan
  • 685
  • 2
  • 10
  • 28
Jenkins K
  • 41
  • 4
1

Actually the correct path of projectile.cache file to be removed is: ~/.emacs.d/.cache/projectile.cache

dinhnv
  • 69
  • 5
0

I installed through MELPA, and deleting ~/.emacs.d/projectile-bookmarks.eld did the trick for me.

felideon
  • 1,361
  • 1
  • 12
  • 21