Hi Jonah,
Thanks for the response. I've seen that Overview diagram before, and I'm essentially following what it does, though since I have a REPL loop evaluating multiple expressions the adapter has no reason to send back a "terminated" event after (say) the first evaluation. If I tweak it to add that event, the socket to the DA Launcher is closed and subsequent REPL commands give an error, but the Eclipse "Debug Adapter Target" is still showing an active thread after the terminate - it's "stuck" :(
17:35:57.021: <<< DAP { "type" : "response", "seq" : 16, "request_seq" : 6, "command" : "evaluate", "success" : true, "body" : { "result" : "= 12178", "variablesReference" : 0 } }
17:35:57.021: <<< DAP { "type" : "event", "seq" : 17, "event" : "output", "body" : { "output" : "Executed in 2.891 secs.\n" } }
17:35:57.022: <<< DAP { "type" : "event", "seq" : 18, "event" : "output", "body" : { "output" : "A> " } }
17:35:57.023: <<< DAP { "type" : "event", "seq" : 19, "event" : "terminated" }
17:35:57.023: >>> DAP {"type":"request","seq":11,"command":"threads"}
17:35:57.024: <<< DAP { "type" : "response", "seq" : 20, "request_seq" : 11, "command" : "threads", "success" : true, "body" : { "threads" : [ ] } }
17:35:57.056: >>> DAP {"type":"request","seq":12,"command":"stackTrace","arguments":{"threadId":14,"startFrame":0,"levels":20}}
17:35:57.057: <<< DAP { "type" : "response", "seq" : 21, "request_seq" : 12, "command" : "stackTrace", "success" : true, "message" : "", "body" : { "stackFrames" : [ ], "totalFrames" : 0 } }
And in the console:
A> f()
Executed in 2.891 secs.
= 12178
A> 1+1
org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.net.SocketException: Socket closed
Without the "terminated", the REPL loop continues and I can evaluate multiple expressions, which is what I need... but I can't stop the thing cleanly in that case!
I suppose I could interpret the "evaluate" _expression_, look for "/quit" and then send a terminated event, but it looks like the DA Target would still not terminate gracefully.
If I'm missing something, please let me know :)