Add language toolchains (#19576)

This PR adds support for selecting toolchains for a given language (e.g.
Rust toolchains or Python virtual environments) with support for SSH
projects provided out of the box. For Python we piggy-back off of
[PET](https://github.com/microsoft/python-environment-tools), a library
maintained by Microsoft.
Closes #16421
Closes #7646

Release Notes:

- Added toolchain selector to the status bar (with initial support for
Python virtual environments)
This commit is contained in:
Piotr Osiewicz 2024-10-28 15:34:03 +01:00 committed by GitHub
parent 03bd95405b
commit cdddb4d360
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 2221 additions and 133 deletions

View file

@ -1153,6 +1153,14 @@ impl Workspace {
DB.next_id().await.unwrap_or_else(|_| Default::default())
};
let toolchains = DB.toolchains(workspace_id).await?;
for (toolchain, worktree_id) in toolchains {
project_handle
.update(&mut cx, |this, cx| {
this.activate_toolchain(worktree_id, toolchain, cx)
})?
.await;
}
let window = if let Some(window) = requesting_window {
cx.update_window(window.into(), |_, cx| {
cx.replace_root_view(|cx| {
@ -5522,6 +5530,14 @@ pub fn open_ssh_project(
)
})?;
let toolchains = DB.toolchains(workspace_id).await?;
for (toolchain, worktree_id) in toolchains {
project
.update(&mut cx, |this, cx| {
this.activate_toolchain(worktree_id, toolchain, cx)
})?
.await;
}
let mut project_paths_to_open = vec![];
let mut project_path_errors = vec![];