Skip to content

Commit

Permalink
use runtimeClasspath during classpath resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Ryzhikov committed Oct 30, 2024
1 parent 7f05669 commit 15aebbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion adapter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ dependencies {
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.15.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("kotlin-language-server:shared")
implementation("kotlin-language-server:shared") {
version {
branch = "main"
}
}

// modules temporarily needed because of shared module import above
implementation("org.jetbrains.exposed:exposed-core:0.37.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package org.javacs.ktda.classpath

import org.javacs.kt.classpath.ClassPathResolver
import org.javacs.kt.classpath.defaultClassPathResolver
import org.javacs.kt.classpath.ResolverOptions
import org.javacs.kt.classpath.plus
import org.javacs.kt.classpath.joined
import java.nio.file.Path

val options = ResolverOptions(useCompileClasspath = false)

fun debugClassPathResolver(workspaceRoots: Collection<Path>): ClassPathResolver =
defaultClassPathResolver(workspaceRoots) + workspaceRoots.map { ProjectClassesResolver(it) }.joined
defaultClassPathResolver(workspaceRoots, resolverOptions = options) + workspaceRoots.map { ProjectClassesResolver(it) }.joined
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pluginManagement {
}

sourceControl {
gitRepository(java.net.URI.create("https://github.com/fwcd/kotlin-language-server.git")) {
gitRepository(java.net.URI.create("https://github.com/maksimr/kotlin-language-server.git")) {
producesModule("kotlin-language-server:shared")
}
}

0 comments on commit 15aebbc

Please sign in to comment.