python: Do not look up venv path from source file path (#29676)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-04-30 16:54:08 +02:00 committed by GitHub
parent 128b7d2245
commit 5589e78a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,14 +318,19 @@ impl LocalToolchainStore {
cx: &App,
) -> Task<Option<ToolchainList>> {
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;