PsiElement (PsiElement element, EquivalenceDescriptor descriptor, NodeFilter filter) { if (element == null) { return null; } /*if (!canSkip(element) && getOnlyNonWhitespaceChild(element) == null) { return element; }*/ // todo optimize! (this method is often invoked for the same node) if (descriptor == null) { final EquivalenceDescriptorProvider provider = EquivalenceDescriptorProvider.getInstance(element); if (provider != null) { descriptor = provider.buildDescriptor(element); } } if (descriptor != null) { final PsiElement onlyChild = getOnlyChildFromDescriptor(descriptor, filter); return onlyChild != null ? onlyChild : element; } return getOnlyChild(element, filter); }