void (@NotNull List<FoldingDescriptor> descriptors, @NotNull Collection<PsiElement> psiElements, @NotNull Document document) { psiElements.forEach(element -> { if (element instanceof ShHeredoc) { PsiElement heredocContent = ((ShHeredoc)element).getHeredocContent(); if (heredocContent == null) return; TextRange textRange = heredocContent.getTextRange(); int lineNumber = document.getLineNumber(textRange.getEndOffset()); int endOffset = document.getLineEndOffset(lineNumber - 1); if (textRange.getStartOffset() >= endOffset) return; descriptors.add(new FoldingDescriptor(element.getNode(), TextRange.create(textRange.getStartOffset(), endOffset), null, getHeredocPlaceholder(heredocContent, document))); } }); }