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

4

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.

Pitchblende answered 1/10, 2016 at 15:19 Comment(1)
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?Ectomere
P
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.

Pinxit answered 1/10, 2016 at 17:28 Comment(0)
S
3

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

Sheik answered 22/10, 2020 at 10:11 Comment(0)
M
1

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

Megalocardia answered 13/10, 2016 at 3:27 Comment(0)
T
0

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

Tranche answered 10/9, 2018 at 18:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.