WebStorm: search does not work

32,389

Solution 1

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

Solution 2

For me nbaosullivan's 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

Solution 3

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

Solution 4

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

Solution 5

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.

Share:
32,389
Lola
Author by

Lola

Updated on July 12, 2022

Comments

  • Lola
    Lola almost 2 years

    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?

    • ajp15243
      ajp15243 over 9 years
      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.
    • Lola
      Lola over 9 years
      I chose the Scope in different ways, even reinstall the program. need to clean karma :)
    • lena
      lena over 9 years
      please try invalidating caches (File/Invalidate caches, restart) - does it help?
    • mikkelz
      mikkelz over 9 years
      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.
    • Chathurika Sandarenu
      Chathurika Sandarenu over 8 years
      Invalidating cache fixes the same issue in InteliJ Idea as well.
    • w411 3
      w411 3 almost 3 years
      you're a life saver @lena
  • mrarm
    mrarm about 8 years
    I'm using PHPStorm 8.0.3. That is also REALLY KILLING my productivity. I have some problems with SSHFS on Linux - unfortunalety, problems persist and are unresolvable. I' experiencing disconnects from SSHFS mount. I must invalidate my caches then and restart PHPStorm. My project contains few projects in reality, so indexing last about 10 minutes. Before that, I must click Scope->directory in 'Find in Path' dialog.
  • ufukgun
    ufukgun almost 8 years
    Another note: do not forget to uncheck regular expression when u dont need :)
  • Master James
    Master James over 7 years
    I was using the active dev environments Ubuntu VM to search on command line for months. Thanks and I hope it sticks. Could have been switching files with git or what that triggered it I'm not sure. Maybe it was a trial of a newer version?
  • milkovsky
    milkovsky about 7 years
    Does not hep me. My search works only if the file is directly in the same directory. When I click on the parent directory, search shows no results.
  • milkovsky
    milkovsky about 7 years
    Argh. There is a checkbox Recursively reddit.com/r/phpstorm/comments/3ty6ld/…
  • Skylord123
    Skylord123 about 7 years
    I just had this issue. I tried the fix above to no avail. My double shift was working (searching classes) but searching within a single file, searching an entire directory, etc was broken. I deleted all phpstorm files for the program and re-copied them over and it fixed it. This was after upgrading to 2017.1.2
  • VSO
    VSO over 6 years
    I was afraid this was going to clear my local changes from git somehow - it did not. Works perfectly.
  • Dominik Ehrenberg
    Dominik Ehrenberg over 6 years
    What @milkovsky said! I just had this exact same issue. Mind that the checkbox seems to be a UI button now, see imgur.com/a/CWyxz
  • dgundersen
    dgundersen over 6 years
    This also fixed my PyCharm search (Find in Path) when it stopped returning results for stuff I knew existed.
  • CWSpear
    CWSpear over 6 years
    So this works, but I have to do it multiple times a day... what would be causing this?
  • Herbi Shtini
    Herbi Shtini about 6 years
    Doesn't this reset code alignment, spacing and other similar preferences?
  • Adam Patterson
    Adam Patterson over 3 years
    I was just about to post this because it was the exact problem I had.
  • John
    John over 3 years
    Since Version 2020.3 this option is NOT helping anymore. Whatever is regularly corrupting those indexes, they get corrupted also when they are recreated. We will need to wait for a bugfix
  • Smaïne
    Smaïne about 3 years
    6 Y afters it helped me TY
  • CodeToLife
    CodeToLife about 3 years
    that happened to me as well.Now fully realised - I copy pasted a folder manually and it just wasnt indexed by ide as it looks. Came back to this upvoted before post once again.
  • nbaosullivan
    nbaosullivan about 3 years
    This also helped me 6 years later when PhpStorm was stuck indexing, in a background task: Updating indexes
  • Anthony
    Anthony over 2 years
    Wow that's a lot better now...
  • Nipul Sindwani
    Nipul Sindwani over 2 years
    in my case there is no file named modules.xml, It has vcs.xml and workspace.xml what should be the approach in this case.