use of org.intellij.plugins.markdown.lang.psi.impl.MarkdownFile in project intellij-plugins by JetBrains.
the class MarkdownStructureElement method getChildrenBase.
@NotNull
@Override
public Collection<StructureViewTreeElement> getChildrenBase() {
final List<StructureViewTreeElement> childrenElements = new ArrayList<>();
final PsiElement myElement = getElement();
if (myElement == null)
return childrenElements;
final PsiElement structureContainer = myElement instanceof MarkdownFile ? myElement.getFirstChild() : getParentOfType(myElement, TRANSPARENT_CONTAINERS);
if (structureContainer == null) {
return Collections.emptyList();
}
final MarkdownPsiElement currentHeader = myElement instanceof MarkdownHeaderImpl ? ((MarkdownHeaderImpl) myElement) : null;
processContainer(structureContainer, currentHeader, currentHeader, element -> childrenElements.add(new MarkdownStructureElement(element)));
return childrenElements;
}
Aggregations