2021-08-12 15:35:15 +02:00
|
|
|
mod client;
|
|
|
|
mod transport;
|
2021-08-16 06:22:54 +02:00
|
|
|
mod types;
|
2021-08-12 15:35:15 +02:00
|
|
|
|
feat(dap): send Disconnect if Terminated event received (#5532)
Send a `Disconnect` DAP request if the `Terminated` event is received.
According to the specification, if the debugging session was started by
as `launch`, the debuggee should be terminated alongside the session. If
instead the session was started as `attach`, it should not be disposed of.
This default behaviour can be overriden if the `supportTerminateDebuggee`
capability is supported by the adapter, through the `Disconnect` request
`terminateDebuggee` argument, as described in
[the specification][discon-spec].
This also implies saving the starting command for a debug sessions, in
order to decide which behaviour should be used, as well as validating the
capabilities of the adapter, in order to decide what the disconnect should
do.
An additional change made is handling of the `Exited` event, showing a
message if the exit code is different than `0`, for the user to be aware
off the termination failure.
[discon-spec]: https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Disconnect
Closes: #4674
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
2023-02-20 05:00:00 +01:00
|
|
|
pub use client::{Client, ConnectionType};
|
2021-08-22 09:05:12 +02:00
|
|
|
pub use events::Event;
|
|
|
|
pub use transport::{Payload, Response, Transport};
|
2021-08-16 06:22:54 +02:00
|
|
|
pub use types::*;
|
2021-08-12 15:35:15 +02:00
|
|
|
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum Error {
|
|
|
|
#[error("failed to parse: {0}")]
|
|
|
|
Parse(#[from] serde_json::Error),
|
|
|
|
#[error("IO Error: {0}")]
|
|
|
|
IO(#[from] std::io::Error),
|
2023-02-16 17:21:12 +01:00
|
|
|
#[error("request {0} timed out")]
|
|
|
|
Timeout(u64),
|
2021-08-12 15:35:15 +02:00
|
|
|
#[error("server closed the stream")]
|
|
|
|
StreamClosed,
|
|
|
|
#[error(transparent)]
|
|
|
|
Other(#[from] anyhow::Error),
|
|
|
|
}
|
|
|
|
pub type Result<T> = core::result::Result<T, Error>;
|