Unnamed repository; edit this file 'description' to name the repository.
Extend DebugArgumentValue to support toml tables, ref #14282 (#14283)
Matt 5 months ago
parent 1f020b1 · commit fbf6407
-rw-r--r--helix-core/src/syntax/config.rs1
-rw-r--r--helix-term/src/commands/dap.rs10
2 files changed, 11 insertions, 0 deletions
diff --git a/helix-core/src/syntax/config.rs b/helix-core/src/syntax/config.rs
index 6299ceb2..f9fba3d1 100644
--- a/helix-core/src/syntax/config.rs
+++ b/helix-core/src/syntax/config.rs
@@ -446,6 +446,7 @@ pub enum DebugArgumentValue {
String(String),
Array(Vec<String>),
Boolean(bool),
+ Table(HashMap<String, String>),
}
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index f6f11d12..074bef6d 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -164,6 +164,13 @@ pub fn dap_start_impl(
arr.iter().map(|v| v.replace(&pattern, &param)).collect(),
),
DebugArgumentValue::Boolean(_) => value,
+ DebugArgumentValue::Table(map) => DebugArgumentValue::Table(
+ map.into_iter()
+ .map(|(mk, mv)| {
+ (mk.replace(&pattern, &param), mv.replace(&pattern, &param))
+ })
+ .collect(),
+ ),
};
}
}
@@ -182,6 +189,9 @@ pub fn dap_start_impl(
DebugArgumentValue::Boolean(bool) => {
args.insert(k, to_value(bool).unwrap());
}
+ DebugArgumentValue::Table(map) => {
+ args.insert(k, to_value(map).unwrap());
+ }
}
}