diff --git a/crates/dap/src/client.rs b/crates/dap/src/client.rs index 6d3022da74ac9..672fa17c817c6 100644 --- a/crates/dap/src/client.rs +++ b/crates/dap/src/client.rs @@ -136,10 +136,6 @@ impl DebugAdapterClient { self.transport_delegate.send_message(message).await } - pub fn has_adapter_logs(&self) -> bool { - true // TODO debugger: fix this when we move code to the transport layer - } - pub fn id(&self) -> DebugAdapterClientId { self.id } @@ -169,6 +165,10 @@ impl DebugAdapterClient { self.transport_delegate.shutdown().await } + pub fn has_adapter_logs(&self) -> bool { + self.transport_delegate.has_adapter_logs() + } + pub fn add_log_handler(&self, f: F, kind: LogKind) where F: 'static + Send + FnMut(IoKind, &str), diff --git a/crates/dap/src/transport.rs b/crates/dap/src/transport.rs index 3f64720a4c93a..48deaa50e3264 100644 --- a/crates/dap/src/transport.rs +++ b/crates/dap/src/transport.rs @@ -320,6 +320,10 @@ impl TransportDelegate { anyhow::Ok(()) } + pub fn has_adapter_logs(&self) -> bool { + self.transport.has_adapter_logs() + } + pub fn add_log_handler(&self, f: F, kind: LogKind) where F: 'static + Send + FnMut(IoKind, &str), @@ -336,6 +340,8 @@ pub trait Transport: 'static + Send + Sync { binary: &DebugAdapterBinary, cx: &mut AsyncAppContext, ) -> Result; + + fn has_adapter_logs(&self) -> bool; } pub struct TcpTransport { @@ -433,6 +439,10 @@ impl Transport for TcpTransport { process, )) } + + fn has_adapter_logs(&self) -> bool { + true + } } pub struct StdioTransport {} @@ -492,4 +502,8 @@ impl Transport for StdioTransport { process, )) } + + fn has_adapter_logs(&self) -> bool { + false + } }