Skip to content

Commit 75c01dc

Browse files
committed
Fix Metals compat
1 parent 2537d4d commit 75c01dc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package ch.epfl.scala.debugadapter.internal;
2+
3+
class PartialLaunchArguments {
4+
public boolean noDebug = false;
5+
}

modules/core/src/main/scala/ch/epfl/scala/debugadapter/internal/DebugSession.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ private[debugadapter] final class DebugSession private (
148148
context.configure(tools)
149149
super.dispatchRequest(request)
150150
case "launch" =>
151-
val launchArgs = JsonUtils.fromJson(request.arguments, classOf[LaunchArguments])
151+
val command = Command.parse(request.command)
152+
// the launch args sent by Metals do not conform to the LaunchArgument of java-debug
153+
// here we parse to PartialLaunchArguments which only contains noDebug
154+
val launchArgs = JsonUtils.fromJson(request.arguments, classOf[PartialLaunchArguments])
152155
val tools =
153156
if (launchArgs.noDebug) DebugTools.none
154157
else DebugTools(debuggee, resolver, logger)

0 commit comments

Comments
 (0)