Does Intellij allow you to search in previous search results? I can't seem to find anything about it. Might be possible with a custom scope?
To search in previous search results, you need have a search result open in the Find tool window. Then the scope Files in Previous Search Result appears in Find in Path and Find Usages Settings:
Related
In Visual Studio 2019 I can use Find in Files to find some text in my code. Then I can use Edit.GoToNextLocation and Edit.GoToPrevLocation to move through the matches. (I have them mapped to Ctrl-N and Ctrl-Shift-N.) This allows me to jump from location to location and edit as necessary without having to use the mouse.
How can I do the same thing in IntelliJ IDEA?
There are many ways, I suggest you get familiar with "Action" shortcut (control+shift+A) and "type" what you want, see if there's an action and what shortcut (if any) it has.
For e.g.:
Get also familiar with "Bookmarks". (Control Tab, Double Shift are also good) Control-E (recent is nice) think all these you can "type" to search in them as well and narrow the results using fuzzy search (aka: type TM for "TimeManager" for example). You get the idea.
I think I found it!
IntelliJ IDEA appears to have a Next Occurrence command that does what I want.
It seems that to get a navigable list of found results, I need to do Find in Path... followed by Open in Find Window (Ctrl-Enter). Then Next Occurrence and Previous Occurrence (not to be confused with Move to Next Occurrence and Move to Previous Occurrence!) take me through the various places.
In IntelliJ IDEA it doesn't loop back to the first result like Visual Studio does, but I can live with that.
I do wish it would go straight to the Find Window instead of me having to tell it to.
Suppose this file tree. I'm searching for sass, and the first highlighted entry is .sass-cache. However, I want to navigate to _sass instead. Is there any shortcut to jump to the next/previous search result?
I know I could type _sass to make it more specific, but I'd still like to know a way to flip through search results if available.
It is surprisingly intuitive. Just use the arrow keys, Up or down to select the next or previous match
Using 'Find in Path' in intelliJ we can preview search results easily by looking into files found. Is it possible to make upper panel (one that displays files found) show longer(deeper) source path.
Currently it shows
parentFolder\fileFound
or
parentsParentFolder\[..]\fileFound
if intelliJ find parentFolder to be a common name.
I want to make preview panel showed me file source up to n-th level like
n-thParentFolder\n-1-thParentFolder\...\parentFolder\fileFound
Is it possible?
EDIT: providing screenshot for better understanding
Looking into screenshot provided, I cannot tell the difference between 1st-4th row and 3th-6th row.
That's not currently possible: https://youtrack.jetbrains.com/issue/IDEA-174542 -- watch this ticket (star/vote/comment) to get notified of any progress.
ok I search for say
eval() in a php project to find leaks.
I get 60 hits. I look at the first result and want to see if this is maybe a security leak. I see eval() gets called like this eval($mySpecialVar) I then search for $mySpecialVar I see it is not security problem. Now I want to check the next entry of the eval() search result... but it is not there any more. I have now to search again for eval() from the very very beginning, and figure out where I was with the 60 results....?!?
is there no more clever way to do it?
EDIT
the open in new tab is grayed out for me
You have to check "Open in new tab" setting. Its location depends on what search you're using - if it is a text find, the setting is under Result Options section:
If you're searching for usages, it is in Edit > Find > Find Usages Settings:
Note that this option is enabled only if you already have some search results displayed. So in your case: you first search for eval(), then before searching for $mySpecialVar you're clicking on "Open in new tab".
Yet another option would be after searching for eval() to pin the search results, so the new search will always be opened in a new tab:
In Eclipse it is possible to browse through a stack of previous search results. In IDEA it seems I can only have one set of search results, and if I want to do another one, I'm destined to lose the first set. Is there a way around this?
If you're using the 'Find in Path' method to search (CRTL + shift + F on windows) then you'll see in the dialog box a checkbox near the bottom right labelled 'Open in new tab'. Checking that checkbox allows you to have multiple search results each in their own tab.