public static boolean isWithinTag(Lookup lookup) {
    if (isInXmlContext(lookup)) {
      PsiElement psiElement = lookup.getPsiElement();
      final PsiElement parentElement = psiElement != null ? psiElement.getParent() : null;
      if (parentElement instanceof XmlTag) return true;
      if (parentElement instanceof PsiErrorElement && parentElement.getParent() instanceof XmlDocument) return true;

      return (parentElement instanceof XmlDocument || parentElement instanceof XmlText) &&
             (psiElement.textMatches("<") || psiElement.textMatches("\""));
    }
    return false;
  }
public static boolean isWithinTag(Lookup lookup)