Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ class FullClasspathDaemonLauncher(
mpsHome.resolve("Resources/product-info.json"),
).firstOrNull(Files::isRegularFile) ?: return emptyList()
val launch = selectMpsLaunch(readMpsLaunches(descriptor), hostPlatform(osName, osArch, descriptor), descriptor)
return launch.bootstrapJvmArgs.map { it.replace("\$IDE_HOME", mpsHome.pathString) }
return launch.bootstrapJvmArgs.map {
it.replace("%IDE_HOME%", mpsHome.pathString).replace("\$IDE_HOME", mpsHome.pathString)
}
}

private fun readMpsLaunches(descriptor: Path): List<MpsLaunch> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ class FullClasspathDaemonLauncherTest {
assertEquals(emptyList(), FullClasspathDaemonLauncher.mpsBootstrapJvmArgs(tempDir, "Linux", "amd64"))
}

@Test
fun `bootstrap classpath resolves Windows IDE home placeholder in a path with spaces`() {
val mpsHome = tempDir.resolve("Program Files/JetBrains/MPS 2026.2").createDirectories()
mpsHome.resolve("product-info.json").writeText(
"""{"launch":[{"os":"Windows","arch":"amd64","bootClassPathJarNames":[],
"additionalJvmArguments":["-Xbootclasspath/a:%IDE_HOME%/lib/nio-fs.jar"]}]}""",
)

assertEquals(
listOf("-Xbootclasspath/a:$mpsHome/lib/nio-fs.jar"),
FullClasspathDaemonLauncher.mpsBootstrapJvmArgs(mpsHome, "Windows 11", "amd64"),
)
}

@Test
fun `exact host launch entry is preferred`() {
val mpsHome = tempDir.resolve("mps").createDirectories()
Expand Down
Loading