mirror of
https://github.com/sbt/sbt.git
synced 2026-09-02 02:57:21 +02:00
fix: Use sbt script in BSP config instead of hardcoded Java path (#8920)
**Problem** sbt bspConfig writes the absolute path of the current Java binary into .bsp/sbt.json. When the user switches Java versions (via sdkman, cs java, etc.) or removes that JDK, the IDE fails to start the sbt BSP server because the hardcoded path is stale or gone. **Solution** When an sbt launcher script is available (via `sbt.script` system property or PATH lookup), generate: "argv": ["/path/to/sbt", "bsp"]
This commit is contained in:
@@ -1306,7 +1306,7 @@ object NetworkClient {
|
||||
case "--sbt-launch-jar" if i + 1 < sanitized.length =>
|
||||
i += 1
|
||||
launchJar = Option(sanitized(i).replace("%20", " "))
|
||||
case "-bsp" | "--bsp" => bsp = true
|
||||
case "-bsp" | "--bsp" | "bsp" => bsp = true
|
||||
case "-no-server" | "--no-server" =>
|
||||
System.setProperty("sbt.server.autostart", "false")
|
||||
case a if a.startsWith("--autostart=") =>
|
||||
|
||||
Reference in New Issue
Block a user