Bug 78387

Summary: [search] Missing API to specify scope in search engine
Product: [Eclipse Project] JDT Reporter: Tobias Widmer <tobias_widmer>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: All   
Whiteboard:

Description Tobias Widmer CLA 2004-11-11 09:40:17 EST
Currently, there is no way to pass a search scope to the following methods in 
SearchEngine:

- searchDeclarationsOfAccessedFields
- searchDeclarationsOfReferencedTypes
- searchDeclarationsOfSentMessages

In order to handle visibility issues during refactoring, we must search for 
all referenced members, but are not interested in occurrences in system 
libraries.

We must be able to either provide an include mask or the search scope itself.
Comment 1 Frederic Fusier CLA 2005-01-20 06:08:54 EST
Tobias,
I guess that IJavaSearchScope would replace IJavaElement...
Then I would add following methods to SearchEngine:
searchDeclarationsOfAccessedFields(IJavaSearchScope,SearchRequestor,IProgressMonitor)
searchDeclarationsOfReferencedTypesIJavaSearchScope,SearchRequestor,IProgressMonitor)
searchDeclarationsOfSentMessages(IJavaSearchScope,SearchRequestor,IProgressMonitor)
Is it correct?
Comment 2 Tobias Widmer CLA 2005-01-20 06:23:01 EST
Yes, that's correct. The search scope could then be created on the one java 
element with an appropriate include mask.
Comment 3 Frederic Fusier CLA 2005-01-21 11:28:44 EST
In fact it is not really possible to use either IJavaSearchScope or include mask
to address this requirement... 

IJavaSearchScope is applied only while filtering index documents.
Reported matches are declarations which are found during matches locating done
after having got index files... When search engine finally gets declaration
matches, it has no way to use java search scope to filter them.

The possible solution would have been to call these methods with an additional
boolean not to report binary matches. But this can be done by SearchRequestor
while accepting match and then no additional API methods are really necessary.

Agreed with Tobias to close this bug as WONTFIX.