Remove workspace::Item trait

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-03-16 13:34:04 -07:00
parent e8efaed1b2
commit a88320dc5f
10 changed files with 281 additions and 517 deletions

View file

@ -1,3 +1,5 @@
use crate::ProjectEntry;
use super::{
fs::{self, Fs},
ignore::IgnoreStack,
@ -1502,6 +1504,13 @@ impl File {
pub fn worktree_id(&self, cx: &AppContext) -> WorktreeId {
self.worktree.read(cx).id()
}
pub fn project_entry(&self, cx: &AppContext) -> Option<ProjectEntry> {
self.entry_id.map(|entry_id| ProjectEntry {
worktree_id: self.worktree_id(cx),
entry_id,
})
}
}
#[derive(Clone, Debug, PartialEq, Eq)]