Find in Path Feature quirks
While I was earlier complaining about the new Find Window, I now am a big fan, specially of the speed.
A few quirks though, and what would make IJ even more beloved:
1. Would be great to have the ability to easily exclude multiple files/dirs from the find in path options
2. Sometimes it would match multiple times in a file and even a line (spring beans for eg.) and it is an eyesore - we should be able to filter this
3. While Find Name does a great job in detecting any kinda resource, even in jars, Find in files fails miserably in peeking inside jars and we have to resort to grep, if we remember jars are excluded. My question is, when grep makes a mockery out of finding in jars, why not the Find in IJ if we are willing to wait the extra minute or two ?
4. As many have requested, a close button. When we switch to another window then come back to IJ, the focus is not normally on the Find window and it takes 3-4 clicks and a mouse click to finally exit that window
5. I know this is a caching and speed issue, but would it be possible to edit the file right in that window (selectively, if we choose) instead of double-clicking and losing that window ?
Thanks for listening !
Please sign in to leave a comment.
Your feedback is welcome in the issue tracker: https://youtrack.jetbrains.com/issues/IDEA.
1. This can be done using custom scopes. See also https://youtrack.jetbrains.com/issue/IDEA-130905 and the linked issues.
2. Please see https://youtrack.jetbrains.com/issue/IDEA-165152.
3. Try the Scope Project and Libraries.
4. Indeed, already requested, you should just vote at https://youtrack.jetbrains.com/issue/IDEA-172388 instead of posting the duplicate request to the forum.
5. It has been possible for some time already, see https://youtrack.jetbrains.com/issue/IDEA-147920. Just checked, preview file is editable in IntelliJ IDEA 2017.1.4.
Thanks for your response Serge ! I see that most issues rely on Custom Scopes. I did come across this in a thread before and did try using it but wasn't successful. Project and Libraries did not seem to do the trick, Will re-educate myself on how to use it.
As for (5) - doh...it suddenly started working for me - I think I may have tried editing a non-source file
Cheers !
So I revisited the Find to search in jars, and this is what I confirmed:
First, Scope of 'All Places' should encompass 'P & L' AND everything else right, so thats where my scope always is for this test (in ALL)
When I do a search in this scope for a string I know exists in a class, (in an external jar), it is not found (a grep however, finds it)
When I do a find file immediately after (checking non-project files), however, it comes up easily and I can open the file and see the string there
So the resource is very much in IJ's scope, or whatever scope the Find File scope seems to be in
I can take screenshots but I am sure you can replicate yourself too.
My version: 2017.1.4
We can't reproduce the issue here.
Could you please first make sure the external jars you mentioned have source files inside, not binary .class files only and second, if Find In Path still fails to find string there, file a bug at https://youtrack.jetbrains.com/issues/IDEA with a sample project to reproduce attached.
It is a binary in the external (.class), which was kinda the basis of my asking if grep could do it why not here, but no worries, maybe in the future. Thanks for responding !
IntelliJ IDEA Find in Path works with source and resource files only. It doesn't search in the binary .class files. What you see when you navigate to a .class file is the decompiled version of the class. Decompilation is performed on the fly, IDE doesn't decompile and index all the .class files automatically, therefore there is no index available and no way to perform fast search. Such feature, while technically possible, would require decompiling and indexing all the dependencies which could take a lot of time and system resources, especially in the projects with a lot of dependencies.
Usually there are sources available for the libraries you depend on. For Gradle/Maven projects IntelliJ IDEA can download and configure such sources automatically, so find in path will work inside the libraries with the attached sources for the majority of the users/projects.
In case the library has no sources, you can perform offline decompilation of the entire library using the command line batch decompiler and attach the directory with the decompiled sources to the library.
grep is dumb and slow, it scans all the files, while IntelliJ IDEA Find in Path is based on index and works much faster (but needs the sources to build the index from).
Thanks, I will try that batch thing out...Cheers !
I can't "Find in path" into maven's jars - even when sources are downloaded.
Selecting the scope "All Places" (or any other scope) doesn't help.
This is really important to me.
Any ideas?
Sorry, can't reproduce:
Please contact support with the sample project attached and the short video of the issue: https://intellij-support.jetbrains.com/hc/requests/new.
Serge Baranov: The request is to search in the decompiled sourcecode of classes where the sourcecode is not public. Your screenshot shows clearly, that this is not a decompiled java file (*.java and named variables). Intellij automatically downloads the source-code if it is available e.g. via maven.
For everyone else searching for a quick solution: You can directly execute the bundled fernflower from the Intellij installation directory. E.g. like