Sync extension debuggers to remote host (#33876)

Closes #33835

Release Notes:

- Fixed debugger extensions not working in remote projects.
This commit is contained in:
Ryan Hawkins 2025-07-04 15:26:09 -06:00 committed by GitHub
parent 543a7b123a
commit 75928f4859
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 77 additions and 11 deletions

View file

@ -1639,6 +1639,23 @@ impl ExtensionStore {
}
}
for (adapter_name, meta) in loaded_extension.manifest.debug_adapters.iter() {
let schema_path = &extension::build_debug_adapter_schema_path(adapter_name, meta);
if fs.is_file(&src_dir.join(schema_path)).await {
match schema_path.parent() {
Some(parent) => fs.create_dir(&tmp_dir.join(parent)).await?,
None => {}
}
fs.copy_file(
&src_dir.join(schema_path),
&tmp_dir.join(schema_path),
fs::CopyOptions::default(),
)
.await?
}
}
Ok(())
})
}

View file

@ -4,8 +4,8 @@ use anyhow::{Context as _, Result};
use client::{TypedEnvelope, proto};
use collections::{HashMap, HashSet};
use extension::{
Extension, ExtensionHostProxy, ExtensionLanguageProxy, ExtensionLanguageServerProxy,
ExtensionManifest,
Extension, ExtensionDebugAdapterProviderProxy, ExtensionHostProxy, ExtensionLanguageProxy,
ExtensionLanguageServerProxy, ExtensionManifest,
};
use fs::{Fs, RemoveOptions, RenameOptions};
use gpui::{App, AppContext as _, AsyncApp, Context, Entity, Task, WeakEntity};
@ -169,8 +169,9 @@ impl HeadlessExtensionStore {
return Ok(());
}
let wasm_extension: Arc<dyn Extension> =
Arc::new(WasmExtension::load(extension_dir, &manifest, wasm_host.clone(), &cx).await?);
let wasm_extension: Arc<dyn Extension> = Arc::new(
WasmExtension::load(extension_dir.clone(), &manifest, wasm_host.clone(), &cx).await?,
);
for (language_server_id, language_server_config) in &manifest.language_servers {
for language in language_server_config.languages() {
@ -186,6 +187,24 @@ impl HeadlessExtensionStore {
);
})?;
}
for (debug_adapter, meta) in &manifest.debug_adapters {
let schema_path = extension::build_debug_adapter_schema_path(debug_adapter, meta);
this.update(cx, |this, _cx| {
this.proxy.register_debug_adapter(
wasm_extension.clone(),
debug_adapter.clone(),
&extension_dir.join(schema_path),
);
})?;
}
for debug_adapter in manifest.debug_locators.keys() {
this.update(cx, |this, _cx| {
this.proxy
.register_debug_locator(wasm_extension.clone(), debug_adapter.clone());
})?;
}
}
Ok(())