Finish implementing ProjectDiagnostics::open_excerpts

* Build workspace item views with a reference to the workspace
* Add randomized test for MultiBuffer::excerpted_buffers and fix a small bug

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-01-07 09:59:27 -08:00
parent e5c520a265
commit ea263822fa
5 changed files with 107 additions and 45 deletions

View file

@ -1,5 +1,5 @@
use super::{ItemViewHandle, SplitDirection};
use crate::{ItemHandle, Settings};
use crate::{ItemHandle, Settings, Workspace};
use gpui::{
action,
elements::*,
@ -90,6 +90,7 @@ impl Pane {
pub fn open_item<T>(
&mut self,
item_handle: T,
workspace: &Workspace,
cx: &mut ViewContext<Self>,
) -> Box<dyn ItemViewHandle>
where
@ -103,7 +104,7 @@ impl Pane {
}
}
let item_view = item_handle.add_view(cx.window_id(), self.settings.clone(), cx);
let item_view = item_handle.add_view(cx.window_id(), workspace, cx);
self.add_item_view(item_view.boxed_clone(), cx);
item_view
}