private static boolean processIndexEntries(@NotNull Project project,
                                             @NotNull String key,
                                             GlobalSearchScope scope,
                                             EnumSet<RegistrationType> types,
                                             Processor<XmlTag> processor) {
    return FileBasedIndex.getInstance().processValues(NAME, key, null, (file, value) -> {
      for (RegistrationEntry entry : value) {
        if (!types.contains(entry.getRegistrationType())) {
          continue;
        }

        final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
        if (!(psiFile instanceof XmlFile)) continue;

        XmlTag xmlTag = AstLoadingFilter.forceAllowTreeLoading(psiFile, () -> {
          PsiElement psiElement = psiFile.findElementAt(entry.getOffset());
          return PsiTreeUtil.getParentOfType(psiElement, XmlTag.class, false);
        });
        if (!processor.process(xmlTag)) return false;
      }
      return true;
    }, scope);
  }
private static boolean processIndexEntries(@NotNull Project project,
                                             @NotNull String key,
                                             GlobalSearchScope scope,
                                             EnumSet<RegistrationType> types,
                                             Processor<XmlTag> processor)