{"record":{"id":"2703e7c6820f9d23","repo":"zed-industries/zed","slug":"editor-does-not-have-project","errorCode":null,"errorMessage":"editor does not have project","messagePattern":"editor does not have project","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/editor/src/git.rs","lineNumber":2926,"sourceCode":"            let Some(buffer_diff) = multi_buffer.diff_for(buffer_snapshot.remote_id()) else {\n                return Some((buffer, buffer_range.start.row..buffer_range.end.row));\n            };\n\n            let buffer_diff_snapshot = buffer_diff.read(cx).snapshot(cx);\n            let start = buffer_diff_snapshot\n                .buffer_point_to_base_text_point(buffer_range.start, &buffer_snapshot);\n            let end = buffer_diff_snapshot\n                .buffer_point_to_base_text_point(buffer_range.end, &buffer_snapshot);\n\n            Some((buffer, start.row..end.row))\n        });\n\n        let Some((buffer, selection)) = buffer_and_selection else {\n            return Task::ready(Err(anyhow!(\"failed to determine buffer and selection\")));\n        };\n\n        let Some(project) = self.project() else {\n            return Task::ready(Err(anyhow!(\"editor does not have project\")));\n        };\n\n        project.update(cx, |project, cx| {\n            project.get_permalink_to_line(&buffer, selection, cx)\n        })\n    }\n}\n\n#[cfg(test)]\nimpl Editor {\n    /// Returns the line range for the first diff review overlay, if one is active.\n    /// Returns (start_row, end_row) as physical line numbers in the underlying file.\n    pub(super) fn diff_review_line_range(&self, cx: &App) -> Option<(u32, u32)> {\n        let overlay = self.diff_review_overlays.first()?;\n        let snapshot = self.buffer.read(cx).snapshot(cx);\n        let start_point = overlay.anchor_range.start.to_point(&snapshot);\n        let end_point = overlay.anchor_range.end.to_point(&snapshot);\n        let start_row = snapshot","sourceCodeStart":2908,"sourceCodeEnd":2944,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/editor/src/git.rs#L2908-L2944","documentation":"The editor performing a git operation has no associated project entity. The surrounding code needs workspace.project() to look up diffs/baselines; this guard fires when the editor was created detached from any workspace project, so the git interaction cannot proceed.","triggerScenarios":"Thrown at crates/editor/src/git.rs:2926 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No-op the git action when the editor has no project — there is nothing to diff against","Ensure editors are constructed within a workspace so the project handle is always available","Fall back to a shell git invocation in the file's directory if a project is genuinely absent"],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}