Find Usages doesn't work
Hi,
i've installed the latest Idea build#7584.
I have imported some Eclipse projects in one Idea project like separated modules.
When i try "Find Usages" for some API method from one module it doesn't find any usage in another modules. The scope i selected is "Projject" so i expect that it should check all sources into the whole module and find usages (as old Idea 6.x works).
When i put a module dependency it started to work. But i think that this is undesired behavior ?
Regards
Boby
Please sign in to leave a comment.
Hello bobybc,
No, this behavior is correct. The module dependency lets IDEA know that it's
the same class, not an unrelated class with the same name.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
But i'm talking about seraching usages of method not class.
And the scope was set to whole project, so i think in this case it should be able to find method usages in other modules too, wihtout reference ?
Hello bobybc,
So the dependencies are necessary to make sure that you're referencing the
same method, not a method with the same name in an unrelated class with the
same name.
No. Find Usages actually finds all the places where the element is referenced.
Without a module dependency, there is no valid reference between the places.
I don't quite understand why it's a problem for you to specify correct module
dependencies. Mostly every IDEA feature, not only Find Usages, works correctly
only if you have specified the dependencies.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
OK.
i accept your point.
But it was my understanding that if you choice scope "project", it should check the whole project, regardless dependencies.
10x for clarification :)
imagine a case where 2 different IDEA modules define a method/class with the same name
(say 2 different implementations).
The way IDEA uses module dependencies to find your method usages, makes it more probable that you will find all and only the methods that actually use it, not just any where in the code that happen to call a method with the same signature.