File tree 1 file changed +8
-2
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,20 @@ class UtDocumentationProvider : JavaDocumentationProvider() {
37
37
docComment : PsiDocComment ,
38
38
comment : PsiDocCommentBase
39
39
): String? {
40
- // add UTBot sections with custom tags.
41
40
val utJavaDocInfoGenerator = UtJavaDocInfoGenerator ()
42
- return if (baseJavaDocInfo != null && baseJavaDocInfo.contains(" utbot" )) {
41
+ // case 1 (2022.2): IDE successfully parsed comment with plugin's custom tags,
42
+ // and we only need to replace tags names with their messages.
43
+ return if (baseJavaDocInfo != null && baseJavaDocInfo.contains(" @utbot" )) {
44
+ val finalJavaDoc = replaceTagNamesWithMessages(baseJavaDocInfo)
45
+ JavaDocExternalFilter .filterInternalDocInfo(finalJavaDoc)
46
+ // case 2 (2022.1 and older): IDE failed to parse plugin's tags, and we need to add them on our own.
47
+ } else if (baseJavaDocInfo != null && comment.text.contains(" @utbot" )) {
43
48
val javaDocInfoWithUtSections =
44
49
utJavaDocInfoGenerator.addUtBotSpecificSectionsToJavaDoc(docComment)
45
50
val finalJavaDoc = replaceTagNamesWithMessages(javaDocInfoWithUtSections)
46
51
JavaDocExternalFilter .filterInternalDocInfo(finalJavaDoc)
47
52
} else {
53
+ // case 3: comment doesn't contain plugin's tags, so IDE can parse it on its own.
48
54
super .generateRenderedDoc(comment)
49
55
}
50
56
}
You can’t perform that action at this time.
0 commit comments