Skip to content

Commit 7118875

Browse files
DomonionAbdullinAM
authored andcommittedOct 17, 2022
Repeating SourceFolder fix (UnitTestBot#1073)
In case of repeating SourceFolders action would not be shown. From now it takes first SourceFolder with the same virtual file source root
1 parent bbb082c commit 7118875

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/actions/GenerateTestsAction.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class GenerateTestsAction : AnAction(), UpdateInBackground {
6161
val module = ModuleUtil.findModuleForFile(srcSourceRoot, project) ?: return null
6262
val matchingRoot = ModuleRootManager.getInstance(module).contentEntries
6363
.flatMap { entry -> entry.sourceFolders.toList() }
64-
.singleOrNull { folder -> folder.file == srcSourceRoot }
64+
.firstOrNull { folder -> folder.file == srcSourceRoot }
6565
if (srcMembers.isEmpty() || matchingRoot == null || matchingRoot.rootType.isForTests) {
6666
return null
6767
}

0 commit comments

Comments
 (0)
Please sign in to comment.