fwcd / fwcd/kotlin-debug-adapter

Incorrect classPath is used to launch debuggee

Open
#91 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
150
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Possibly relates to #69

I stumbled upon similar issue while I was trying to launch a Ktor application.

After some debugging, I traced the root cause to the fact that DebugAdapter re-uses classPath discovery mechanism of [kotlin-language-server](https://github.com/fwcd/kotlin-language-server/blob/main/shared/src/main/resources/projectClassPathFinder.gradle) and by default it only takes into account `compileClasspath` while it should use `runtimeClasspath`

For me, the issue was fixed after I've build my own debugAdapter with modified KLS with `it.compileClasspath.forEach` replaced with `it.runtimeClasspath.forEach`.

@fwcd can you please shed some light on the reason why debug adapter launches a "debuggee" with it's compile time dependencies and not runtimeDependencies ? I might be able to contribute if I understand the context better.

Sorry for the ping, and thanks for the great work you did!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.