@Override
  public final FoldingDescriptor @NotNull [] buildFoldRegions(@NotNull PsiElement root, @NotNull Document document, boolean quick) {
    ourCustomRegionElements.set(new HashSet<>());
    List<FoldingDescriptor> descriptors = new ArrayList<>();
    try {
      if (!CustomFoldingProvider.getAllProviders().isEmpty()) {
        myDefaultProvider = null;
        ASTNode rootNode = root.getNode();
        if (rootNode != null) {
          addCustomFoldingRegionsRecursively(new FoldingStack(), rootNode, descriptors, 0);
        }
      }
      buildLanguageFoldRegions(descriptors, root, document, quick);
    }
    finally {
      ourCustomRegionElements.set(null);
    }
    return descriptors.toArray(FoldingDescriptor.EMPTY_ARRAY);
  }
@Override
  public final FoldingDescriptor @NotNull [] buildFoldRegions(@NotNull PsiElement root, @NotNull Document document, boolean quick)