Replace project_path
with project_entry
in workspace::{Item, ItemView}
This commit is contained in:
parent
18f1040c85
commit
9c9a09cccb
7 changed files with 122 additions and 64 deletions
|
@ -567,6 +567,14 @@ impl Project {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn path_for_entry(&self, entry: ProjectEntry, cx: &AppContext) -> Option<ProjectPath> {
|
||||
let worktree = self.worktree_for_id(entry.worktree_id, cx)?.read(cx);
|
||||
Some(ProjectPath {
|
||||
worktree_id: entry.worktree_id,
|
||||
path: worktree.entry_for_id(entry.entry_id)?.path.clone(),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_running_disk_based_diagnostics(&self) -> bool {
|
||||
self.pending_disk_based_diagnostics > 0
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use super::{
|
||||
fs::{self, Fs},
|
||||
ignore::IgnoreStack,
|
||||
DiagnosticSummary,
|
||||
DiagnosticSummary, ProjectEntry,
|
||||
};
|
||||
use ::ignore::gitignore::{Gitignore, GitignoreBuilder};
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
|
@ -2372,6 +2372,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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue