File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,20 @@ class UtDocumentationProvider : JavaDocumentationProvider() {
3737 docComment : PsiDocComment ,
3838 comment : PsiDocCommentBase
3939 ): String? {
40- // add UTBot sections with custom tags.
4140 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" )) {
4348 val javaDocInfoWithUtSections =
4449 utJavaDocInfoGenerator.addUtBotSpecificSectionsToJavaDoc(docComment)
4550 val finalJavaDoc = replaceTagNamesWithMessages(javaDocInfoWithUtSections)
4651 JavaDocExternalFilter .filterInternalDocInfo(finalJavaDoc)
4752 } else {
53+ // case 3: comment doesn't contain plugin's tags, so IDE can parse it on its own.
4854 super .generateRenderedDoc(comment)
4955 }
5056 }
You can’t perform that action at this time.
0 commit comments