Introduce $ZED_CUSTOM_PYTHON_ACTIVE_ZED_TOOLCHAIN_RAW to work around (#31685)

Follow up to #31674 

Release Notes:

- N/A

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
Piotr Osiewicz 2025-05-29 15:44:55 +02:00 committed by GitHub
parent 703ee29658
commit 83135e98e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 7 deletions

View file

@ -5,7 +5,7 @@ use async_trait::async_trait;
use dap::{DapLocator, DebugRequest, adapters::DebugAdapterName};
use gpui::SharedString;
use task::{DebugScenario, SpawnInTerminal, TaskTemplate};
use task::{DebugScenario, SpawnInTerminal, TaskTemplate, VariableName};
pub(crate) struct PythonLocator;
@ -35,6 +35,13 @@ impl DapLocator for PythonLocator {
// We cannot debug selections.
return None;
}
let command = if build_config.command
== VariableName::Custom("PYTHON_ACTIVE_ZED_TOOLCHAIN".into()).template_value()
{
VariableName::Custom("PYTHON_ACTIVE_ZED_TOOLCHAIN_RAW".into()).template_value()
} else {
build_config.command.clone()
};
let module_specifier_position = build_config
.args
.iter()
@ -68,7 +75,7 @@ impl DapLocator for PythonLocator {
}
let mut config = serde_json::json!({
"request": "launch",
"python": build_config.command,
"python": command,
"args": args,
"cwd": build_config.cwd.clone()
});