In Eclipse, how can you search within a search result? - eclipse

"Long live the Unix Pipes".
Since I am working with Eclipse IDE, I would like to perform search within search results. Is that possible? How can I do that?
Ex:
Search for references of User (class).
> Search for validation in this result.
> Finally, search for specific pattern.

This is possible in Eclipse, well as far as the version I am using which is Eclipse Juno 4.2.2; I've used this extensively for impact analysis.
For example:
Search using "File Search" with criteria "employee"
The results will appear in the Tab "Search", assuming you are in the tree view (by default), click the root folder
Again, use the "File Search" this time using the 2nd criteria, for example "default" and making sure to click the Selected resources radio button
Effectively, this searches the keyword "default" from the previous search results produced by searching "employee".

Is it really required?. If you are searching any key in the search results then why don't you use it as search key in previous search itself?.
Eclipse search supports regular expression so you can use multiple search words likes key1 or key2 or key1 and key2 etc to narrow the search results.
Refer this Eclipse File Search Dialog - Regular Expression for Group Unions and Negation
However
You can search in search results with the help of some plugins check here. Take a look at Insta search and glance(Suites for your need) plugin.
Search result can also be exported with the help of this plugin

You cannot. And I am 99% sure of this.
But, just for your info, you can do reference search by pressing Cntrl + G on class name, or method name.

Related

How to get a list of all files matching search criteria in VSCode?

As per the answers in this question, there are two primary ways to search for files in VSCode:
By using CTRL/CMD + P/E to search and "go to file"
By clicking anywhere in the explorer tree and typing
Why do the above solutions not suit my needs?
I need a way to search for files and get a full list of them (in plain view) so I can easily scan them.
The 1st method returns only partial results unless I scroll down.
The 2nd method only searches the folder tree that's currently open.
I know I can use the find command in Linux to achieve this, but can I achieve something similar in the editor itself?

Search for an exact phrase with InstaSearch for Eclipse

How can I search for an exact phrase in Eclipse instasearch?
When I search for
one two
it will find also files that contain only one. And the file containing the exact phrase is not at the top of the result list.
UPDATE:
#Ad Infinitum suggested to turn off the option:
Find similar matches when no exact matches found
but strangely it does not work as you can see from the screenshot:
Instasearch is already looking for the exact match. However, if it cannot find an exact match, it looks for the alternatives. If you only want to display the exact match, there is an option, which you can unmark the fuzzy search, in the instasearch's preferences.
In order to get the instasearch's preferences.
Window -> Preferences
when the Eclipse's preferences dialog is openned, you can write instasearch in the search text field, which brings you the instasearch preferences.
I hope that is the option, you are looking for.
EDIT
When this option is unmarked, the results will be something like that if there is no match. 0 matches and under of it, there is more selection, which shows the fuzzy search results.

Best way to search for instances of a string in Eclipse

I am trying to find where a particular variable is being set. Is it possible to search through a set of project source files to find all the possible spots a certain variable might be getting set?
The search in the drop-down menu is a bit confusing to use. After I enter a search I happen to be looking at, and I know it is there, when I do a search from the root of the file system, it tells me that the string is not there :)
Is this a common newbie issue? I just recently started using Eclipse and could just be missing something simple :)
Thanks,
Alex
Select the field where it is declared, then ctrl+shift+H to open the search dialog. The "Java Search" tab should be selected with the Search string populated with your field name, including package. In "Search For" select "Field" and in "Limit To" select "Write accesses" That will show you everywhere that field is assigned.
Here's a screenshot of the search dialog.
I believe the default mapping is Ctrl Shift G.
Highlight the variable and do Ctrl Shift G it will find all references of that variable.
Be careful, it will not just do assignments, so you might be getting more data than you want.

Simple eclipse search problem

I use the eclipse File Search option very much to search all files in my workspace for a certain content. But how do I specify that it should only return hits from a fixed search criteria? As an example I would like to find all occurrences of the string:
com.mystuff.data
but I also get all the hits for:
com.mystuff.data.ui
How do I make a "this-string-only-search" when searching files in my workspace??
If I understand you correctly, Eclipse don't provide option to search exact word.
You can use regular expression for it.
You can use \bSearchKeyword\b to find exact word.
I suggest that you use regular expressions.
Here are the steps:
Select the checkbox "Regular expression" which is located beside the "Containing text" field.
In the "Containing text" field write: com.mystuff.data\D\W
Note that:
\D means "no digit"
\W means "no alphanumeric"
In case you would like to refine the regular expression, click Ctrl-SPACE, in order to get the regular expression assistance.
Hope this helps.
Best regards
Maybe slightly off-topic but this got me tripped and brought me here - maybe useful for somebody else:
In the Eclipse standard Find/Replace dialogue the section 'Options' (that includes the option 'Whole Word') may be hidden if the Find/Replace dialogue window was previously resized to a smaller size, without any clue to its presence. Resizing it larger brings back the options section. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=355206
and attached shots.
Eclipse standard Find/Replace dialogue search for Whole Word regards several characters (including period) besides a space as a word delimiter, so you indeed cannot distinguish between "com.mystuff.data" and "com.mystuff.data.ui"
E.g. search 'Stack' with option 'Whole Word' checked:
will match:
Stack
Stack overflow
Stack.overflow
Stack,overflow
Stack[overflow]
Stack(overflow)
Stack-overflow
Stack/overflow
will not match:
Stackoverflow
Stack2overflow
Stack_overflow
Simplest way is to add space in the start and end of your search term.
Try SHFT+ CTRL+R, then on right upper angle select Working Set, then name and specify your resources.
Create Work Set as above, then CTRL+H check checkbox All occurency, then select your Work Set. Or maybe you can create work set in CTRL+H.

finding a function with particular name

How can i search for a function with particular name in my entire project.I dont even know if the function by that name exists.So i cant find references to that function by right clicking and then selecting the required option.
For example in eclipse we have one short curt ctr + shift +R to search for all classes with particular name.
Ctr + 0 to search for function in current class.I want to search in entire workspace
You can use the Java... option in the Search menu. The default options will search the entire workspace for all references and declarations of the search string. If you want to search only for declarations, there is a Limit To option.
Ctrl + H will give you the full text search of Eclipse.
In the tab Java Search you can specify to search for methods only (Limit to) .
At the bottom you can also specify the scope of your search, in your case that would be 'Workspace'.
If that does not suit your need type Ctrl + Shift + L twice, this opens the menu with the list of all Eclipse hotkeys.
There you can for example sort by category and browse all hotkeys in the search category. That will give you quite a good list of the possible search options you get withing eclipse.