Skip to content

Commit fbf6407

Browse files
authored
Extend DebugArgumentValue to support toml tables, ref #14282 (#14283)
1 parent 1f020b1 commit fbf6407

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

helix-core/src/syntax/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ pub enum DebugArgumentValue {
446446
String(String),
447447
Array(Vec<String>),
448448
Boolean(bool),
449+
Table(HashMap<String, String>),
449450
}
450451

451452
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]

helix-term/src/commands/dap.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ pub fn dap_start_impl(
164164
arr.iter().map(|v| v.replace(&pattern, &param)).collect(),
165165
),
166166
DebugArgumentValue::Boolean(_) => value,
167+
DebugArgumentValue::Table(map) => DebugArgumentValue::Table(
168+
map.into_iter()
169+
.map(|(mk, mv)| {
170+
(mk.replace(&pattern, &param), mv.replace(&pattern, &param))
171+
})
172+
.collect(),
173+
),
167174
};
168175
}
169176
}
@@ -182,6 +189,9 @@ pub fn dap_start_impl(
182189
DebugArgumentValue::Boolean(bool) => {
183190
args.insert(k, to_value(bool).unwrap());
184191
}
192+
DebugArgumentValue::Table(map) => {
193+
args.insert(k, to_value(map).unwrap());
194+
}
185195
}
186196
}
187197

0 commit comments

Comments
 (0)