Iterable<PsiReference> (PsiElement element, SearchScope scope) { return new ArrayIterable<>(ReferencesSearch.search(element, scope, true).toArray(PsiReference.EMPTY_ARRAY)); /* try { Class<?> searchClass = Class.forName("com.intellij.psi.search.searches.ReferencesSearch"); final Method[] methods = searchClass.getMethods(); for (Method method : methods) { if ("search".equals(method.getName()) &&) { return (Iterable<PsiReference>) method.invoke(null, element, scope, true); } } return null; } catch (ClassNotFoundException ignore) { return null; } catch (IllegalAccessException ignore) { return null; } catch (InvocationTargetException ignore) { return null; } return ReferencesSearch.search(element, scope, true).findAll(); */ }