use of com.perl5.lang.pod.psi.PsiPodSection in project Perl5-IDEA by Camelcade.
the class PodStructureViewElement method getChildren.
@NotNull
@Override
public TreeElement[] getChildren() {
List<PodStructureViewElement> result = new ArrayList<>();
PsiElement container = null;
if (myElement instanceof PodSection) {
container = ((PodSection) myElement).getContentBlock();
}
if (container == null) {
container = myElement;
}
for (PsiElement element : container.getChildren()) {
if (element instanceof PodStructureElement) {
if (!(element instanceof PsiCutSection || element instanceof PsiPodSection)) {
result.add(new PodStructureViewElement(element));
}
}
}
if (result.size() == 1 && result.get(0).getValue() instanceof PodSectionOver) {
// expanding over
return result.get(0).getChildren();
}
return result.toArray(new TreeElement[result.size()]);
}
Aggregations