Bug 78387 - [search] Missing API to specify scope in search engine
Summary: [search] Missing API to specify scope in search engine
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-11 09:40 EST by Tobias Widmer CLA
Modified: 2005-04-29 07:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.