private static boolean hasDtdKeywordCompletion(@NotNull PsiElement prev) {
    return prev.textMatches("#") ||
           prev.textMatches("!") ||
           prev.textMatches("(") ||
           prev.textMatches(",") ||
           prev.textMatches("|") ||
           prev.textMatches("[") ||
           prev.getNode().getElementType() == XmlTokenType.XML_NAME;
  }
private static boolean hasDtdKeywordCompletion(@NotNull PsiElement prev)