microsoft / vscode-mock-debug

Starter sample for developing debug adapters for VSCode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mock debug adapter sends stop event before response to step request in violation of the spec

FeldrinH opened this issue · comments

The DAP specification (https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Next) states the following about all the step requests (next, stepIn, stepOut, stepBack):

The debug adapter first sends the response and then a stopped event (with reason step) after the step has completed.

The mock debug adapter appears to do this in reverse, violating the spec.
Looking at https://github.com/microsoft/vscode-mock-debug/blob/main/src/mockDebug.ts#L511-L539, it appears that the runtime step method (which indirectly, but as far as I can tell synchronously, sends the stop event) is called before sending a response to the step request.