Events were emitted, or sometimes not emitted at all, before state changes were committed.
Some refactorings to both directly fix this and also improve the code:
New Parse.Deliver class encapsulates translation of Parse.Events into DAP state and events, delivered via the Debugee interface. It also ensures state is delivered before events so that consumers can react to events and read the correct state values. Parse.Deliver also fixes the bug of not delivering certain events, like the data position upon the "continue" action, by delivering events at every kind of stopping action, which includes "step", "continue", and a hit breakpoint.
Remove Debugee.state and have the Debugee implementation emit the DAP events directly via Debugee.events.
Instead of using None-terminated Queue, which enqueues with Some and terminates with None, use the Channel data type which only uses the actual message type.
To lift an IO into a Resource, replace Resource.eval(io) with io.toResource.
@arosien Pull down the latest main and rebase this PR off of it. This will fix your CI issues, once those are passed and I double check everything is working for me I will +1 this PR.
Events were emitted, or sometimes not emitted at all, before state changes were committed.
Some refactorings to both directly fix this and also improve the code:
Parse.Deliver
class encapsulates translation ofParse.Event
s into DAP state and events, delivered via theDebugee
interface. It also ensures state is delivered before events so that consumers can react to events and read the correct state values.Parse.Deliver
also fixes the bug of not delivering certain events, like the data position upon the "continue" action, by delivering events at every kind of stopping action, which includes "step", "continue", and a hit breakpoint.Debugee.state
and have theDebugee
implementation emit the DAP events directly viaDebugee.events
.None
-terminatedQueue
, which enqueues withSome
and terminates withNone
, use theChannel
data type which only uses the actual message type.IO
into aResource
, replaceResource.eval(io)
withio.toResource
.Fixes #995.