Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix bug where deleted toolchains stay selected on startup (#30562)

Anthony Eide3d3daec925f
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 47d692b3aea..42d0cc4e40a 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)