PsiElement (@Nullable PsiElement e, @NotNull Set<IElementType> types, boolean strict) { if (!strict && e != null && is(e.getNode(), types)) { return e; } if (e == null) { return null; } return toPsi(getParentOfType(e.getNode(), ParentAwareTokenSet.create(types))); }