Skip to content

getNonStrictParentOfType

fun <T : PsiElement> PsiElement.getNonStrictParentOfType(parentClass: Class<T>): T?

Returns the nearest ancestor of type T (including this element), or null if there is none.

inline fun <reified T : PsiElement> PsiElement.getNonStrictParentOfType(): T?

Returns the nearest ancestor of type T including this element, or null if there is none.