parent
43e13df9f3
commit
86efde4b76
4 changed files with 109 additions and 42 deletions
|
@ -373,6 +373,7 @@ pub trait ItemHandle: 'static + Send {
|
|||
fn dragged_tab_content(&self, params: TabContentParams, cx: &WindowContext) -> AnyElement;
|
||||
fn project_path(&self, cx: &AppContext) -> Option<ProjectPath>;
|
||||
fn project_entry_ids(&self, cx: &AppContext) -> SmallVec<[ProjectEntryId; 3]>;
|
||||
fn project_paths(&self, cx: &AppContext) -> SmallVec<[ProjectPath; 3]>;
|
||||
fn project_item_model_ids(&self, cx: &AppContext) -> SmallVec<[EntityId; 3]>;
|
||||
fn for_each_project_item(
|
||||
&self,
|
||||
|
@ -531,6 +532,16 @@ impl<T: Item> ItemHandle for View<T> {
|
|||
result
|
||||
}
|
||||
|
||||
fn project_paths(&self, cx: &AppContext) -> SmallVec<[ProjectPath; 3]> {
|
||||
let mut result = SmallVec::new();
|
||||
self.read(cx).for_each_project_item(cx, &mut |_, item| {
|
||||
if let Some(id) = item.project_path(cx) {
|
||||
result.push(id);
|
||||
}
|
||||
});
|
||||
result
|
||||
}
|
||||
|
||||
fn project_item_model_ids(&self, cx: &AppContext) -> SmallVec<[EntityId; 3]> {
|
||||
let mut result = SmallVec::new();
|
||||
self.read(cx).for_each_project_item(cx, &mut |id, _| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue