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:
parent
e8efaed1b2
commit
a88320dc5f
10 changed files with 281 additions and 517 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue