Skip to content

Commit 8c88f10

Browse files
committed
Migrate classpath resolution to ClassPathResolvers
1 parent b167c33 commit 8c88f10

File tree

6 files changed

+42
-363
lines changed

6 files changed

+42
-363
lines changed

adapter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.6.0'
2727
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
2828
implementation 'org.jetbrains.kotlin:kotlin-reflect'
29-
implementation 'com.github.fwcd.kotlin-language-server:shared:542d635b9fc9e41eb732ba40ef10742b33a92acc'
29+
implementation 'com.github.fwcd.kotlin-language-server:shared:0691158787'
3030
// The Java Debug Interface classes (com.sun.jdi.*)
3131
implementation files("${System.properties['java.home']}/../lib/tools.jar")
3232
testImplementation 'junit:junit:4.12'

adapter/src/main/kotlin/org/javacs/ktda/adapter/KotlinDebugAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.javacs.ktda.core.launch.DebugLauncher
2828
import org.javacs.ktda.core.launch.LaunchConfiguration
2929
import org.javacs.ktda.core.launch.AttachConfiguration
3030
import org.javacs.ktda.core.breakpoint.ExceptionBreakpoint
31-
import org.javacs.ktda.classpath.findClassPath
31+
import org.javacs.ktda.classpath.debugClassPathResolver
3232
import org.javacs.ktda.classpath.findValidKtFilePath
3333

3434
/** The debug server interface conforming to the Debug Adapter Protocol */
@@ -92,7 +92,7 @@ class KotlinDebugAdapter(
9292
setupCommonInitializationParams(args)
9393

9494
val config = LaunchConfiguration(
95-
findClassPath(listOf(projectRoot)),
95+
debugClassPathResolver(listOf(projectRoot)).classpathOrEmpty,
9696
mainClass,
9797
projectRoot
9898
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.javacs.ktda.classpath
2+
3+
import org.javacs.kt.classpath.ClassPathResolver
4+
import org.javacs.kt.classpath.defaultClassPathResolver
5+
import org.javacs.kt.classpath.plus
6+
import org.javacs.kt.classpath.joined
7+
import java.nio.file.Path
8+
9+
fun debugClassPathResolver(workspaceRoots: Collection<Path>): ClassPathResolver =
10+
defaultClassPathResolver(workspaceRoots) + workspaceRoots.map { ProjectClassesResolver(it) }.joined

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

Lines changed: 0 additions & 281 deletions
This file was deleted.

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

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)