public static boolean isCommitMessage(@NotNull PsiElement element) {
    Document document = PsiDocumentManager.getInstance(element.getProject()).getDocument(element.getContainingFile());
    return document != null && isCommitMessage(document);
  }
public static boolean isCommitMessage(@NotNull PsiElement element)