fwcd / kotlin-debug-adapter

Kotlin/JVM debugging for any editor/IDE using the Debug Adapter Protocol
MIT License
110 stars 19 forks source link

Gradle dependencies could not be resolved [Kotlin VS Code Extension] #78

Closed PaulTaykalo closed 7 months ago

PaulTaykalo commented 10 months ago

This repository has a dependency on the language server shared libs, which are mostly used for resolving classpaths for the tasks that will be lauched by adapter and the LSP server itself

Like Here: https://github.com/fwcd/kotlin-language-server/blob/77ecc25718befa0dd0e31e0caaa95d29170aabd8/shared/src/main/kotlin/org/javacs/kt/classpath/GradleClassPathResolver.kt#L17

In order to resolve Gradle dependenies, shared lib would run projectClassPathFinder.gradle file, which is contained in the shared.jar

Problem

.gradle files are missing in the shared.jar lib in

Currently Built artifact 0.4.3 .zip https://github.com/fwcd/kotlin-debug-adapter/releases/tag/0.4.3

As well as artifact that will be downloaded by the Kotlin Plugin for VSCode

image

Missing Resources

image

Expected Structure

image

Actual result

When user will try to run debug adapter for vscode, they will receive an error (somewhat warning) that gradle dependencies could not be resolved

[WARN] async1    Could not resolve classpath using Gradle: ClassLoader.getSystemResourceAsStream(scriptName) must not be null

Related issues

Suggested Solution

Since VSCode Kotlin Extension downloads the latest version, no changes will be needed in the Kotlin Extension. (maybe files needed to be redownloaded, not sure)

Workaround

Build this repo manually and place the result in the VSCode Kotlin Extension storage.

Hope this helps :)

fwcd commented 10 months ago

Nice find!

The issue is that Jitpack (which the latest release 0.4.3 still uses for the dependency on the Kotlin language server's shared lib, see adapter/build.gradle) didn't seem to package up resources, unfortunately.

Nowadays the debug adapter uses a Gradle source dependency, which doesn't seem to have this issue, so releasing a new version will probably fix this. I'll see if I find some time to do so.

LuLeRoemer commented 9 months ago

Having the exact same error. New release would be highly appreciated. Thanks in advance! :)

tariqajyusuf commented 8 months ago

Another one here having a similar issue :)

fwcd commented 7 months ago

Should hopefully be fixed as of 0.4.4, feel free to reopen if not!