debugger: Remove fake adapter and un-gate GDB (#27557)

This is a clean-up PR in anticipation of introduction of Debugger
Registry. I wanna get rid of DebugAdapterKind (or rather, it being an
enum).
Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
Piotr Osiewicz 2025-03-27 23:31:58 +01:00 committed by GitHub
parent 56eb650f09
commit 4839195003
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 1315 additions and 924 deletions

View file

@ -15,8 +15,8 @@ use std::path::PathBuf;
use std::str::FromStr;
pub use debug_format::{
AttachConfig, CustomArgs, DebugAdapterConfig, DebugAdapterKind, DebugConnectionType,
DebugRequestType, DebugTaskDefinition, DebugTaskFile, TCPHost,
AttachConfig, DebugAdapterConfig, DebugConnectionType, DebugRequestDisposition,
DebugRequestType, DebugTaskDefinition, DebugTaskFile, LaunchConfig, TCPHost,
};
pub use task_template::{
HideStrategy, RevealStrategy, TaskModal, TaskTemplate, TaskTemplates, TaskType,
@ -104,14 +104,20 @@ impl ResolvedTask {
}
/// Get the configuration for the debug adapter that should be used for this task.
pub fn resolved_debug_adapter_config(&self) -> Option<DebugAdapterConfig> {
pub fn resolved_debug_adapter_config(&self) -> Option<DebugTaskDefinition> {
match self.original_task.task_type.clone() {
TaskType::Script => None,
TaskType::Debug(mut adapter_config) => {
if let Some(resolved) = &self.resolved {
adapter_config.label = resolved.label.clone();
adapter_config.program = resolved.program.clone().or(adapter_config.program);
adapter_config.cwd = resolved.cwd.clone().or(adapter_config.cwd);
if let DebugRequestType::Launch(ref mut launch) = adapter_config.request {
if let Some(program) = resolved.program.clone() {
launch.program = program;
}
if let Some(cwd) = resolved.cwd.clone() {
launch.cwd = Some(cwd);
}
}
}
Some(adapter_config)