static FoldingDescriptor @NotNull [] buildFoldingDescriptorsNoPlaceholderCaching(@Nullable FoldingBuilder builder,
                                                                                   @NotNull PsiElement root,
                                                                                   @NotNull Document document,
                                                                                   boolean quick) {
    SlowOperations.assertSlowOperationsAreAllowed();
    try {
      if (builder != null && !DumbService.getInstance(root.getProject()).isUsableInCurrentContext(builder)) {
        return FoldingDescriptor.EMPTY_ARRAY;
      }

      if (builder instanceof FoldingBuilderEx) {
        return ((FoldingBuilderEx)builder).buildFoldRegions(root, document, quick);
      }
      final ASTNode astNode = root.getNode();
      if (astNode == null || builder == null) {
        return FoldingDescriptor.EMPTY_ARRAY;
      }

      return builder.buildFoldRegions(astNode, document);
    }
    catch (ProcessCanceledException e) {
      throw e;
    }
    catch (Exception e) {
      LOG.error(e);
      return FoldingDescriptor.EMPTY_ARRAY;
    }
  }
static FoldingDescriptor @NotNull [] buildFoldingDescriptorsNoPlaceholderCaching(@Nullable FoldingBuilder builder,
                                                                                   @NotNull PsiElement root,
                                                                                   @NotNull Document document,
                                                                                   boolean quick)