Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] a new kind of Search Plugin

Hello,

I am writing a plug-in which is very similar to the
Java search plugin. One difference is that I want to
search for multiple Java elements at once. Another
difference is that I want to be able to show results
grouped by the Java element which generated the
matches. 

Initially I had a very rapid progress. I contributed
my own search page and search result page and I can
type in multiple elements in the search text field and
all the results will be displayed in the result page.
For instance I can search in a single shot for all
reference to two methods foo() and bar(). I don't do
multiple searches for the sake of efficiency but I am
passing an OrPattern to the SearchEngine. Now I've got
stuck since I could not find a way to learn from the
SearchResult's matches what is the exact Java element 
which generated the match (e.g. which matches where
caused by foo and which ones by bar). Apparently there
is no need for such a relationship if you only search
for one single Java element; for instance in the Java
search plugin you can get this information from the
ISearchQuery object associated with the
JavaSearchResult object. 

As it is now, I could not find any easy way to do my
trick. I'll have to decorate either the match object
with some info pertaining to the Java element which
generated the match. Or I thought I can run instead a
suite of simple searches (one for foo() and one for
bar()). 

Am I missing something here? Any help from the Eclipse
saga developers would be welcome.

thanks,
Danny Dig




Back to the top