zed-industries/zed · error
No worktree for entry
Error message
No worktree for entry {entry_id:?} What it means
In Project::rename_entry: worktree_and_entry_for_id found no worktree containing the given ProjectEntryId, so the entry cannot be renamed. The entry was likely deleted or its worktree closed before the rename ran.
Solutions
- Refresh the project panel and retry the rename
- Verify the file still exists in an open worktree
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/project/src/project.rs:2642 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/4a476961b1d17eb0.
Report an issue: GitHub.
Appendix: source
Thrown at crates/project/src/project.rs:2655
) -> Task<Result<Option<Entry>>> {
self.worktree_store.update(cx, |worktree_store, cx| {
worktree_store.copy_entry(entry_id, new_project_path, cx)
})
}
/// Renames the project entry with given `entry_id`.
///
/// `new_path` is a relative path to worktree root.
/// If root entry is renamed then its new root name is used instead.
pub fn rename_entry(
&mut self,
entry_id: ProjectEntryId,
new_path: ProjectPath,
cx: &mut Context<Self>,
) -> Task<Result<CreatedEntry>> {
let worktree_store = self.worktree_store.clone();
let Some((worktree, old_path, is_dir)) = worktree_store
.read(cx)
.worktree_and_entry_for_id(entry_id, cx)
.map(|(worktree, entry)| (worktree, entry.path.clone(), entry.is_dir()))
else {
return Task::ready(Err(anyhow!(format!("No worktree for entry {entry_id:?}"))));
};
let worktree_id = worktree.read(cx).id();
let is_root_entry = self.entry_is_worktree_root(entry_id, cx);
let lsp_store = self.lsp_store().downgrade();
cx.spawn(async move |project, cx| {
let (old_abs_path, new_abs_path) = {
let root_path = worktree.read_with(cx, |this, _| this.abs_path());
let new_abs_path = if is_root_entry {
root_path
.parent()
.unwrap()
.join(new_path.path.as_std_path())View on GitHub (pinned to 9d272b0363)