editor: Add access method for project (#36266)

This resolves a `TODO` that I've stumbled upon too many times whilst
looking at the editor code.

Release Notes:

- N/A
This commit is contained in:
Finn Evers 2025-08-15 20:34:22 +02:00 committed by GitHub
parent bd1fda6782
commit 3c5d5a1d57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 42 additions and 45 deletions

View file

@ -678,7 +678,7 @@ impl Item for Editor {
let buffer = buffer.read(cx);
let path = buffer.project_path(cx)?;
let buffer_id = buffer.remote_id();
let project = self.project.as_ref()?.read(cx);
let project = self.project()?.read(cx);
let entry = project.entry_for_path(&path, cx)?;
let (repo, repo_path) = project
.git_store()