From e3d3daec925f666f45bc3f469665e46883cfa444 Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Thu, 22 May 2025 20:18:33 +0300 Subject: [PATCH] Fix bug where deleted toolchains stay selected on startup (#30562) This affects python's when debugging because the selected toolchain is used as the python binary to spawn Debugpy Release Notes: - Fix bug where selected toolchain didn't exist --- crates/workspace/src/workspace.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 47d692b3ae..42d0cc4e40 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1369,7 +1369,13 @@ impl Workspace { }; let toolchains = DB.toolchains(workspace_id).await?; + for (toolchain, worktree_id, path) in toolchains { + let toolchain_path = PathBuf::from(toolchain.path.clone().to_string()); + if !app_state.fs.is_file(toolchain_path.as_path()).await { + continue; + } + project_handle .update(cx, |this, cx| { this.activate_toolchain(ProjectPath { worktree_id, path }, toolchain, cx)