extensions: Yet another PR for debugger touchups (#32822)
We'll now clean up DAP locators for unloaded extensions and load schemas proper I can now load a custom Ruby extensions with all bells and whistles and use it as my debugger. Release Notes: - N/A
This commit is contained in:
parent
d92d52b508
commit
0e794fa0ac
14 changed files with 262 additions and 45 deletions
|
@ -26,11 +26,13 @@ impl ExtensionDapAdapter {
|
|||
pub(crate) fn new(
|
||||
extension: Arc<dyn extension::Extension>,
|
||||
debug_adapter_name: Arc<str>,
|
||||
schema_path: &Path,
|
||||
) -> Result<Self> {
|
||||
let schema = std::fs::read_to_string(extension.path_from_extension(
|
||||
&Path::new("debug_adapter_schemas").join(debug_adapter_name.as_ref()),
|
||||
))
|
||||
.with_context(|| format!("Failed to read debug adapter schema for {debug_adapter_name}"))?;
|
||||
let schema = std::fs::read_to_string(&schema_path).with_context(|| {
|
||||
format!(
|
||||
"Failed to read debug adapter schema for {debug_adapter_name} (from path: `{schema_path:?}`)"
|
||||
)
|
||||
})?;
|
||||
let schema = serde_json::Value::from_str(&schema).with_context(|| {
|
||||
format!("Debug adapter schema for {debug_adapter_name} is not a valid JSON")
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue