Follow up to #31674 Release Notes: - N/A
Showing the changes to crates/languages/src/python.rs (1 of 2 files). Show all
Unified · Split
| @@ -357,6 +357,9 @@ const PYTHON_TEST_TARGET_TASK_VARIABLE: VariableName = · 356 unmodified lines | ||
| 357 | 357 | const PYTHON_ACTIVE_TOOLCHAIN_PATH: VariableName = |
| 358 | 358 | VariableName::Custom(Cow::Borrowed("PYTHON_ACTIVE_ZED_TOOLCHAIN")); |
| 359 | 359 | |
| 360 | +const PYTHON_ACTIVE_TOOLCHAIN_PATH_RAW: VariableName = | |
| 361 | + VariableName::Custom(Cow::Borrowed("PYTHON_ACTIVE_ZED_TOOLCHAIN_RAW")); | |
| 362 | + | |
| 360 | 363 | const PYTHON_MODULE_NAME_TASK_VARIABLE: VariableName = |
| 361 | 364 | VariableName::Custom(Cow::Borrowed("PYTHON_MODULE_NAME")); |
| 362 | 365 | |
| @@ -378,24 +381,25 @@ impl ContextProvider for PythonContextProvider { · 15 unmodified lines | ||
| 378 | 381 | let worktree_id = location.buffer.read(cx).file().map(|f| f.worktree_id(cx)); |
| 379 | 382 | |
| 380 | 383 | cx.spawn(async move |cx| { |
| 381 | − let active_toolchain = if let Some(worktree_id) = worktree_id { | |
| 384 | + let raw_toolchain = if let Some(worktree_id) = worktree_id { | |
| 382 | 385 | toolchains |
| 383 | 386 | .active_toolchain(worktree_id, Arc::from("".as_ref()), "Python".into(), cx) |
| 384 | 387 | .await |
| 385 | 388 | .map_or_else( |
| 386 | − || "python3".to_owned(), | |
| 387 | − |toolchain| format!("\"{}\"", toolchain.path), | |
| 389 | + || String::from("python3"), | |
| 390 | + |toolchain| toolchain.path.to_string(), | |
| 388 | 391 | ) |
| 389 | 392 | } else { |
| 390 | 393 | String::from("python3") |
| 391 | 394 | }; |
| 395 | + let active_toolchain = format!("\"{raw_toolchain}\""); | |
| 392 | 396 | let toolchain = (PYTHON_ACTIVE_TOOLCHAIN_PATH, active_toolchain); |
| 393 | − | |
| 397 | + let raw_toolchain = (PYTHON_ACTIVE_TOOLCHAIN_PATH_RAW, raw_toolchain); | |
| 394 | 398 | Ok(task::TaskVariables::from_iter( |
| 395 | 399 | test_target |
| 396 | 400 | .into_iter() |
| 397 | 401 | .chain(module_target.into_iter()) |
| 398 | − .chain([toolchain]), | |
| 402 | + .chain([toolchain, raw_toolchain]), | |
| 399 | 403 | )) |
| 400 | 404 | }) |
| 401 | 405 | } |