Remove DebugAdapterConfig (#28898)

This is unused as of recent changes to task spawning.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-04-16 14:02:10 -06:00 committed by GitHub
parent 040046ed2a
commit 64a67a1071
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 59 deletions

View file

@ -7,7 +7,7 @@ pub mod transport;
pub use dap_types::*;
pub use registry::DapRegistry;
pub use task::{DebugAdapterConfig, DebugRequestType};
pub use task::DebugRequestType;
pub type ScopeId = u64;
pub type VariableReference = u64;

View file

@ -98,62 +98,6 @@ impl DebugRequestDisposition {
}
}
}
/// Represents the configuration for the debug adapter
#[derive(PartialEq, Eq, Clone, Debug)]
pub struct DebugAdapterConfig {
/// Name of the debug task
pub label: String,
/// The type of adapter you want to use
pub adapter: String,
/// The type of request that should be called on the debug adapter
pub request: DebugRequestDisposition,
/// Additional initialization arguments to be sent on DAP initialization
pub initialize_args: Option<serde_json::Value>,
/// Optional TCP connection information
///
/// If provided, this will be used to connect to the debug adapter instead of
/// spawning a new process. This is useful for connecting to a debug adapter
/// that is already running or is started by another process.
pub tcp_connection: Option<TCPHost>,
/// What Locator to use to configure the debug task
pub locator: Option<String>,
/// Whether to tell the debug adapter to stop on entry
pub stop_on_entry: Option<bool>,
}
impl From<DebugTaskDefinition> for DebugAdapterConfig {
fn from(def: DebugTaskDefinition) -> Self {
Self {
label: def.label,
adapter: def.adapter,
request: DebugRequestDisposition::UserConfigured(def.request),
initialize_args: def.initialize_args,
tcp_connection: def.tcp_connection,
locator: def.locator,
stop_on_entry: def.stop_on_entry,
}
}
}
impl TryFrom<DebugAdapterConfig> for DebugTaskDefinition {
type Error = ();
fn try_from(def: DebugAdapterConfig) -> Result<Self, Self::Error> {
let request = match def.request {
DebugRequestDisposition::UserConfigured(debug_request_type) => debug_request_type,
DebugRequestDisposition::ReverseRequest(_) => return Err(()),
};
Ok(Self {
label: def.label,
adapter: def.adapter,
request,
initialize_args: def.initialize_args,
tcp_connection: def.tcp_connection,
locator: def.locator,
stop_on_entry: def.stop_on_entry,
})
}
}
impl TryFrom<TaskTemplate> for DebugTaskDefinition {
type Error = ();

View file

@ -16,8 +16,8 @@ use std::path::PathBuf;
use std::str::FromStr;
pub use debug_format::{
AttachConfig, DebugAdapterConfig, DebugConnectionType, DebugRequestDisposition,
DebugRequestType, DebugTaskDefinition, DebugTaskFile, LaunchConfig, TCPHost,
AttachConfig, DebugConnectionType, DebugRequestDisposition, DebugRequestType,
DebugTaskDefinition, DebugTaskFile, LaunchConfig, TCPHost,
};
pub use task_template::{
DebugArgs, DebugArgsRequest, HideStrategy, RevealStrategy, TaskModal, TaskTemplate,