![]() This change refactors the DAP `Event` type, the `helix_dap` module and the `helix_dap::transport` module to be closer to the equivalent implementations in `helix_lsp`. The DAP `Event` type is similar to LSP's `Notification` so this change rewrites the enum as a trait which is implemented by empty types (for example `enum Initialized {}`). `Event` is then reintroduced as an enum in `helix_dap` with a helper function to convert from the `Event` as the transport knows it. By separating the definitions of `Event` between lib and transport, we can handle incoming events which are not known to our `Event` enum. For example debugpy sends `"debugpySockets"` which is unknown. With this change, unknown events are discarded with an info-level log message. The `Request` type was already a trait but did not have an enum with the known values. This change also introduces a `helix_dap::Request` enum similar to `helix_dap::Event`. This resolves a TODO comment about avoiding `unwrap` when parsing the request's arguments. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |