zed-industries/zed · error

cannot list directory in remote project

Error message

cannot list directory in remote project

What it means

Raised when listing a directory: the project is remote, and listing arbitrary directories outside worktrees is only supported locally (or via a dedicated remote path); the request as issued cannot be served in the remote project context.

Source

Thrown at crates/project/src/project.rs:5064

        cx.spawn(async move |_, cx| {
            if let Some(buffer_worktree_id) = buffer_worktree_id
                && let Some((worktree, _)) = worktrees_with_ids
                    .iter()
                    .find(|(_, id)| *id == buffer_worktree_id)
            {
                for candidate in candidates.iter() {
                    if let Some(path) = Self::resolve_path_in_worktree(worktree, candidate, cx) {
                        return Some(path);
                    }
                }
            }
            for (worktree, id) in worktrees_with_ids {
                if Some(id) == buffer_worktree_id {
                    continue;
                }
                for candidate in candidates.iter() {
                    if let Some(path) = Self::resolve_path_in_worktree(&worktree, candidate, cx) {
                        return Some(path);
                    }
                }
            }
            None
        })
    }

    fn resolve_path_in_worktree(
        worktree: &Entity<Worktree>,
        path: &RelPath,
        cx: &mut AsyncApp,
    ) -> Option<ResolvedPath> {
        worktree.read_with(cx, |worktree, _| {
            worktree.entry_for_path(path).map(|entry| {
                let project_path = ProjectPath {
                    worktree_id: worktree.id(),
                    path: entry.path.clone(),

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Use the local worktree/fs API for listing directories
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/project/src/project.rs:5009 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/82336c44c6660065. Report an issue: GitHub.