public static void addHtmlSpecificCompletions(final XmlElementDescriptor descriptor,
                                                final XmlTag element,
                                                final List<? super XmlElementDescriptor> variants) {
    // add html block completions for tags with optional ends!
    String name = descriptor.getName(element);

    if (name != null && isTagWithOptionalEnd(name, false)) {
      PsiElement parent = element.getParent();

      if (parent instanceof XmlTag && XmlChildRole.CLOSING_TAG_START_FINDER.findChild(parent.getNode()) != null) {
        return;
      }

      if (parent != null) {
        // we need grand parent since completion already uses parent's descriptor
        parent = parent.getParent();
      }

      if (parent instanceof HtmlTag) {
        final XmlElementDescriptor parentDescriptor = ((HtmlTag)parent).getDescriptor();

        if (parentDescriptor != descriptor && parentDescriptor != null) {
          for (final XmlElementDescriptor elementsDescriptor : parentDescriptor.getElementsDescriptors((XmlTag)parent)) {
            if (isHtmlBlockTag(elementsDescriptor.getName(), false)) {
              variants.add(elementsDescriptor);
            }
          }
        }
      }
      else if (parent instanceof HtmlDocumentImpl) {
        final XmlNSDescriptor nsDescriptor = descriptor.getNSDescriptor();
        if (nsDescriptor != null) {
          for (XmlElementDescriptor elementDescriptor : nsDescriptor.getRootElementsDescriptors((XmlDocument)parent)) {
            if (isHtmlBlockTag(elementDescriptor.getName(), false) && !variants.contains(elementDescriptor)) {
              variants.add(elementDescriptor);
            }
          }
        }
      }
    }
  }
public static void addHtmlSpecificCompletions(final XmlElementDescriptor descriptor,
                                                final XmlTag element,
                                                final List<? super XmlElementDescriptor> variants)