0

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): vendor/nrf5-sdk-old/components/drivers_nrf/spi_master/nrf_drv_spi.h # the new file: vendor/nrf5-sdk/integration/nrfx/legacy/nrf_drv_spi.h 

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?

3
  • 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 Commented May 8, 2018 at 9:06
  • @ChakravarthyRaghunandan mmm, "Wrong type argument: hash-table-p, nil" Commented May 8, 2018 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 Commented May 8, 2018 at 15:41

1 Answer 1

1

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.

3
  • Good to know! Unfortunately I still get one more hit compared to find -name. Commented May 8, 2018 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 Commented May 8, 2018 at 15:42
  • @ChakravarthyRaghunandan yes I know, thx. But for me personally it is easier to invalidate cache and then call find file again. Commented May 8, 2018 at 17:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.