Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-12-13 16:46:35 +01:00
parent 6645e2820c
commit 85674ba506
11 changed files with 554 additions and 417 deletions

View file

@ -4,10 +4,11 @@ mod worktree;
use anyhow::Result;
use client::{Client, UserStore};
use clock::ReplicaId;
use futures::Future;
use fuzzy::{PathMatch, PathMatchCandidate, PathMatchCandidateSet};
use gpui::{AppContext, Entity, ModelContext, ModelHandle, Task};
use language::LanguageRegistry;
use language::{DiagnosticEntry, LanguageRegistry, PointUtf16};
use std::{
path::Path,
sync::{atomic::AtomicBool, Arc},
@ -62,6 +63,11 @@ impl Project {
}
}
pub fn replica_id(&self, cx: &AppContext) -> ReplicaId {
// TODO
self.worktrees.first().unwrap().read(cx).replica_id()
}
pub fn worktrees(&self) -> &[ModelHandle<Worktree>] {
&self.worktrees
}
@ -159,6 +165,13 @@ impl Project {
}
}
pub fn diagnostics<'a>(
&'a self,
cx: &'a AppContext,
) -> impl Iterator<Item = (&'a Path, &'a [DiagnosticEntry<PointUtf16>])> {
std::iter::empty()
}
pub fn active_entry(&self) -> Option<ProjectEntry> {
self.active_entry
}