Is Find in Path Broken?

So in Angular after looking at a service, I wanted to find its uses. I used Find in path to search for uses, but although it came up in numerous Test Files, and Test Reports, I could not find any actual usage. I then asked a colleague, and we found another service that was using it. But Find in Path was unable to locate that service even though I am searching the entire project. 

Have Invalidated Caches and Restarted, and it still cannot find the string in a code file. 

Basically Find in Path is broken/erratic.

However when I open the file that contains the string, then Find in Path finds it.

Am coming to the conclusion that Find in Path is flaky / not reliable. Has anyone else actually checked that when you do this it actually finds them, becasue i suspect it is silently missing stuff that most people never realise!

this would be a Disaster during Refactoring across a project, and frankly would make using WebStorm like a Dinghy with a Hole in it. But I don't get how JetBrains could allow such a bug thru, at present it jars when i see it being called the Smartest Javascript IDE!!! Not being able to do a Find All reliably is Dumb.

22

@Philip,

Please try invalidating caches:
1. Click File | Invalidate Caches / Restart
2. Click the button "Invalidate and Restart"

After the restart run a search again and let us know the results.

13

@Fran thanks for adding the detail. @Oksana, with respect, I simply don't think you get it at all. Let me try and explain again:

The problem is not that Find All is "not working". It gives the impression of working and that everything is fine. But silently, if there are say 50 occurences in 50 files, it may only find 45 occurences in 45 files. It entirely misses and is Silent about the missing 5 occurences.

As a Dev, we have no idea that it is not working. After all it found 45 occurences. So all is "well and good"

But silently under the hood, Webstorm is failing to tell about the 5 occurences, and so if you are renaming or refactoring these 5 will be missed and will become bugs.

So when you say, to tell you if the problem appears again after cache invalidation, that is wrong headed logic. As a Dev, how do I know that the problem has appeared and I need to fix it by invalidating the cache??

I simply have no idea that Webstorm missed the 5 files, and I have no reason to "fix it" by invalidating the cache.

So Webstorm has to be a whole lot smarter, and work out when the cache needs to be invalidated and reindexed, it cannot expect the developer to tell it this. 

Have you even bothered to discuss this issue with your Development mangager, clearly you are not able to appreciate the seriousness, but he/she will.

Please escalate the issue to your development manager, I am sure they will be able to get the issue straight away.

The only reason you don't get a lot of people complaining is that they probably have no idea that under the hood webstorm is missing occurences and not reporting correctly all the occurences of strings in find all.

9

@Andriy Bazanov  I had no idea that Find in Path only returns the top 100. It is unreasonable to expect a developer to think and know this, as nothing indicates it at all. If you called it Find Top 100 in path, then sure. But to call it Find in Path, then the assumption is that it is Find ALL in Path, i mean if you are Finding, then WHY would you not wish to find all.

If you called it Find SOME in Path, I can guarantee you that its usage would stop, as its very rare that people only want to find "some".

I am sorry, but this is extremely poor and misleading UI. It is a serious and misleading developers, and therefore is a Bug imho.

8

I use Intellij IDEA 14.1.7 and can confirm that this helped for me:

- uninstalling the plugin .ignore

- afterwards Invalidate Caches / Restart

Looks like there might be a problem with the plugin...

3

I agree with those who say that a find/replace that doesn't work reliably is a serious problem. A faulty plugin or plugins should not be affecting the overall functioning of Intellij IDEA to this extent. If a plugin can derail a basic feature like find/replace, this is a core reliability issue and should be treated as such.

3

IntelliJ IDEA 2018.1.1 (Ultimate Edition)
Build #IU-181.4445.78, built on April 10, 2018
Licensed to Nick Mellor
Subscription expired on July 1, 2018
JRE: 1.8.0_152-release-1136-b27 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 3.10.0-514.26.2.el7.x86_64

Statistic 3.4.1

I am getting this problem too, and it had mild professional consequences that I don't want to repeat.

A few weeks ago I was upbraided by my manager because one of my refactorings missed a couple of instances of a particular variable name. The cause? Replace In Path didn't do its job correctly. I was made to look careless and slapdash. I'm a loyal Intellij user but this was not a good look, for me or Intellij IDEA Ultimate. It also doesn't make it easy to sell Jetbrains products to my colleagues.

Here's my take on it. It seems to me that plugins are involved. My suspicions were first aroused by .ignore, then Statistic 3.4.1. .ignore seems to have been fixed recently, but when Statistic is enabled Find in Path sometimes doesn't find stuff. When I disable Statistic and Intellij rebuilds the index, Find in Path becomes trouble-free again, and stays trouble-free for weeks or months until shortly after I re-enable Statistic.

I haven't looked hard at this and I'm not promising this is the cause, but this is my impression over several months. Find in Path has failed several times for me over the past year. It has always failed when one or both of these plugins were active.

I want you to understand that I don't blame Statistic or .ignore. If they are buggy, that's a separate issue. What concerns me more is that core feature Find in Path appears to be dependent on non-core plugins working correctly.

My guess is that it's because the plugin manages to derail Intellij's indexing process. If this is indeed so then it is a flaw in the IDE's plugin architecture that needs fixing. Making a core feature subject to the whims of a non-core plugin is a recipe for trouble and you will never be free of this trouble returning when the next version 0.1 of a plugin comes online and blows up the indexing.

Come on Jetbrains, yes Jetbrains, fix this as a matter of urgency and stop embarassing me in front of my colleagues!

Cheers,

Nick

3

@Oksana,

The reason why I think this is "Dangerous" is that in my case it wasn't that Find All was not working, it gave the impression of working, but failed to find all occurences. Therefore unless you "know in advance" you simply think, ok thats all the occurences. So even if you have this "fix", it would not be used or practically of benefit, because devs won't even know that the Find All is now misbehaving, they will simply incorrectly assume that all is ok, but miss out on some uses.

That is why I think you need to Red Flag this to your Dev Team. Please Stop making any new features. Just fix this first most essential feature.

In my case I upgraded versions, and it then started working fine, but if it is still missing occurences, then how am I to even know, as I don't double check everytime I use the feature.

 

2

Right @Mickeypuri, I must correct myself. It's not that it's not working. It's just working wrong. It finds several things, but in general, the search result is not real. There're non found files that I know for sure that exist.

I think this is a very important problem at the moment. This feature is used everyday like 100+ times. Not having this, for me makes the IDE nearly useless.

Please report urgently to your dev team.

Thanks in advance,

Fran

2

@Geeves

Please list your active custom plugin that you have got there. It might be one of them that causes the issue (e.g. .ignore in particular)

2

@Remco

Find in Path really shows a preview only (top 100 results) -- it allows to quickly estimate if you are using correct search term (especially in case of regex). I guess devs need to make it more clear that "more results are possible and you only seeing top 100 results" ..a s right now "100+ matches in 10+ files" can be easily misinterpreted (as in your case). Originally (previous design) it was on a separate "Preview" tab so it was more clear.

But even "Open in Find Window" asks after 1000 (1 thousand) found results if you really wish to continue with the search.

2

So I guess it's a feature, not a bug ;-) 

But with a usability issue here: it's totally unclear this is happening and it's easy to miss found items, leading to all kinds of bugs. I search a lot in CSS and SCSS and only one occurrence in an SCSS file can lead to a lot in the compiled CSS file. If those are the first 100, the item you look for is nowhere to be seen and that leads to confusion and misunderstanding.

What I also did was this:

"You can adjust "ide.usages.page.size" IDE property (Help | Edit Custom Properties... action) and set it to a bigger value."
 
found in the issue I linked. I set it to 1000, which works for me so far.
 
2

@Nick Mellor 

>The only thing that worked was to delete the .idea directory and re-open the project from scratch.

That sounds like some serious issue (regardless of what's causing it) as it's not caches/indexes issue then. Should not be some misconfiguration as well (especially for simple words like "for"). I suggest to file new ticket at IntelliJ IDEA Issue Tracker and provide all needed info (start with idea.log) for devs to look into.

 

@Mickeypuri

Please file the Usability ticket about "non-obvious top 100" (if https://youtrack.jetbrains.com/issue/IDEA-178771 does not answer this)

https://www.jetbrains.com/help/webstorm/find-and-replace-in-path.html#preview says that it's a "Preview" area ... and seeing "100+ matches in 10+ files" text suggests that it's just a preview and can have more results. But I agree -- it's not super clear what exactly that means if you do not look deeper into it (my past comment in this thread about it).

2

Something to check - I was having problems and found that if a directory is excluded (right click on directory, Mark Directory as->Excluded) then Find in Path doesn't give any results for that directory. I guess it's excluded from the seach index too.

Just thought I'd throw that out there, might help someone!

2

Ok, I was using Webstorm 2017.2.0 and so I've just upgraded to 2017.2.4 and bingo, the Find in path now finds all the usages.

So if you are on 2017.2.0 would advise urgently to upgrade.

And JetBrains - not Smart to allow such a bug thru!!!!

1

I'm using:

WebStorm 2017.2.4
Build #WS-172.4155.35, built on September 11, 2017
JRE: 1.8.0_152-release-915-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13

Since I upgraded to macOS High Sierra, Find in Files is not working, it will only find strings in the currently open files, not across the project. Also Cmd-Shift-O to open files doesn't work because it can't find any matching files. I've tried restarting & reinstalling, but still doesn't work.

1

+1, it's a very serious issue. I can see this bug in IntelliJ IDEA 2017.2.5 and managed to reproduce it even after invalidating caches.

1

IntelliJ 2017.2.6 Find in Path is still broken and has been since 2016.3

Only able to find results when "In Project" is selected

Module, Directory and Scope always return "Nothing to Show"

1

Experiencing the same incomplete results in PHPStorm 2017.3.3. Invalidating cache and restart did help for now. Problem is that I have no indication of the completeness of my search if this function is not reliable. You can't expect me to invalidate all cache before every search.

I have not used/had installed the .gitignore plugin for years.

Has this been recognized as a (serieus) bug now, and is there any news on this?

 

1

@Matthijs Alles 

Your case can be different (if you read the comments you could see that there were different situations here already).

Better provide a screenshot with the results that you are seeing and missing results.

If invalidating caches does not improve anything .. then it's unlikely has to do with plugins (especially if you do not have those problematic ones installed). If it would be caches/indexes related .. then you would have issues in other places (e.g. unknown classes/functions; not working Navigate to File/Symbol etc). Quite possibly you are seeing just a preview (top 100 results only) .. or perhaps wrong scope/options used etc.

I cannot really suggest anything concrete without knowing the details. For me though the search works with no issues (but those are rather small/simple projects: PHP (Laravel based or custom) with no node_modules at all etc).

1

I have the same problem running Intellij IDEA 2017.3.2. In a small Python project (Python plugin 2017.3.173.4127.35) I can't search for the word 'for', with or without the Words box ticked-- it returns no results at all. I have disabled .gitgnore, invalidated caches and restarted with no effect.

 

IntelliJ IDEA 2017.3.2 (Ultimate Edition)
Build #IU-173.4127.27, built on December 26, 2017
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 3.10.0-514.26.2.el7.x86_64

 

The only thing that worked was to delete the .idea directory and re-open the project from scratch.

1

@Mickeypuri 

2 very simple reasons:

1) I do not have any issues with the search -- at very least those that are described here. It's you who are interested in these changes.

2) I do not work for JetBrains... and therefore cannot fix their product. And submitting a ticket with "Hey devs, there is some guy on the forum that does not like how the Find in Path dialog works. But he is too busy/too lazy/whatever to come here and write that ticket himself .. so here is the link -- go and check what he wants" kind of text ... not really.

1

I've encountered this problem as well. I have some file paths in my dev config files. Bad practice, I know, but that's irrelevant here.
When I search for all occurences of "ssd" (Find in path, with tab "In project", no filters) it finds nothing. Even after Invalidate Cache / Restart. But this string definitely is present:

martin (master *) PspValidator $ grep 2>/dev/null ssd */*/*/*/*/*
javaFxModule/out/production/resources/dev/config-linux.properties:validatorConfig.dir=/home/martin/ssd/IdeaProjects/PspValidator/sharedModule/src/main/resources/nkp/pspValidator/shared/validatorConfig
javaFxModule/out/production/resources/dev/config-linux.properties:#last.psp.dir=/home/martin/ssd/IdeaProjects/PspValidator/sharedModule/src/test/resources/monograph_1.2/b50eb6b0-f0a4-11e3-b72e-005056827e52

Here is my project where this happens in last commit still containing the "ssd" string:
https://github.com/NLCR/komplexni-validator/commit/d724f85936b5eeb261ec0d352de6f4103f814bfe

This happens in IC-173.4548.28 and IC-181.3263.15 as well.
JDK: 1.8.0_161 (build 1.8.0_161-b12) amd64 (Oracle)


Search in IDE not working reliably is obviously very serious problem!

1

I am having this problem as well.

Intellij fails to find strings in my .properties and .xml files.

This is a major productivity killer and bug-introducer, please fix

1

Find in Path has become completely worthless to me in Webstorm.  I do not understand why they can't make it work reliably.

1

Problem reproduced on Windows 10 

Intellij 2017.3.5 Ultimate Edition.

 

Find all in path (scope Project) failed to find all xml files. When I explicitly activated extension filters and set it as *.xml, it found the lines in xml. However, deactivating the filter and trying to find any occurrences resulted in incomplete results (I was lucky since I knew what I was searching for this time).

It's not a "Feature" because clearing the cache as instructed above made the results come up normally again. It's a bug.

 

And it's a really bad bug because there will be times when it's impossible to know if the results are complete or not - and it will lead to nasty bugs if not lucky enough to be caught on compile time.

 

Please acknowledge the bug and start working on it if possible.

 

1

@Mickeypuri Thanks. I was just doing the same, you beat me :-). I hope this issue will get some well deserved attention now.

Please upvote the issue everybody.

1

- Also posted in the RubyMine forum, this is a duplicate in case it adds to the issue, expect response in RubyMine  Forum -

I would request that a label saying 'Only first 100 instances listed, may appear elsewhere' be slapped on top of the Find In Path results popup window in RubyMine.

I'm a big fan of RubyMine.

This issue has recently caused me some wasted time.

I had removed a column from a database and my automated tests were failing because they were expecting the column. I searched for it in the code and although it appeared many times in a generated errors web page and a log file (over 100 times :) ) it didn't appear anywhere else.

For the life of me I couldn't understand why the tests were looking for the column.

I had assumed '100+ matches in 6 files' mean't that it only was found in those six files which I knew weren't causing the problem.

Now it seems I will need to do a Find In Path and then Open in Find Window if the result set is 100+.

I tried to adjust the ide.usages.page.size property but apparently that's not possible in my version of RubyMine.

Is there a process where I can search and go straight to the Open in Find Window view ?

Cheers

Sam

1

Hi same problem here.

Find in Path fails to see all occurrences.

I just started using Intellij IDEA, it seems good (even if i need to configure it a lot since most defaults are terrible for my habits), but i was finally starting to get used to it and i must say it's quite faster than my previous IDE.

Unfortunately i must say this search issue is a very big problem for me, since the bug is completely silent.

Reading previous comments I see this problem is very common and is still there by more than 2 years now....this is a serious problem preventing me from using the IDE.

Just to be clear: This CANNOT BE a Feature! (like someone in the comments said)

It doesn't limit results by any meaningful criterion, unless you think that 6 results in 4 files are too much and you have to limit them to 4 results in 2 files....

By the way, "Find in Path" popup manage to see 5 matches in 2 files, while the Find Window only get 4 in 2 files...so it is probably more than one bug, or it just behaves differently depending on the tool used.

 

Currently, after verifying a lot of missed occurrences in various test searches that i have run, I decided to get back to *AnotherIDE* because search in files is a core feature and i must be sure i can rely on it.

Also, I do not have any intention of wasting my time over a issue more than 2 years old with people like Andriy Bazanov that seems to pretend it's just not there...

I'll check again your IDE in some moths, hoping for this problem to have been solved.

 

Goodbye.

 

1

IntelliJ IDEA 2017.3 and 2018.2: Find in Path (In Project) fails to find any matches if the Javascript Support plugin is enabled.  Here are the tests I ran:
- Disabled all plugins.  Invalidated Caches and Restart.  Find in Project worked.
- Enabled JavaScript Support (which also enables CSS Support).  Invalidated Caches and Restart.  Find in Project failed.
- Disabled JavaScript Support (CSS Support still enabled).  Invalidated Caches and Restart.  Find in Project worked.
- Enabled JavaScript Support.  Invalidated Caches and Restart.  Find in Project failed.
- Enabled all plugins.  Invalidated Caches and Restart.  Find in Project failed.
- Disabled JavaScript Support plugin (which forced disablement of about 15 other plugins).  Invalidated Caches and Restart.  Find in Project worked.
- Enabled JavaScript Support plugin (which forced disablement of NodeJS).  Invalidated Caches and Restart.  Find in Project failed.

1

Sounds like there are two different issues being discussed here... I've seen multiple tickets referenced for folks struggling with 'Find in Path' that's _actually_ broken, but for those of us who are merely appalled at the by a UI that gives almost no mention of the fact that it's limiting result to the first 100, it looks like somebody just created one here:

https://youtrack.jetbrains.com/issue/IDEA-196723

Not sure if it will last since it seems the feature WAI, buy hey, at least I tried :)

1

请先登录再写评论。