zed-industries/zed · error
project path not found for edit prediction target
Error message
project path not found for edit prediction target {path:?} What it means
While opening an editor at an edit-prediction anchor, the buffer's file full_path could not be mapped to a project path via workspace.project().find_project_path. This means the buffer containing the suggestion belongs to a file that no open project tracks (untitled buffer, file outside all worktrees), so no project-scoped editor can be opened at the target.
Solutions
- Open a plain editor for the buffer's path without project association instead of failing
- Surface a non-blocking notice to the user that the file is not part of an open project
- Guard before spawning the task: skip anchor navigation when snapshot.file() has no project path
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/editor/src/edit_prediction.rs:1662 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-08-20).
Data as JSON: /api/errors/21a5858085c52a86.
Report an issue: GitHub.
Appendix: source
Thrown at crates/editor/src/edit_prediction.rs:1665
.extension()?
.to_string_lossy()
.into_owned(),
)
});
let event_type = match accepted {
true => "Edit Prediction Accepted",
false => "Edit Prediction Discarded",
};
telemetry::event!(
event_type,
provider = provider.name(),
prediction_id = id,
suggestion_accepted = accepted,
file_extension = extension,
);
}
fn open_editor_at_anchor(
snapshot: &language::BufferSnapshot,
target: language::Anchor,
workspace: &Entity<Workspace>,
window: &mut Window,
cx: &mut App,
) -> Task<Result<()>> {
workspace.update(cx, |workspace, cx| {
let path = snapshot.file().map(|file| file.full_path(cx));
let Some(project_path) = path
.as_ref()
.and_then(|path| workspace.project().read(cx).find_project_path(path, cx))
else {
return Task::ready(Err(anyhow::anyhow!(
"project path not found for edit prediction target {path:?}"
)));
};
let target = text::ToPoint::to_point(&target, snapshot);View on GitHub (pinned to 916fc2b8cb)