private static void registerProblem(XmlTag tag, ProblemsHolder holder) {
    if (InjectedLanguageManager.getInstance(tag.getProject()).getInjectionHost(tag) != null) return;
    List<LocalQuickFix> fixes = new ArrayList<>();

    Pair<PsiElement, PsiElement> pair = getNearestText(tag, new ForwardIterator());
    if (pair != null) {
      fixes.add(new CreateLabelFromTextAction("html.inspections.create.label.from.text.after.action", false, tag.getName()));
    }
    pair = getNearestText(tag, new BackwardIterator());
    if (pair != null) {
      fixes.add(new CreateLabelFromTextAction("html.inspections.create.label.from.text.before.action", true, tag.getName()));
    }
    fixes.add(new CreateNewLabelAction(tag.getName()));
    PsiElement toRegister = XmlTagUtil.getStartTagNameElement(tag);
    assert toRegister != null;

    InspectionManager manager = holder.getManager();
    ProblemDescriptor descriptor = manager
      .createProblemDescriptor(toRegister, toRegister, HtmlToolsBundle.message("html.inspections.form.input.without.label"),
                               ProblemHighlightType.GENERIC_ERROR_OR_WARNING, holder.isOnTheFly(),
                               fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
    holder.registerProblem(descriptor);
  }
private static void registerProblem(XmlTag tag, ProblemsHolder holder)