WebStorm: search does not work
Solution 1
As lena said, the following should fix it for you:
- Click File -> Invalidate Caches / Restart..
- Click the button "Invalidate and Restart"
- 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.
Solution 3
Try this (it helped me in PhpStorm 2019.3.1 when "Invalidate Caches / Restart" did not):
Close WebStorm
Backup directory
<your project>/.idea/
to anywhereDelete file
<your project>/.idea/modules.xml
Open WebStorm
Solution 4
Newer version of Webstorm /PHPStorm automatically exclude some folders. For example vendor folder.
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.
Lola
Updated on July 12, 2022Comments
-
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 over 9 yearsWhat is your
Scope
set to? I've found that IntelliJ likes to sometimes set itself to theDirectory
scope instead ofWhole project
after performing a search. -
Lola over 9 yearsI chose the Scope in different ways, even reinstall the program. need to clean karma :)
-
lena over 9 yearsplease try invalidating caches (File/Invalidate caches, restart) - does it help?
-
mikkelz over 9 yearsThanks, 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 over 8 yearsInvalidating cache fixes the same issue in InteliJ Idea as well.
-
w411 3 almost 3 yearsyou're a life saver @lena
-
-
mrarm about 8 yearsI'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 almost 8 yearsAnother note: do not forget to uncheck regular expression when u dont need :)
-
Master James over 7 yearsI 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 about 7 yearsDoes 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 about 7 yearsArgh. There is a checkbox
Recursively
reddit.com/r/phpstorm/comments/3ty6ld/… -
Skylord123 about 7 yearsI 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 over 6 yearsI was afraid this was going to clear my local changes from git somehow - it did not. Works perfectly.
-
Dominik Ehrenberg over 6 yearsWhat @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 over 6 yearsThis also fixed my PyCharm search (Find in Path) when it stopped returning results for stuff I knew existed.
-
CWSpear over 6 yearsSo this works, but I have to do it multiple times a day... what would be causing this?
-
Herbi Shtini about 6 yearsDoesn't this reset code alignment, spacing and other similar preferences?
-
Adam Patterson over 3 yearsI was just about to post this because it was the exact problem I had.
-
John over 3 yearsSince 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 about 3 years6 Y afters it helped me TY
-
CodeToLife about 3 yearsthat 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 about 3 yearsThis also helped me 6 years later when PhpStorm was stuck indexing, in a background task: Updating indexes
-
Anthony over 2 yearsWow that's a lot better now...
-
Nipul Sindwani over 2 yearsin my case there is no file named modules.xml, It has vcs.xml and workspace.xml what should be the approach in this case.