@@ -247,22 +247,19 @@ tasks {
247247 }
248248
249249 // Run split mode with a JDWP debug agent on the frontend (JetBrains Client) process.
250- // After the frontend window appears, connect with the "IdeaVim Frontend Debug" Remote JVM Debug
251- // run configuration (port 5006). Use suspend=y below if you need to debug frontend startup code.
250+ // After the frontend window appears, run the "Split Frontend Debugger" run configuration to attach.
252251 val runIdeSplitModeDebugFrontend by intellijPlatformTesting.runIde.registering {
253252 splitMode = true
254253 splitModeTarget = SplitModeAware .SplitModeTarget .BOTH
255254
256- task {
257- doFirst {
258- // Find and patch the JetBrains Client vmoptions in the sandbox to include the JDWP debug agent.
259- // The file is created by the IDE during sandbox setup and lives under embedded-client/.
255+ prepareSandboxTask {
256+ val sandboxDir = project.layout.buildDirectory.dir(" idea-sandbox" ).map { it.asFile }
257+ doLast {
260258 val debugLine = " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5006"
261- val sandboxDir = project.layout.buildDirectory.dir(" idea-sandbox" ).get().asFile
262- val vmoptions = sandboxDir.walkTopDown()
259+ val vmoptions = sandboxDir.get().walkTopDown()
263260 .filter { it.name == " jetbrains_client64.vmoptions" && it.path.contains(" runIdeSplitModeDebugFrontend" ) }
264261 .firstOrNull()
265- ? : sandboxDir.walkTopDown()
262+ ? : sandboxDir.get(). walkTopDown()
266263 .filter { it.name == " jetbrains_client64.vmoptions" }
267264 .firstOrNull()
268265
@@ -271,10 +268,8 @@ tasks {
271268 if (debugLine !in content) {
272269 vmoptions.appendText(" \n $debugLine \n " )
273270 logger.lifecycle(" Patched frontend vmoptions with JDWP debug agent: ${vmoptions.absolutePath} " )
274- logger.lifecycle(" Connect a Remote JVM Debug configuration to localhost:5006" )
275- } else {
276- logger.lifecycle(" Frontend vmoptions already contain JDWP debug agent: ${vmoptions.absolutePath} " )
277271 }
272+ logger.lifecycle(" Connect a Remote JVM Debug configuration to localhost:5006" )
278273 } else {
279274 logger.warn(
280275 " Could not find jetbrains_client64.vmoptions in sandbox. " +
0 commit comments