Skip to content

Commit e8d8875

Browse files
committed
Obtain version comment from utils class, not file
1 parent 904f50c commit e8d8875

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
@@ -338,7 +338,12 @@ object CodeGenerationController {
338338
*/
339339
private val PsiFile.utilClassVersionOrNull: String?
340340
get() = runReadAction {
341-
childrenOfType<PsiComment>()
341+
val utilClass = (this as? PsiClassOwner)
342+
?.classes
343+
?.firstOrNull()
344+
?: return@runReadAction null
345+
346+
utilClass.childrenOfType<PsiComment>()
342347
.map { comment -> comment.text }
343348
.firstOrNull { text -> UTBOT_VERSION_PREFIX in text }
344349
?.substringAfterLast(UTBOT_VERSION_PREFIX)

0 commit comments

Comments
 (0)