Closed federicocarboni closed 5 months ago
`Launcher<IDebugProtocolClient> launcher = Launcher.createLauncher(server, IDebugProtocolClient.class, socket.getInputStream(), socket.getOutputStream());`
The issue is using Launcher which is the non-debug specific version and handles JSON-RPC as defined for LSP version of the protocol. You want to use the DebugLauncher
to talk the DAP version of the JSON-RPC protocol.
But you may want the higher level DSPLauncher
which handles the types too.
If it helps to understand further, the message DAP sends looks like this:
{"command":"initialize","arguments": [...] "type":"request","seq":1}
But LSP (the one Launcher understands) looks like this:
{"jsonrpc": "2.0", "id": 42, "method": "askServer", "params": [...]}
The DAP is not actually a JSON-RPC format, but it is quite similar.
Please feel free to raise additional issues if you have further questions.
Thanks for the quick response, it works now :+1:
I'm trying to make a DAP server over TCP but it crashes as soon as it receives an
initialize
request from VSCode.Here's the code I'm using to start the server:
And the stack trace of the error:
And here's the raw JSONRPC message sent by VSCode:
Maybe I'm doing something completely wrong, can someone explain why this is happening?