debugger: Add locator for Python tasks (#31533)

Closes #ISSUE

Release Notes:

- debugger: Python tests/main functions can now we debugged from the
gutter.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Piotr Osiewicz
2025-05-28 12:27:12 +02:00
committed by GitHub
co-authored by Kirill Bulatov
parent 15d59fcda9
commit c0a5ace8b8
6 changed files with 118 additions and 3 deletions
-1
View File
@@ -295,7 +295,6 @@ impl DebugPanel {
})
})?
.await?;
dap_store
.update(cx, |dap_store, cx| {
dap_store.boot_session(session.clone(), definition, cx)
@@ -547,6 +547,10 @@ impl RunningState {
.for_each(|value| Self::substitute_variables_in_config(value, context));
}
serde_json::Value::String(s) => {
// Some built-in zed tasks wrap their arguments in quotes as they might contain spaces.
if s.starts_with("\"$ZED_") && s.ends_with('"') {
*s = s[1..s.len() - 1].to_string();
}
if let Some(substituted) = substitute_variables_in_str(&s, context) {
*s = substituted;
}
@@ -571,6 +575,10 @@ impl RunningState {
.for_each(|value| Self::relativlize_paths(None, value, context));
}
serde_json::Value::String(s) if key == Some("program") || key == Some("cwd") => {
// Some built-in zed tasks wrap their arguments in quotes as they might contain spaces.
if s.starts_with("\"$ZED_") && s.ends_with('"') {
*s = s[1..s.len() - 1].to_string();
}
resolve_path(s);
if let Some(substituted) = substitute_variables_in_str(&s, context) {