mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Log project path that was no open due to no project entry found
This commit is contained in:
parent
aa3c9b8568
commit
45230dcaf3
@ -1661,14 +1661,15 @@ impl Project {
|
||||
path: impl Into<ProjectPath>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<(ProjectEntryId, AnyModelHandle)>> {
|
||||
let task = self.open_buffer(path, cx);
|
||||
let project_path = path.into();
|
||||
let task = self.open_buffer(project_path.clone(), cx);
|
||||
cx.spawn_weak(|_, cx| async move {
|
||||
let buffer = task.await?;
|
||||
let project_entry_id = buffer
|
||||
.read_with(&cx, |buffer, cx| {
|
||||
File::from_dyn(buffer.file()).and_then(|file| file.project_entry_id(cx))
|
||||
})
|
||||
.ok_or_else(|| anyhow!("no project entry"))?;
|
||||
.with_context(|| format!("no project entry for {project_path:?}"))?;
|
||||
|
||||
let buffer: &AnyModelHandle = &buffer;
|
||||
Ok((project_entry_id, buffer.clone()))
|
||||
|
@ -1691,14 +1691,15 @@ impl Project {
|
||||
path: impl Into<ProjectPath>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<(ProjectEntryId, AnyModel)>> {
|
||||
let task = self.open_buffer(path, cx);
|
||||
let project_path = path.into();
|
||||
let task = self.open_buffer(project_path.clone(), cx);
|
||||
cx.spawn(move |_, mut cx| async move {
|
||||
let buffer = task.await?;
|
||||
let project_entry_id = buffer
|
||||
.update(&mut cx, |buffer, cx| {
|
||||
File::from_dyn(buffer.file()).and_then(|file| file.project_entry_id(cx))
|
||||
})?
|
||||
.ok_or_else(|| anyhow!("no project entry"))?;
|
||||
.with_context(|| format!("no project entry for {project_path:?}"))?;
|
||||
|
||||
let buffer: &AnyModel = &buffer;
|
||||
Ok((project_entry_id, buffer.clone()))
|
||||
|
Loading…
Reference in New Issue
Block a user