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.

66 comments

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

@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.

5

@Oksana

I had totally missed that feature. Searching files and opening files via the shortcut are working perfectly again.

Thanks for your help!

0

Thanks @Oksana, 

Although this works, the issue is being reproduced after several IntelliJ Idea start up's.

Is there any way to solve it permanently? It's a quite annoying issue.

I'm currently using IntelliJ 2017.2.5 and the issue is there quite often

Thanks in advance

Fran

0

@Oksana,

Ditto on Fran's comment. I keep having to do this every few days to get the search to work again.

0

@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

@Fran and Philip If the problem appears again after cache invalidation please provide the contents of your log folder (Help > SHow log in ...).

0

@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.

7

+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

+1, I use itelliJ 2017.2.5 and every morning I have to invalidate caches to be able to search for some words/phrases, at the same time for some words/phrases it works, but it doesn't find all occurences (which is of course worse as it was pointed out in comments above)

0

@Oksana, one can make the case that even the need to "invalidate cache" is a silent admittance of a Bug. After all if the IDE is really "smart" as it claims to be, then it should "know" what file has changed and update the cache all by itself. Why does it need to get the user to do this? I don;t think that visual studio has any such need and the find all always worked perfectly. Rather than putting on any new bells and whistels, pls get your dev team to swarm and fix this major bug.

0

@Oksana, I have the log file, but it's pretty long, do you still want it posted here in this thread? or Should I send it to you directly?

0

Please upload all contents of your log folder (not only one log file) to a file hosting.

0

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

@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

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

Uninstalling the plugin .ignore also worked for me. I didn't even have to invalidate caches.

0

I am also experiencing weird Find in path issues in PHPStorm 2017.3.2. I upgraded to High Sierra, and this is the first time I have noticed. Not sure if it was there before.

Example: I search in path for a CSS class 'cssclass'. Find in path finds the class in the compiled css file, but not in the  .scss file where there is the same class, despite multiple occurences of this class in the scss file.

It seems Find in path is totally unreliable.

I have done the Invaliate Caches / Restart thing multiple times.

I do not have a .ignore plugin.

EDIT:

In my case it was this issue:

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

I had more than 100 occurrences and for some reason the rest is not shown. This ridiculous. Using 'Find in Window' is a workaround that works. 

 

 

 

0

@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.

1

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.
 
1

>What I also did was this:

>found in the issue I linked. I set it to 1000, which works for me so far.

I would just use the right scope/folder search if I need more precise results. But if it works OK for you this way -- then why not.
0

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

@andriy I do indeed also have problems with autocompletion/importing of classes. It is not in the filtering, preview of the window I have checked that. Also selecting Search in folder in the folder I know the code is, does not show anything.

I have also added a comment to https://youtrack.jetbrains.com/issue/IDEA-184777, a tracker issue concerning this. If I find more concrete cases to document, I will add that info there if that's okay. Please let me know if you have another tracker issue to add it to.

0

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

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

@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.

6

@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).

1

Please sign in to leave a comment.