zed-industries/zed · error
cannot open file {:?}
Error message
cannot open file {:?} What it means
Returned by Workspace::open_path when no registered build_project_item_for_path handler can open the given ProjectPath — i.e. no editor knows how to handle this file extension/kind. The path that failed is included; opening it is unsupported in this configuration.
Source
Thrown at crates/workspace/src/workspace.rs:1073
fn register<T: ProjectItem>(&mut self) {
self.build_project_item_fns_by_type.insert(
TypeId::of::<T::Item>(),
|item, project, pane, window, cx| {
let item = item.downcast().unwrap();
Box::new(cx.new(|cx| T::for_project_item(project, pane, item, window, cx)))
as Box<dyn ItemHandle>
},
);
self.build_project_item_for_path_fns
.push(|project, project_path, window, cx| {
let project_path = project_path.clone();
let is_file = project
.read(cx)
.entry_for_path(&project_path, cx)
.is_some_and(|entry| entry.is_file());
let entry_abs_path = project.read(cx).absolute_path(&project_path, cx);
let is_local = project.read(cx).is_local();
let project_item =
<T::Item as project::ProjectItem>::try_open(project, &project_path, cx)?;
let project = project.clone();
Some(window.spawn(cx, async move |cx| {
match project_item.await.with_context(|| {
format!(
"opening project path {:?}",
entry_abs_path.as_deref().unwrap_or(&project_path.path.as_std_path())
)
}) {
Ok(project_item) => {
let project_item = project_item;
let project_entry_id: Option<ProjectEntryId> =
project_item.read_with(cx, project::ProjectItem::entry_id);
let build_workspace_item = Box::new(
|pane: &mut Pane, window: &mut Window, cx: &mut Context<Pane>| {
Box::new(cx.new(|cx| {
T::for_project_item(
project,View on GitHub (pinned to 9d272b0363)
Solutions
- Install an extension that handles this file type
- Open the file with the default text editor
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/workspace/src/workspace.rs:937 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/f98ea9758f1154e4.
Report an issue: GitHub.