use of com.perl5.lang.pod.parser.psi.stubs.PodSectionStub in project Perl5-IDEA by Camelcade.
the class PodStubBasedSectionMixin method getTitleText.
@Override
@Nullable
public String getTitleText() {
PodSectionStub stub = getStub();
if (stub != null) {
return stub.getTitleText();
}
StringBuilder builder = new StringBuilder();
renderElementTitleAsText(builder, new PodRenderingContext());
return builder.toString();
}
use of com.perl5.lang.pod.parser.psi.stubs.PodSectionStub in project Perl5-IDEA by Camelcade.
the class PodFormatterX method getIndexTarget.
/**
* @return a real target of this index. Outer item, heading or file.
*/
@Nullable
public PsiElement getIndexTarget() {
PodSectionStub stub = getStub();
if (stub != null) {
StubElement<?> parentStub = stub.getParentStub();
return parentStub == null ? null : parentStub.getPsi();
}
PsiElement parent = getParent();
if (parent instanceof PodSectionTitle || parent instanceof PodSectionContent) {
return parent.getParent();
}
return parent;
}
use of com.perl5.lang.pod.parser.psi.stubs.PodSectionStub in project Perl5-IDEA by Camelcade.
the class PodSectionItem method getPresentableText.
@Override
@Nullable
public String getPresentableText() {
PodSectionStub greenStub = getGreenStub();
if (greenStub != null) {
String content = greenStub.getContent();
return content.isEmpty() ? "" : content.substring(1);
}
if (isTargetable()) {
return super.getPresentableText();
}
PsiElement contentBlock = getContentBlock();
if (contentBlock == null) {
return null;
}
return PodLinkCompletionProvider.trimItemText(PodRenderUtil.renderPsiElementAsText(contentBlock));
}
Aggregations