use of com.jetbrains.python.documentation.PyDocumentationBuilder in project intellij-community by JetBrains.
the class PydevDocumentationProvider method createDoc.
@Nullable
public static String createDoc(final PsiElement element, final PsiElement originalElement) {
final PyReferenceExpression expression = PsiTreeUtil.getNonStrictParentOfType(originalElement, PyReferenceExpression.class);
// Indicates that we are inside console, not a lookup element!
if (expression == null) {
return null;
}
PydevConsoleReference consoleRef = PyUtil.as(expression.getReference(), PydevConsoleReference.class);
if (consoleRef == null) {
//shouldn't really happen!
return null;
}
PyElement documentationElement = consoleRef.getDocumentationElement();
if (documentationElement == null) {
return null;
}
return new PyDocumentationBuilder(documentationElement, null).build();
}
Aggregations