126
votes

I know that is used to search : Ctrl+Shift+F or Edit | Find | Find in Path and it worked before, but now always returns the empty set, although I know that what I'm looking for - there is in the project

Maybe someone had this problem?

7
What is your Scope set to? I've found that IntelliJ likes to sometimes set itself to the Directory scope instead of Whole project after performing a search. - ajp15243
I chose the Scope in different ways, even reinstall the program. need to clean karma :) - Lola
please try invalidating caches (File/Invalidate caches, restart) - does it help? - lena
Thanks, I was having the same issue. Search kept on saying: "Usage search was cancelled". I invalidated my caches and restarted now it's fine. - mikkelz
Invalidating cache fixes the same issue in InteliJ Idea as well. - Chathurika Sandarenu

7 Answers

353
votes

As lena said, the following should fix it for you:

  1. Click File -> Invalidate Caches / Restart..
  2. Click the button "Invalidate and Restart"
  3. After restart, try run the search again
23
votes

For me nbaosullivan proposed solution didn't work.

In my case Recursive(Alt+Y) options wasn't selected. I selected it and it worked and it will be set as default, you don't need to select it all the time.

See that icon and select it please

6
votes

Try this (it helped me in PhpStorm 2019.3.1 when "Invalidate Caches / Restart" did not):

  1. Close WebStorm

  2. Backup directory <your project>/.idea/ to anywhere

  3. Delete file <your project>/.idea/modules.xml

  4. Open WebStorm

3
votes

Newer version of Webstorm /PHPStorm automatically exclude some folders. For example vendor folder.

https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000798990-Vendor-directory-being-automatically-excluded

make sure that folders are not excluded

2
votes

As an alternative where I needed to refactor the word "holder" with "owner". Using Webstorm's find did not work very well for me. I decided to use instead the the command line with egrep:

egrep -Rli [^place]holder ./src
-R (recursive all files in directory including symbolic links)
-l (file name only)
-i (ignore case)

I found everything and excluded some instances as well via regex. It is way easier and most accurate.

1
votes

I thought I had this issue but I think actually WebStorm is only returning the first 100 or so results which all happen to be located in 2 files and thus the other occurrences in other files are not shown.

1
votes

For me unchecking the "Words" option (which searches as a whole word) make it work.