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

@ -35,6 +35,7 @@ client.workspace = true
clock.workspace = true
collections.workspace = true
component.workspace = true
dap.workspace = true
db.workspace = true
derive_more.workspace = true
fs.workspace = true
@ -68,6 +69,7 @@ zed_actions.workspace = true
[dev-dependencies]
call = { workspace = true, features = ["test-support"] }
client = { workspace = true, features = ["test-support"] }
dap = { workspace = true, features = ["test-support"] }
db = { workspace = true, features = ["test-support"] }
env_logger.workspace = true
fs = { workspace = true, features = ["test-support"] }

View file

@ -14,6 +14,7 @@ mod toast_layer;
mod toolbar;
mod workspace_settings;
use dap::DapRegistry;
pub use toast_layer::{RunAction, ToastAction, ToastLayer, ToastView};
use anyhow::{anyhow, Context as _, Result};
@ -637,6 +638,7 @@ pub fn register_serializable_item<I: SerializableItem>(cx: &mut App) {
pub struct AppState {
pub languages: Arc<LanguageRegistry>,
pub debug_adapters: Arc<DapRegistry>,
pub client: Arc<Client>,
pub user_store: Entity<UserStore>,
pub workspace_store: Entity<WorkspaceStore>,
@ -688,6 +690,7 @@ impl AppState {
let fs = fs::FakeFs::new(cx.background_executor().clone());
let languages = Arc::new(LanguageRegistry::test(cx.background_executor().clone()));
let debug_adapters = Arc::new(DapRegistry::fake());
let clock = Arc::new(clock::FakeSystemClock::new());
let http_client = http_client::FakeHttpClient::with_404_response();
let client = Client::new(clock, http_client.clone(), cx);
@ -703,6 +706,7 @@ impl AppState {
client,
fs,
languages,
debug_adapters,
user_store,
workspace_store,
node_runtime: NodeRuntime::unavailable(),
@ -1197,6 +1201,7 @@ impl Workspace {
app_state.node_runtime.clone(),
app_state.user_store.clone(),
app_state.languages.clone(),
app_state.debug_adapters.clone(),
app_state.fs.clone(),
env,
cx,
@ -5025,6 +5030,7 @@ impl Workspace {
window.activate_window();
let app_state = Arc::new(AppState {
languages: project.read(cx).languages().clone(),
debug_adapters: project.read(cx).debug_adapters().clone(),
workspace_store,
client,
user_store,