PsiElement[] (DataContext context) { final Ref<List<ImplementationViewElement>> ref = new Ref<>(); new ShowImplementationsAction() { @Override protected void showImplementations(@NotNull ImplementationViewSession session, boolean invokedFromEditor, boolean invokedByShortcut) { ref.set(session.getImplementationElements()); } }.performForContext(context); return ContainerUtil.map2Array(ref.get(), PsiElement.class, (element) -> ((PsiImplementationViewElement) element).getPsiElement()); }