Skip to content

Commit a7c83b9

Browse files
committed
Migrate SourceExclusions
1 parent 2c53dec commit a7c83b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adapter/src/main/kotlin/org/javacs/ktda/classpath/FindClassPath.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.javacs.ktda.classpath
22

33
import java.util.logging.Level
4+
import org.javacs.kt.SourceExclusions
45
import org.javacs.ktda.LOG
56
import org.javacs.ktda.util.winCompatiblePathOf
67
import org.javacs.ktda.util.tryResolving
@@ -61,10 +62,10 @@ private fun backupClassPath() =
6162
listOfNotNull(findKotlinStdlib()).toSet()
6263

6364
private fun projectFiles(workspaceRoot: Path): Set<Path> {
64-
val exclusions = setOf("bin", "build") // TODO: Use SourceExclusions from kotlin-language-server's shared module
65+
val exclusions = SourceExclusions(workspaceRoot)
6566
return workspaceRoot.toFile()
6667
.walk()
67-
.onEnter { it.name !in exclusions }
68+
.onEnter { exclusions.isIncluded(it.toPath()) }
6869
.map { it.toPath() }
6970
.filter { isMavenBuildFile(it) || isGradleBuildFile(it) }
7071
.toSet()

0 commit comments

Comments
 (0)