toolchains: Add support for relative paths (#27777)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 19:48:09 +02:00 committed by GitHub
parent 627ae7af6f
commit edf712d45b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 178 additions and 93 deletions

View file

@ -1,5 +1,5 @@
mod native_kernel;
use std::{fmt::Debug, future::Future, path::PathBuf};
use std::{fmt::Debug, future::Future, path::PathBuf, sync::Arc};
use futures::{
channel::mpsc::{self, Receiver},
@ -11,7 +11,7 @@ use language::LanguageName;
pub use native_kernel::*;
mod remote_kernels;
use project::{Project, WorktreeId};
use project::{Project, ProjectPath, WorktreeId};
pub use remote_kernels::*;
use anyhow::Result;
@ -81,9 +81,14 @@ pub fn python_env_kernel_specifications(
cx: &mut App,
) -> impl Future<Output = Result<Vec<KernelSpecification>>> {
let python_language = LanguageName::new("Python");
let toolchains = project
.read(cx)
.available_toolchains(worktree_id, python_language, cx);
let toolchains = project.read(cx).available_toolchains(
ProjectPath {
worktree_id,
path: Arc::from("".as_ref()),
},
python_language,
cx,
);
let background_executor = cx.background_executor().clone();
async move {