Skip to content

Commit

Permalink
Merge pull request #685 from adpi2/fix-launch-args
Browse files Browse the repository at this point in the history
Fix parsing launch arguments
  • Loading branch information
adpi2 authored Mar 11, 2024
2 parents 32f4b67 + d691150 commit fdbebb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private[debugadapter] final class DebugSession private (
val command = Command.parse(request.command)
// the launch args sent by Metals do not conform to the LaunchArgument of java-debug
// here we parse to PartialLaunchArguments which only contains noDebug
val launchArgs = JsonUtils.fromJson(request.arguments, classOf[PartialLaunchArguments])
val launchArgs = JsonUtils.fromJson(request.arguments, classOf[ScalaLaunchArguments])
val tools =
if (launchArgs.noDebug) DebugTools.none(logger)
else DebugTools(debuggee, resolver, logger)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ch.epfl.scala.debugadapter.internal;

import com.microsoft.java.debug.core.protocol.Requests.LaunchArguments
import ch.epfl.scala.debugadapter.StepFiltersConfig

case class PartialLaunchArguments(
case class ScalaLaunchArguments(
noDebug: Boolean,
scalaStepFilters: StepFiltersConfig
) extends LaunchArguments
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ch.epfl.scala.debugadapter.Logger
import scala.collection.concurrent.TrieMap
import scala.concurrent.Future
import scala.concurrent.Await
import ch.epfl.scala.debugadapter.internal.PartialLaunchArguments
import ch.epfl.scala.debugadapter.internal.ScalaLaunchArguments
import ch.epfl.scala.debugadapter.StepFiltersConfig

class TestingDebugClient(socket: Socket, logger: Logger)(implicit
Expand Down Expand Up @@ -53,7 +53,7 @@ class TestingDebugClient(socket: Socket, logger: Logger)(implicit
timeout: Duration = defaultTimeout(16.seconds),
stepFilters: StepFiltersConfig = null
): Messages.Response = {
val request = createRequest(Command.LAUNCH, new PartialLaunchArguments(stepFilters))
val request = createRequest(Command.LAUNCH, new ScalaLaunchArguments(noDebug = false, stepFilters))

Await.result(sendRequest(request), timeout)
}
Expand Down

0 comments on commit fdbebb9

Please sign in to comment.