@Contract("null, _, _, _ -> null")
  public static @Nullable PsiElement getParentOfType(@Nullable PsiElement element,
                                                     @NotNull IElementType target,
                                                     boolean strict,
                                                     @Nullable ParentAwareTokenSet stopAt) {
    if (element == null) return null;
    if (strict) {
      if (element instanceof PsiFile) return null;
      element = element.getParent();
    }

    while (element != null && !is(element.getNode(), target)) {
      if (stopAt != null && is(element.getNode(), stopAt)) return null;
      if (element instanceof PsiFile) return null;
      element = element.getParent();
    }

    return element;
  }
@Contract("null, _, _, _ -> null")
  public static @Nullable PsiElement getParentOfType(@Nullable PsiElement element,
                                                     @NotNull IElementType target,
                                                     boolean strict,
                                                     @Nullable ParentAwareTokenSet stopAt)