From 5589e78a698df847c433f88457a42cefeacbbd2f Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 30 Apr 2025 16:54:08 +0200 Subject: [PATCH] python: Do not look up venv path from source file path (#29676) Closes #ISSUE Release Notes: - N/A --- crates/project/src/toolchain_store.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/project/src/toolchain_store.rs b/crates/project/src/toolchain_store.rs index 77889bef9fb06b1a48650adc009afad25190ab2a..f758bd0d88eb569412775f5cc24365a12b5b4540 100644 --- a/crates/project/src/toolchain_store.rs +++ b/crates/project/src/toolchain_store.rs @@ -318,14 +318,19 @@ impl LocalToolchainStore { cx: &App, ) -> Task> { let registry = self.languages.clone(); - let Some(abs_path) = self.worktree_store.read(cx).absolutize(&path, cx) else { + let Some(abs_path) = self + .worktree_store + .read(cx) + .worktree_for_id(path.worktree_id, cx) + .map(|worktree| worktree.read(cx).abs_path()) + else { return Task::ready(None); }; let environment = self.project_environment.clone(); cx.spawn(async move |cx| { let project_env = environment .update(cx, |environment, cx| { - environment.get_directory_environment(abs_path.as_path().into(), cx) + environment.get_directory_environment(abs_path.clone(), cx) }) .ok()? .await;