Skip to content

Commit 06fac55

Browse files
authored
Repeating SourceFolder fix (#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 c9c2a0b commit 06fac55

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)