use of com.intellij.coldFusion.model.psi.CfmlCompositeElement in project intellij-plugins by JetBrains.
the class CfmlFoldingBuilder method buildFoldRegions.
@NotNull
public FoldingDescriptor[] buildFoldRegions(@NotNull ASTNode node, @NotNull Document document) {
final PsiElement element = node.getPsi();
if (element instanceof CfmlFile) {
final CfmlFile file = (CfmlFile) element;
final PsiElement[] children = file.getChildren();
Collection<FoldingDescriptor> result = new LinkedList<>();
for (PsiElement child : children) {
if (child != null && (child instanceof CfmlCompositeElement || child instanceof PsiComment)) {
List<FoldingDescriptor> descriptors = new ArrayList<>();
addFoldingDescriptors(descriptors, child, document);
result.addAll(descriptors);
}
}
return result.toArray(FoldingDescriptor.EMPTY);
}
return FoldingDescriptor.EMPTY;
}
Aggregations