zed-industries/zed · error
invalid symbol path
Error message
invalid symbol path
What it means
A symbol whose location is inside the project references a worktree that can no longer be resolved (absolutize failed with 'no such worktree'), so its absolute path cannot be computed; the outer error surfaces as 'invalid symbol path'.
Source
Thrown at crates/project/src/lsp_store.rs:10161
let abs_path = &update.diagnostics.document_abs_path;
let server_id = update.server_id;
let Some((worktree, relative_path)) =
self.worktree_store.read(cx).find_worktree(abs_path, cx)
else {
log::warn!("skipping diagnostics update, no worktree found for path {abs_path:?}");
continue;
};
let worktree_id = worktree.read(cx).id();
let project_path = ProjectPath {
worktree_id,
path: relative_path,
};
let document_uri = lsp::Uri::from_file_path(abs_path)
.map_err(|()| anyhow!("Failed to convert buffer path {abs_path:?} to lsp Uri"))?;
if let Some(buffer_handle) = self.buffer_store.read(cx).get_by_path(&project_path) {
let snapshot = buffer_handle.read(cx).snapshot();
let buffer = buffer_handle.read(cx);
let reused_diagnostics = buffer
.buffer_diagnostics(Some(server_id))
.iter()
.filter(|v| merge(&document_uri, &v.diagnostic, cx))
.map(|v| {
(*v).clone().map_coordinates(|range| {
Unclipped(range.start.to_point_utf16(&snapshot))
..Unclipped(range.end.to_point_utf16(&snapshot))
})
})
.collect::<Vec<_>>();
self.as_local_mut()
.context("cannot merge diagnostics on a remote LspStore")?
.update_buffer_diagnostics(
&buffer_handle,
server_id,View on GitHub (pinned to 9d272b0363)
Solutions
- Ensure the worktree containing the symbol is still open in the project
- Re-index/re-run the symbol search so stale symbol paths are refreshed
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/project/src/lsp_store.rs:9442 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/8f47c12b65465997.
Report an issue: GitHub.