I am just starting to test projectile.

My understanding is that projectile-find-file looks into my whole repository for the file I'm looking for.

I am also currently working on the file structure of my project. When trying to open a file (one I have moved), both the new and the old location show up as suggestion. If I choose the old location, a new file is created.

My questions:

  • is the file location information cached somewhere, in that case where? I installed projectile after moving the file. How can I clean the old info?
  • is there a way to prevent projectile from creating files? I'm happy with returning to ido-find-file for file creation.

More details: I am upgrading an SDK that is a submodule of my repo, and the new version has another file structure.

# the old file (note the "old" in the path):
# the new file:

When I run projectile-find-file in my project:

enter image description here

Note the second suggestion, which is a file that does not exist. What exists is this file, but in nrf-sdk-old instead of nrf-sdk as advertized.

I've tried moving away the nrf-sdk-old altogether, the suggestion keeps coming up.

EDIT: I've tried removing my TAGS file. The old path is still in my checked out commit, though (but not in working files). Could that be it?

  • if C-c p f is projectile-find-file type C-u C-c p f and it'll automatically delete the cache and repopulate the cache with the latest files – Chakravarthy Raghunandan May 8 '18 at 9:06
  • @ChakravarthyRaghunandan mmm, "Wrong type argument: hash-table-p, nil" – Gauthier May 8 '18 at 9:08
  • enable toggle-debug-on-error and run the command again. You shouldn't get that error. Try filing an issue in projectile or check your init.el configuration – Chakravarthy Raghunandan May 8 '18 at 15:41

C-c p i -- invalidate cache, projectile-invalidate-cache.

For windows the next cache 'repopulation' might be quite slow. You can use ripgrep to greatly spead it up.

| improve this answer | |
  • Good to know! Unfortunately I still get one more hit compared to find -name. – Gauthier May 8 '18 at 10:46
  • C-u C-c p f automatically invalidates the cache and repopulates it again. No need to manually invoke projectile-invalidate-cache – Chakravarthy Raghunandan May 8 '18 at 15:42
  • @ChakravarthyRaghunandan yes I know, thx. But for me personally it is easier to invalidate cache and then call find file again. – Maxim Kim May 8 '18 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.