Skip to content

Commit

Permalink
Resolve issue where Java files cannot be selected separately (#2590)
Browse files Browse the repository at this point in the history
See #2590
  • Loading branch information
2017398956 committed Aug 3, 2022
1 parent 2372302 commit 47c87aa
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,23 @@ class DefaultPsiToDocumentableTranslator(
?: listOf()
val localFileSystem = VirtualFileManager.getInstance().getFileSystem("file")

val psiFiles = sourceRoots.parallelMap { sourceRoot ->
val psiFiles = mutableListOf<PsiJavaFile>()
psiFiles.addAll(sourceRoots.parallelMap { sourceRoot ->
sourceRoot.absoluteFile.walkTopDown().mapNotNull {
localFileSystem.findFileByPath(it.path)?.let { vFile ->
PsiManager.getInstance(environment.project).findFile(vFile) as? PsiJavaFile
}
}.toList()
}.flatten()
}.flatten())
environment.configuration.javaSourceRoots.forEach {
if (it.endsWith(".java")){
localFileSystem.findFileByPath(it)?.let{vFile ->
(PsiManager.getInstance(environment.project).findFile(vFile) as? PsiJavaFile)?.let { psiJavaFile ->
psiFiles.add(psiJavaFile)
}
}
}
}

val docParser =
DokkaPsiParser(
Expand Down

0 comments on commit 47c87aa

Please sign in to comment.