Community
Participate
Working Groups
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.
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?
Yes, that's correct. The search scope could then be created on the one java element with an appropriate include mask.
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.