private static void checkSnippetTag(@NotNull ProblemsHolder holder, PsiElement element, PsiInlineDocTag tag) {
    if (element instanceof PsiSnippetDocTag snippet) {
      PsiElement nameElement = tag.getNameElement();
      if (!PsiUtil.isAvailable(JavaFeature.JAVADOC_SNIPPETS, snippet)) {
        if (nameElement != null) {
          String message = JavaBundle.message("inspection.javadoc.problem.snippet.tag.is.not.available");
          holder.registerProblem(nameElement, message, new IncreaseLanguageLevelFix(JavaFeature.JAVADOC_SNIPPETS.getMinimumLevel()));
        }
        return;
      }
      PsiSnippetDocTagValue valueElement = snippet.getValueElement();
      if (valueElement != null && nameElement != null) {
        PsiSnippetDocTagBody body = valueElement.getBody();
        if (body != null) {
          SnippetMarkup markup = SnippetMarkup.fromElement(body);
          markup.visitSnippet(null, new SnippetMarkup.SnippetVisitor() {
            @Override
            public void visitError(SnippetMarkup.@NotNull ErrorMarkup errorMarkup) {
              holder.registerProblem(body, errorMarkup.range(), errorMarkup.message());
            }
          });
          SnippetMarkup externalMarkup = SnippetMarkup.fromExternalSnippet(valueElement);
          if (externalMarkup != null) {
            PsiSnippetAttribute regionAttr = valueElement.getAttributeList().getAttribute("region");
            String region = regionAttr != null && regionAttr.getValue() != null ? regionAttr.getValue().getValue() : null;
            String externalRendered = renderText(externalMarkup, region);
            String inlineRegion = region != null && markup.getRegionStart(region) == null ? null : region;
            String inlineRendered = renderText(markup, inlineRegion);
            if (!externalRendered.equals(inlineRendered)) {
              holder.problem(nameElement, JavaBundle.message("inspection.message.external.snippet.differs.from.inline.snippet"))
                .fix(new SynchronizeInlineMarkupFix(externalRendered))
                .fix(new DeleteElementFix(body))
                .register();
            }
          }
        }
      }
    }
  }
private static void checkSnippetTag(@NotNull ProblemsHolder holder, PsiElement element, PsiInlineDocTag tag)