{"record":{"id":"fee296fe7980cc9a","repo":"zed-industries/zed","slug":"buffer-has-no-file","errorCode":null,"errorMessage":"buffer has no file","messagePattern":"buffer has no file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":2157,"sourceCode":"                            project_id: project_id.to_proto(),\n                            buffer_id: buffer_id.into(),\n                            version: serialize_version(&version),\n                        })\n                        .await?;\n                    Ok(deserialize_blame_buffer_response(response))\n                }\n            }\n        })\n    }\n\n    pub fn get_permalink_to_line(\n        &self,\n        buffer: &Entity<Buffer>,\n        selection: Range<u32>,\n        cx: &mut App,\n    ) -> Task<Result<url::Url>> {\n        let Some(file) = File::from_dyn(buffer.read(cx).file()) else {\n            return Task::ready(Err(anyhow!(\"buffer has no file\")));\n        };\n\n        let Some((repo, repo_path)) = self.repository_and_path_for_project_path(\n            &(file.worktree.read(cx).id(), file.path.clone()).into(),\n            cx,\n        ) else {\n            // If we're not in a Git repo, check whether this is a Rust source\n            // file in the Cargo registry (presumably opened with go-to-definition\n            // from a normal Rust file). If so, we can put together a permalink\n            // using crate metadata.\n            if buffer\n                .read(cx)\n                .language()\n                .is_none_or(|lang| lang.name() != \"Rust\")\n            {\n                return Task::ready(Err(anyhow!(\"no permalink available\")));\n            }\n            let file_path = file.worktree.read(cx).absolutize(&file.path);","sourceCodeStart":2139,"sourceCodeEnd":2175,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/project/src/git_store.rs#L2139-L2175","documentation":"get_permalink_to_line requires a file-backed buffer, but File::from_dyn on the buffer's file returned None (untitled buffer or non-local file), so there is no repository path from which to build a permalink.","triggerScenarios":"Thrown at crates/project/src/git_store.rs:2157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Save the buffer to a file inside a git worktree and retry","Disable permalink/copy-permalink UI actions for buffers without a local file"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}