python: Init venv/virtualenv activation scripts during list/resolve (#40816)

This means that existence of activation scripts for venv/virtualenv will
be checked locally either on the host if editing locally, or the remote
by the remote proxy if editing a remote project.

Closes https://github.com/zed-industries/zed/issues/40263

Release Notes:

- N/A
This commit is contained in:
Jakub Konka
2025-10-21 22:57:31 +02:00
committed by GitHub
parent fd10017837
commit e49edfac74
8 changed files with 131 additions and 72 deletions
+4 -6
View File
@@ -98,6 +98,7 @@ pub trait ToolchainLister: Send + Sync + 'static {
worktree_root: PathBuf,
subroot_relative_path: Arc<RelPath>,
project_env: Option<HashMap<String, String>>,
fs: &dyn Fs,
) -> ToolchainList;
/// Given a user-created toolchain, resolve lister-specific details.
@@ -106,14 +107,11 @@ pub trait ToolchainLister: Send + Sync + 'static {
&self,
path: PathBuf,
project_env: Option<HashMap<String, String>>,
fs: &dyn Fs,
) -> anyhow::Result<Toolchain>;
async fn activation_script(
&self,
toolchain: &Toolchain,
shell: ShellKind,
fs: &dyn Fs,
) -> Vec<String>;
fn activation_script(&self, toolchain: &Toolchain, shell: ShellKind) -> Vec<String>;
/// Returns various "static" bits of information about this toolchain lister. This function should be pure.
fn meta(&self) -> ToolchainMetadata;
}