Bug 221081 - [search] allow to search for more than one element type (method/type/...)
Summary: [search] allow to search for more than one element type (method/type/...)
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-02 19:46 EST by Ducky Sherwood CLA
Modified: 2008-07-28 13:38 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ducky Sherwood CLA 2008-03-02 19:46:46 EST
I believe that more people would find Java Search more useful if it defaulted to the most general search possible: where it searched for the string in all occurrences of all types and methods and package names and constructors and fields in the entire workspace.

Why?  I just got done doing a user study, where I watched seven developers closely doing four Java coding tasks with Eclipse-based tools, then interviewed them.  I found that people used File Search much more often than Java Search, even when a Java Search would have been more appropriate.  When I asked them why, they said that there were so many buttons on the Java Search that it was easy to get it wrong, and hence to miss real results.

With the File Search, they got a bunch of false positives, but that wasn't nearly as important to them as avoiding false negatives.  

I thus recommend that the Java Search be changed to default to the widest scope, with checkboxes instead of radio buttons for the "Search for" options (type/method/package/constructor/field).
  
For people who want backwards compatibility, it could (*sigh*) be yet another prefs option.  I feel pretty strongly (based on my user study) that the default should be to a wide scope.

Note: I'm not sure if JRE libraries should be part of this "widest scope" or not.  So maybe it's not *quite* "widest" scope, but it's pretty close.
Comment 1 Martin Aeschlimann CLA 2008-03-03 06:56:52 EST
The Java search page always remembers the last used scope. So unless you changed it from 'Workspace' (which is the widest scope), you will always use 'Workspace'.

Is that what you mean?

This is the same in file search.
Comment 2 Ducky Sherwood CLA 2008-03-03 14:05:57 EST
Sorry, I'm using "scope" in the broad English-language sense, not the narrow CS meaning of "scope".

Yes, it does stay at Workspace for the (CS) scope.  But the search is also restricted by default to one of the types (in the English sense, not the CS sense, small T) of Java elements: Types, methods, fields, etc.  It is also restricted to one of the Declarations/References by default, while I think it should default to All Occurrences.

I also think that it shouldn't default to what you last used.  I think people don't remember what they last used.

I do think it would be entirely appropriate to have a prefs option of what you want checked when the search box comes up; "use what I used last time" is a perfectly reasonable option for the prefs. 
Comment 3 Martin Aeschlimann CLA 2008-03-04 04:53:38 EST
We currently can't search for all element types, say for methods, fields, types of a given name at the same type.

Moving to JDT Core.
Comment 4 Frederic Fusier CLA 2008-03-06 12:40:01 EST
(In reply to comment #3)
> We currently can't search for all element types, say for methods, fields, types
> of a given name at the same type.
> 
> Moving to JDT Core.
> 
This is not true, you can do it using an "Or" SearchPattern. I just released a test in JavaSearchBugTests doing this kind of multiple search in one call:
org.eclipse.jdt.core.tests.model.JavaSearchBugTests.testBug221081()

So, move back to JDT/UI to decide whether this may be surfaced...
Comment 5 Martin Aeschlimann CLA 2008-03-07 04:23:20 EST
Thanks for the information, Frederic. I wasn't aware of that.

So the request would be to replace the radio's in 'Search For' with check boxes.
Comment 6 Frederic Fusier CLA 2008-03-07 04:27:06 EST
(In reply to comment #5)
> Thanks for the information, Frederic. I wasn't aware of that.
> 
> So the request would be to replace the radio's in 'Search For' with check
> boxes.
> 
Yes. And when multiple boxes are checked, create an OrPattern...

Comment 7 Ducky Sherwood CLA 2008-07-24 21:25:31 EDT
It would also be nice if 
   the radio buttons for References/Declarations/Implementors/Occurrences 
were changed to 
   checkboxes for References/Declarations/Implementors

and the radio buttons for
   Read Access/Write Access
be changed to check boxes

Basically, let the users get as many results as possible on the first try so that they don't get false negatives.  False negatives are baaaaaad.

If the user gets too many results, then they can start unchecking boxes on their second try.
Comment 8 Markus Keller CLA 2008-07-28 13:38:10 EDT
The nice thing about the radios is that you can change the option with a single click. If we changed the "Search For" and "Limit To" groups to use checkboxes, I think the 90% case would be that the user unchecks the old options and then checks the new one(s). Doubling the amount of clicks is also baaaaaad ;-)

How about just adding a radio "All elements" or "Identifier" in the "Search For" group?