public static @Nullable <T extends PsiElement> T findParentOfTypeWithStopElements(PsiFile file,
                                                                                    int offset,
                                                                                    Class<T> parentClass,
                                                                                    Class<? extends PsiElement> @NotNull ... stopAt) {
    PsiElement element = file.findElementAt(offset);
    if (element == null) return null;

    T parentOfType = PsiTreeUtil.getParentOfType(element, parentClass, true, stopAt);
    if (element instanceof PsiWhiteSpace) {
      parentOfType = PsiTreeUtil.getParentOfType(PsiTreeUtil.prevLeaf(element), parentClass, true, stopAt);
    }
    return parentOfType;
  }
public static @Nullable <T extends PsiElement> T findParentOfTypeWithStopElements(PsiFile file,
                                                                                    int offset,
                                                                                    Class<T> parentClass,
                                                                                    Class<? extends PsiElement> @NotNull ... stopAt)