Skip to content

Commit 65b34da

Browse files
committed
Obtain version comment from utils class, not file
1 parent abda14d commit 65b34da

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/CodeGenerationController.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,12 @@ object CodeGenerationController {
346346
*/
347347
private val PsiFile.utilClassVersionOrNull: String?
348348
get() = runReadAction {
349-
childrenOfType<PsiComment>()
349+
val utilClass = (this as? PsiClassOwner)
350+
?.classes
351+
?.firstOrNull()
352+
?: return@runReadAction null
353+
354+
utilClass.childrenOfType<PsiComment>()
350355
.map { comment -> comment.text }
351356
.firstOrNull { text -> UTBOT_VERSION_PREFIX in text }
352357
?.substringAfterLast(UTBOT_VERSION_PREFIX)

0 commit comments

Comments
 (0)