Skip to content

Commit

Permalink
fix: check type before casting to PsiDocCommentOwner during hover
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Aug 10, 2023
1 parent afe404b commit 3c0f21f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@

public class JavadocContentAccess {
private static Reader getHTMLContentReader(PsiMember member, boolean allowInherited, boolean useAttachedJavadoc) {
PsiDocComment doc = ((PsiDocCommentOwner) member).getDocComment();
PsiDocComment doc = null;
PsiElement sourceMember = member.getNavigationElement();
if (sourceMember instanceof PsiDocCommentOwner) {
doc = ((PsiDocCommentOwner) sourceMember).getDocComment();
}
if (doc == null) {
if (member instanceof PsiDocCommentOwner) {
doc = ((PsiDocCommentOwner) member).getDocComment();
}
}
return doc == null ? null : new JavaDocCommentReader(doc.getText());
}

Expand Down

0 comments on commit 3c0f21f

Please sign in to comment.