Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS code showing warning of kotlin-language-server #595

Open
nizam-betterapp opened this issue Sep 15, 2024 · 1 comment
Open

VS code showing warning of kotlin-language-server #595

nizam-betterapp opened this issue Sep 15, 2024 · 1 comment

Comments

@nizam-betterapp
Copy link

I was trying to build the kotlin server to get started on contributing the project.

Running installedDist worked fine
Screenshot 2024-09-15 at 8 50 32 PM

But warning in the IDE after the indexing is done
Screenshot 2024-09-15 at 8 57 52 PM

Attached logs for your reference
kls.ownserver.log

When I run build, it's failed
Screenshot 2024-09-15 at 8 51 55 PM

Please let me know what I am doing wrong. Are those warnings with red underlines expected?

@nizam-betterapp
Copy link
Author

I add this below code that writes all the dependencies into the classpath.sh and tried it. Initially I was getting the 'Classpath has not changed. Fetching from cache' log line. after i manually added another dependency, this got fixed.

`tasks.register("writeDepsToFile") {
doLast {
val home = System.getProperty("user.home")
val outputFile = file("$home/.config/kotlin-language-server/classpath.sh")
outputFile.parentFile.mkdirs() // Ensure the directory exists

    val classpath = configurations.compileClasspath.get()
        .joinToString(":") { it.absolutePath }
    
    outputFile.writeText("#!/bin/bash\necho $classpath\n")
    
    // Make the file executable
    outputFile.setExecutable(true)
}

}`

I am wondering whether this should be part of https://github.com/fwcd/kotlin-language-server/blob/main/shared/src/main/kotlin/org/javacs/kt/classpath/DefaultClassPathResolver.kt
If I am going in the right direction, please let me know. will send a PR request.

Screenshot 2024-09-15 at 10 17 47 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant