zed-industries/zed · error
no permalink available
Error message
no permalink available
What it means
Neither a git repo nor any known permalink provider matched the buffer's file, so no URL can be constructed for the selected lines. The file is not in a repository and not a Cargo-registry source that would have an alternative permalink scheme.
Source
Thrown at crates/project/src/git_store.rs:2173
) -> Task<Result<url::Url>> {
let Some(file) = File::from_dyn(buffer.read(cx).file()) else {
return Task::ready(Err(anyhow!("buffer has no file")));
};
let Some((repo, repo_path)) = self.repository_and_path_for_project_path(
&(file.worktree.read(cx).id(), file.path.clone()).into(),
cx,
) else {
// If we're not in a Git repo, check whether this is a Rust source
// file in the Cargo registry (presumably opened with go-to-definition
// from a normal Rust file). If so, we can put together a permalink
// using crate metadata.
if buffer
.read(cx)
.language()
.is_none_or(|lang| lang.name() != "Rust")
{
return Task::ready(Err(anyhow!("no permalink available")));
}
let file_path = file.worktree.read(cx).absolutize(&file.path);
return cx.spawn(async move |cx| {
let provider_registry = cx.update(GitHostingProviderRegistry::default_global);
get_permalink_in_rust_registry_src(provider_registry, file_path, selection)
.context("no permalink available")
});
};
let buffer_id = buffer.read(cx).remote_id();
let branch = repo.read(cx).branch.clone();
let remote = branch
.as_ref()
.and_then(|b| b.upstream.as_ref())
.and_then(|b| b.remote_name())
.unwrap_or("origin")
.to_string();
View on GitHub (pinned to f4178619ac)
Solutions
- Open the file from within its git repository so a remote permalink can be built
- For dependency sources, use go-to-definition from a project file so registry-path detection applies
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/project/src/git_store.rs:2173 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/91d41aaabf4238be.
Report an issue: GitHub.