Search in sources :

Example 1 with DelegatePsiTarget

use of com.intellij.psi.DelegatePsiTarget in project intellij-community by JetBrains.

the class DomDocumentationProvider method generateDoc.

@Override
public String generateDoc(PsiElement element, final PsiElement originalElement) {
    if (element instanceof PomTargetPsiElement) {
        PomTarget target = ((PomTargetPsiElement) element).getTarget();
        if (target instanceof DelegatePsiTarget) {
            element = ((DelegatePsiTarget) target).getNavigationElement();
        }
    }
    final DomElement domElement = DomUtil.getDomElement(element);
    if (domElement == null) {
        return null;
    }
    ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate();
    if (template != null) {
        String documentation = template.createPresentation(domElement).getDocumentation();
        if (documentation != null)
            return documentation;
    }
    return ElementPresentationManager.getDocumentationForElement(domElement);
}
Also used : PomTarget(com.intellij.pom.PomTarget) DelegatePsiTarget(com.intellij.psi.DelegatePsiTarget) PomTargetPsiElement(com.intellij.pom.PomTargetPsiElement)

Aggregations

PomTarget (com.intellij.pom.PomTarget)1 PomTargetPsiElement (com.intellij.pom.PomTargetPsiElement)1 DelegatePsiTarget (com.intellij.psi.DelegatePsiTarget)1