Merge pull request #2686 from mq200/fix/intellij-folder-context-provider
enable selection of nested folders @folder intelliJ
This commit is contained in:
commit
d68e51e0be
1 changed files with 8 additions and 4 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue