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

@ -132,6 +132,16 @@ impl ExtensionManifest {
}
}
pub fn build_debug_adapter_schema_path(
adapter_name: &Arc<str>,
meta: &DebugAdapterManifestEntry,
) -> PathBuf {
meta.schema_path.clone().unwrap_or_else(|| {
Path::new("debug_adapter_schemas")
.join(Path::new(adapter_name.as_ref()).with_extension("json"))
})
}
/// A capability for an extension.
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(tag = "kind")]
@ -320,6 +330,29 @@ mod tests {
}
}
#[test]
fn test_build_adapter_schema_path_with_schema_path() {
let adapter_name = Arc::from("my_adapter");
let entry = DebugAdapterManifestEntry {
schema_path: Some(PathBuf::from("foo/bar")),
};
let path = build_debug_adapter_schema_path(&adapter_name, &entry);
assert_eq!(path, PathBuf::from("foo/bar"));
}
#[test]
fn test_build_adapter_schema_path_without_schema_path() {
let adapter_name = Arc::from("my_adapter");
let entry = DebugAdapterManifestEntry { schema_path: None };
let path = build_debug_adapter_schema_path(&adapter_name, &entry);
assert_eq!(
path,
PathBuf::from("debug_adapter_schemas").join("my_adapter.json")
);
}
#[test]
fn test_allow_exact_match() {
let manifest = ExtensionManifest {