use of org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GroovyDocPsiElement in project intellij-community by JetBrains.
the class GrDocCommentUtil method findDocOwner.
@Nullable
public static GrDocCommentOwner findDocOwner(GroovyDocPsiElement docElement) {
PsiElement element = docElement;
while (element != null && element.getParent() instanceof GroovyDocPsiElement) element = element.getParent();
if (element == null)
return null;
element = skipWhiteSpacesAndStopOnDoc(element, true);
if (element instanceof GrDocCommentOwner)
return (GrDocCommentOwner) element;
if (element instanceof GrMembersDeclaration) {
GrMember[] members = ((GrMembersDeclaration) element).getMembers();
if (members.length > 0 && members[0] instanceof GrDocCommentOwner) {
return (GrDocCommentOwner) members[0];
}
}
return null;
}
Aggregations