"Find in Files" always finds nothing in package development mode

"Find in Files" works as expected when I am in a "normal" project. However, while in a package project (using Git) "Find in Files" always returns (No results found).

I found reference to a similar problem in an older post ["Find in files" not working on some Win7x64 machines, fine on others] saying the problem is resolved as of 0.97, but I am using 1.1.453. However, I do not have Git in my path so it seems not be directly applicable. I am using Windows 10.

Thanks for any input.

Do you have indexing disabled for this project? See in Tools -> Project Options:

1 Like

Thanks for the fast response. My project options box looks exactly like that, so indexing is enabled.

Just for fun, I checked several other versions of RStudio back to 0.98.1087 and get the same problem.

1 Like

Any chance resetting RStudio's state helps here?

The only other guess is that perhaps the Find in Files dialog is not searching within the directory you're expecting it to. Is it possible that the Search in: location has inadvertently switched to an unexpected location?

1 Like

Yes! I also discovered what caused it (I think). I simplified my package name, so I changed the folder name accordingly under the assumption that all was relative to the "main" folder; I did not delete the .Rproj.user folder. Comparing the old and new Rproj.user folders revealed that the 'find-in-files-state' variable listed in the persistent-state file was messed up.

Thanks!

2 Likes

Thanks for following up! I think the fact that RStudio preserves the old project path even after a relocation of the project is fairly confusing as well; I've filed an issue on GitHub and hopefully we'll be able to change the behavior here so this doesn't happen again.

1 Like