json doc support same name | json 注释支持同名

This commit is contained in:
林万程
2022-03-09 23:01:27 +08:00
parent bf1463a3f8
commit c86878eb24
4 changed files with 15 additions and 25 deletions

View File

@@ -46,13 +46,17 @@ public class JsonDocUtils {
continue;
}
if (level == 0) {
return DocUtils.srcOrByteCodeDoc(psiField);
}
String classFullName = toClassFullName(psiField);
PsiClass[] classes = PsiClassUtils.fullNameToClass(classFullName, project);
PsiDocComment docComment = doc(classes, project, jsonPath, level - 1);
if (docComment != null) {
return docComment;
PsiDocComment docComment = DocUtils.srcOrByteCodeDoc(psiField);
if (docComment != null) {
return docComment;
}
} else {
String classFullName = toClassFullName(psiField);
PsiClass[] classes = PsiClassUtils.fullNameToClass(classFullName, project);
PsiDocComment docComment = doc(classes, project, jsonPath, level - 1);
if (docComment != null) {
return docComment;
}
}
}
return null;