Field Class Doc In Tree | 导航树上显示字段类注释

This commit is contained in:
林万程
2022-05-31 01:17:04 +08:00
parent 900f59b601
commit 6476dd5edd

View File

@@ -90,7 +90,15 @@ public class Tree implements ProjectViewNodeDecorator {
if (node instanceof PsiFieldNode) {
// On Show Members
PsiField psiField = ((PsiFieldNode) node).getValue();
return OwnerToPsiDocUtils.srcOrByteCodeDoc(psiField);
PsiDocComment docComment = OwnerToPsiDocUtils.srcOrByteCodeDoc(psiField);
if (docComment != null) {
return docComment;
}
PsiClass psiClass = psiField.getContainingClass();
if (psiClass != null) {
return OwnerToPsiDocUtils.srcOrByteCodeDoc(psiClass);
}
return null;
}
if (node instanceof ClassTreeNode) {