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
Please sign in to leave a comment.
Hello Thomas,
ReferencesSearch.search(variable, variable.getUseScope(), false)
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
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
Which in turn will be deprecated when closures are added to Java:)
You surely mean "when closures ar added to IDEA"?
Closures are available in IDEA, but sadly only for Scala, Ruby, and JavaScript.
--Dave Griffith
And Groovy=)