[DAP] Working with a server which doesn't set "seq" property in some responses
yevgeni-zolotko opened this issue · 0 comments
Hi,
I am trying get the DAP client working with vscode-lldb server.
Unfortunately, this server sends some responses without seq
property set. For example, it sends the the following initialize
response:
{
"type": "response",
"request_seq": 1,
"success": true,
"command": "initialize",
"body": {
//...
}
}
Given such a response, the DapReceiver
fails with "No sequence given"
:
if (!request.TryGetValue("seq", out var id))
{
yield return new InvalidRequest(null, "No sequence given");
yield break;
}
I patched the code like this:
if (!request.TryGetValue("seq", out var id))
{
id = 0;
}
-- and the client worked.
Given that VS Code works with such a server behavior without any problems, I think it is reasonable to "fix" this in the client.
I tried to replace DapReceiver
with my inherited class to modify this behavior without changing the library, but didn't find a way to change the service container registration code.
Could you please advice on how to better resolve this issue? Is my fix suitable for the official library packages? Maybe we could log warnings in such cases, but allow the responses without seq
?