Merge pull request #2686 from mq200/fix/intellij-folder-context-provider

enable selection of nested folders @folder intelliJ
This commit is contained in:
Nate Sesti 2024-10-25 16:26:00 -07:00 • committed by GitHub
commit d68e51e0be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -572,10 +572,14 @@ class IdeProtocolClient(
"listFolders" -> {
val workspacePath = workspacePath ?: return@launch
val workspaceDir = File(workspacePath)
val folders =
workspaceDir.listFiles { file -> file.isDirectory }?.map { file -> file.absolutePath }
?: emptyList()
val folders = mutableListOf<String>()
fun findNestedFolders(dirPath: String) {
val dir = File(dirPath)
val nestedFolders = dir.listFiles { file -> file.isDirectory }?.map { file -> file.absolutePath } ?: emptyList()
folders.addAll(nestedFolders);
nestedFolders.forEach { folder -> findNestedFolders(folder) }
}
findNestedFolders(workspacePath)
respond(folders)
}