PsiSearchHelper.findReferences() - alternatives

We are using the findReferences method with following paramters:

final PsiVariable variable = ...
final PsiReference[] references = manager.getSearchHelper().findReferences(variable, variable.getUseScope(), false);

The method call is marked deprecated. What is the best alternative?

Tom

6 comments

Hello Thomas,

We are using the findReferences method with following paramters:

final PsiVariable variable = ...
final PsiReference[] references =
manager.getSearchHelper().findReferences(variable,
variable.getUseScope(), false);
The method call is marked deprecated. What is the best alternative?


ReferencesSearch.search(variable, variable.getUseScope(), false)

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


0

ReferencesSearch.search(variable). This actually returns a Query]]> rather than a PsiReference[], which makes the search lazy and gives you a whole bunch of handy iteration options.

--Dave Griffith

0

ReferencesSearch.search(variable). This actually
returns a Query<PsiReference> rather than a
PsiReference[], which makes the search lazy and gives
you a whole bunch of handy iteration options.


Which in turn will be deprecated when closures are added to Java:)

0

Which in turn will be deprecated when closures are
added to Java:)


You surely mean "when closures ar added to IDEA"?

0

Closures are available in IDEA, but sadly only for Scala, Ruby, and JavaScript.

--Dave Griffith

0

Please sign in to leave a comment.