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

@@ -6,21 +6,14 @@ English Notes:
<li>Show javadoc comments at the Project view Tree structure.
<li>Show javadoc comments at the end-of-line.
<li>Show javadoc comments at "xx ClassNameOrSimpleName.json".
<li>One of the above features can be turned off in<br>
settings -> Tools -> Show Comment Global
<li>Font color of end-of-line comments can be modified in <br>
settings -> Tools -> Show Comment Global
<li>Class name prefix filter of end-of-line comment can be modified in<br>
settings -> Tools -> Show Comment Project
<li>Config: settings -> Tools -> Show Comment Global/Project
</ul>
Chinese Notes:
<ul>
<li>在结构树显示 文档注释。
<li>在行末尾显示 文档注释。
<li>支持 "xx 类全名或简名.json"。
<li>可以在设置中 关闭 上面其中一个功能。
<li>可以在设置中 修改 行末注释 的字体颜色。
<li>可以在设置中 修改 行末注释 的类名前缀过滤。
<li>修改配置:设置 -> 工具 -> Show Comment Global/Project
</ul>
English Change Notes:

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;

View File

@@ -9,21 +9,14 @@ English Notes:
<li>Show javadoc comments at the Project view Tree structure.
<li>Show javadoc comments at the end-of-line.
<li>Show javadoc comments at "xx ClassNameOrSimpleName.json".
<li>One of the above features can be turned off in<br>
settings -> Tools -> Show Comment Global
<li>Font color of end-of-line comments can be modified in <br>
settings -> Tools -> Show Comment Global
<li>Class name prefix filter of end-of-line comment can be modified in<br>
settings -> Tools -> Show Comment Project
<li>Config: settings -> Tools -> Show Comment Global/Project
</ul>
Chinese Notes:
<ul>
<li>在结构树显示 文档注释。
<li>在行末尾显示 文档注释。
<li>支持 "xx 类全名或简名.json"。
<li>可以在设置中 关闭 上面其中一个功能。
<li>可以在设置中 修改 行末注释 的字体颜色。
<li>可以在设置中 修改 行末注释 的类名前缀过滤。
<li>修改配置:设置 -> 工具 -> Show Comment Global/Project
</ul>
]]></description>