Open jdneo opened 2 days ago
Ah this is different from what I was thinking about.
My original thought is that, just having a flag to tell whether this is a debug request. And then use TestLauncher.debugTestsOn(int)
at gradle tooling api side.
And then on the client side you attach to process?
Yes, and we don't need to care about the client debug adapter implementation.
You could test this without any BSP changes.
Both ScalaTestSuites
and ScalaTestParams
allow the client to pass jvmoptions.
debugTestsOn adds -agentlib:jdwp=transport=dt_socket,server=n,suspend=n,address=localhost:<port>
to jvmoptions which you could pass in.
Although debugTestsOn
also disables parallel test execution.
The issue with adding a flag to BSP is that's not language agnostic. Do all languages debug by attaching to a port number? Maybe it doesn't matter if we're using ScalaTestSuites
and ScalaTestParams
as these are JVM languages only.
Although debugTestsOn also disables parallel test execution.
Yes this is the reason I was thinking about not to append jdwp args at first.
I'll think twice to see what is the best way to do that.
@jdneo I think
Metals
used debugSessionStart but forDebugSessionParamsDataKind
used the same data kinds we use for tests e.g.scala-test-suites-selection
andscala-test
.What's kind of interesting is that different clients might want different debug adapters....
Metals
is primarily for Scala development so it uses https://github.com/scalacenter/scala-debug-adapter For Kotlin there is https://github.com/fwcd/kotlin-debug-adapter Java has https://github.com/microsoft/java-debugI imagine the Java one is good enough for all but it would be handy to be able to specify the type in the BSP command and have the build server kick start the relevant one. Another thing to propose to add to BSP spec.
Originally posted by @Arthurm1 in https://github.com/microsoft/build-server-for-gradle/issues/144#issuecomment-2199608819