List<PsiElement> (DataContext dataContext, Editor editor) { List<PsiElement> elements = super.getPsiElements(dataContext, editor); if (!elements.isEmpty()) return elements; PsiElement location = ConfigurationContext.getFromContext(dataContext, ActionPlaces.UNKNOWN).getPsiLocation(); if (location == null) return elements; PsiElement parent = location.getParent(); return parent != null ? Collections.singletonList(parent) : elements; }