Creating Searchers

Hi,
i want to create my own specific searchers
in addition to the existing ones (i.e. AllOverridingMethodsSearch)

i tried to understand how it works but it seems alot happens behind the scenes
where do the executers for those searchers come from ?

and anyway, if you can give me some guidelines on how to implement my own searchers i'll be happy

thanks in advance

4 comments

Hello Aviram,

i want to create my own specific searchers
in addition to the existing ones (i.e. AllOverridingMethodsSearch)
i tried to understand how it works but it seems alot happens behind
the scenes where do the executers for those searchers come from ?

and anyway, if you can give me some guidelines on how to implement my
own searchers i'll be happy


To provide an additional searcher for an existing query type, you'll need
to implement the QueryExecutor interface, for example (for AllOverridingMethodsSearch):

class MySearcher implements QueryExecutor, AllOverridingMethodsSearch.SearchParameters> Then you'll need to register your implementation through an extension point in plugin.xml: ]]>

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

i ment something more like creating a new search
for example CallingMethodsSearch for finding all the methods calling a specified method

as i understand from your answer is that i need to create an executer and add an extension point to an existing searcher (perhaps ReferencesSearch) ?

and how does it change the behavior of the ReferenceSearch for other users ? will it allways use my extension ?

0

Hello Aviram,

i ment something more like creating a new search
for example CallingMethodsSearch for finding all the methods calling a
specified method


The easiest way to achieve this is to write a simple Java method. The searchers
infrastructure is useful when the query executors need to be pluggable. If
you need to search for something in your plugin, it's very unlikely that
some other plugins would want to extend your search feature.

Of course, the implementation of your method could be based on an existing
searcher (ReferencesSearch in this case).

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.