Search for method references in the current project

15 views
Skip to first unread message

senny

unread,
Oct 28, 2009, 12:57:41 PM10/28/09
to eclim-dev
Hey there

Im desperatly trying to perform a references search on methods. I got
everything working with classes and interfaces but a search for
methods names returns nothing. I'm not sure how I must build a pattern
to match the method "dooSomething()" in the class "TestClass". Is
there a documentation about the pattern syntax I have to use to get
this working?

Thanks a lot.
Regards,
Yves

Eric Van Dewoestine

unread,
Oct 28, 2009, 1:16:36 PM10/28/09
to ecli...@googlegroups.com

Any one of the following should work:

1) search by context: place the cursor on the method declaration name
'dooSomething' in TestClass.java and run (this will return the
declaration and the references)

:JavaSearchContext

2) search by element: place the cursor on the method declaration name
'dooSomething' in TestClass.java, or on any reference to that
method, and run

:JavaSearch -x references

3) search by pattern

:JavaSearch -x references -t method -p TestClass.dooSomething

--
eric

senny

unread,
Oct 29, 2009, 7:25:31 AM10/29/09
to eclim-dev
Thanks a lot Eric. The search did work but I would like to specify the
qualified class name. I tried to use the full class-name as the
pattern (including the package path) but it did not work. Is there a
way to fully qualify the method im looking for?

Regards,
Senny

Eric Van Dewoestine

unread,
Oct 29, 2009, 10:44:35 AM10/29/09
to ecli...@googlegroups.com
On Thu, Oct 29, 2009 at 04:25:31AM -0700, senny wrote:
>
> Thanks a lot Eric. The search did work but I would like to specify the
> qualified class name. I tried to use the full class-name as the
> pattern (including the package path) but it did not work. Is there a
> way to fully qualify the method im looking for?

You should be able to supply the fully qualified class name. Here is
an example against the eclim sources:

:JavaSearch -t method -x references -p org.eclim.Services.getCommand

--
eric

senny

unread,
Oct 29, 2009, 11:17:04 AM10/29/09
to eclim-dev
My bad, i used the wrong pattern format. I just passed in the response
from another eclim search call, which had a "#" sign instead of a "."
indicating the method part. Everything works perfectly now.

Eric Van Dewoestine

unread,
Oct 29, 2009, 11:42:14 AM10/29/09
to ecli...@googlegroups.com
On Thu, Oct 29, 2009 at 08:17:04AM -0700, senny wrote:
>
> My bad, i used the wrong pattern format. I just passed in the response
> from another eclim search call, which had a "#" sign instead of a "."
> indicating the method part. Everything works perfectly now.

Yeah for search results I usually use the javadoc style format which
separates the class and method via a '#' since I find it easier to
quickly differentiate method results from class results.

I assume your the same senny that is working on the emacs client for
eclim[1]? I stumbled on the github project a couple weeks ago, which
was a pleasant surprise. If you run into any road blocks please let
me know. I went back over the mail you've sent and you've requested
some features, which are on my todo list, but if any of those, or any
future requests are impeding your progress, please let me know so I
can prioritize then accordingly.

Just an FYI, I've added a couple links to your github project to the
eclim docs which will go out with the next release of eclim.

[1] http://github.com/senny/emacs-eclim

--
eric

Reply all
Reply to author
Forward
0 new messages