revert original workspaceDirectories and getWorkspaceDirs

This commit is contained in:
ferenci84 2025-04-01 11:44:46 +02:00
parent a2c86bf555
commit cfee705b60

View file

@ -148,17 +148,11 @@ class IntelliJIDE(
}
override suspend fun getWorkspaceDirs(): List<String> {
val dirs = this.continuePluginService.workspacePaths
if (dirs?.isNotEmpty() == true) {
return dirs
}
return listOfNotNull(project.guessProjectDir()?.toUriOrNull()).toTypedArray()
return workspaceDirectories().toList()
}
override suspend fun getWorkspaceConfigs(): List<ContinueRcJson> {
val workspaceDirs = gitService.workspaceDirectories()
val workspaceDirs = this.getWorkspaceDirs()
val configs = mutableListOf<String>()
@ -407,7 +401,7 @@ class IntelliJIDE(
}
override suspend fun getTags(artifactId: String): List<IndexTag> {
val workspaceDirs = gitService.workspaceDirectories()
val workspaceDirs = this.getWorkspaceDirs()
// Collect branches concurrently using Kotlin coroutines
val branches = withContext(Dispatchers.IO) {
@ -541,4 +535,14 @@ class IntelliJIDE(
}
}
private fun workspaceDirectories(): Array<String> {
val dirs = this.continuePluginService.workspacePaths
if (dirs?.isNotEmpty() == true) {
return dirs
}
return listOfNotNull(project.guessProjectDir()?.toUriOrNull()).toTypedArray()
}
}