Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Enable terminal activation for uv-managed environments (#45949)
Xin Zhao8813abed0042
diff --git a/crates/languages/src/python.rs b/crates/languages/src/python.rsindex 23a067a6230..bb257210be3 100644--- a/crates/languages/src/python.rs+++ b/crates/languages/src/python.rs@@ -1358,7 +1358,12 @@ impl ToolchainLister for PythonToolchainProvider {activation_script.push(format!("{manager} activate base"));}}- Some(PythonEnvironmentKind::Venv | PythonEnvironmentKind::VirtualEnv) => {+ Some(+ PythonEnvironmentKind::Venv+ | PythonEnvironmentKind::VirtualEnv+ | PythonEnvironmentKind::Uv+ | PythonEnvironmentKind::UvWorkspace,+ ) => {if let Some(activation_scripts) = &toolchain.activation_scripts {if let Some(activate_script_path) = activation_scripts.get(&shell) {let activate_keyword = shell.activate_keyword();@@ -1415,9 +1420,12 @@ async fn venv_to_toolchain(venv: PythonEnvironment, fs: &dyn Fs) -> Option<Toolclet mut activation_scripts = HashMap::default();match venv.kind {- Some(PythonEnvironmentKind::Venv | PythonEnvironmentKind::VirtualEnv) => {- resolve_venv_activation_scripts(&venv, fs, &mut activation_scripts).await- }+ Some(+ PythonEnvironmentKind::Venv+ | PythonEnvironmentKind::VirtualEnv+ | PythonEnvironmentKind::Uv+ | PythonEnvironmentKind::UvWorkspace,+ ) => resolve_venv_activation_scripts(&venv, fs, &mut activation_scripts).await,_ => {}}let data = PythonToolchainData {