Skip to content

Commit d842214

Browse files
committed
Provide a basic exclusion strategy for project files
1 parent df6016d commit d842214

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adapter/src/main/kotlin/fwcd/ktda/classpath/FindClassPath.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ private fun backupClassPath() =
6161
listOfNotNull(findKotlinStdlib()).toSet()
6262

6363
private fun projectFiles(workspaceRoot: Path): Set<Path> {
64-
return Files.walk(workspaceRoot)
64+
val exclusions = setOf("bin", "build") // TODO: Use SourceExclusions from kotlin-language-server's shared module
65+
return workspaceRoot.toFile()
66+
.walk()
67+
.onEnter { it.name !in exclusions }
68+
.map { it.toPath() }
6569
.filter { isMavenBuildFile(it) || isGradleBuildFile(it) }
66-
.collect(Collectors.toSet())
70+
.toSet()
6771
}
6872

6973
private fun readLaunchConfigurationFile(file: Path): Set<Path> {

0 commit comments

Comments
 (0)