PsiElement (@NotNull Editor editor, @NotNull PsiFile file, @Nullable PsiElement contextElement, int targetOffset) { PsiDocComment docComment = PsiTreeUtil.getParentOfType(contextElement, PsiDocComment.class, false); if (docComment != null && JavaDocUtil.isInsidePackageInfo(docComment)) { PsiDirectory directory = file.getContainingDirectory(); if (directory != null) { return JavaDirectoryService.getInstance().getPackage(directory); } } return getDocumentedElementOfKeyword(contextElement); }