Get things compiling with diagnostics on worktree

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2021-12-13 11:15:03 -08:00
parent 85674ba506
commit 418a9a3d66
6 changed files with 264 additions and 263 deletions

View file

@ -8,7 +8,7 @@ use clock::ReplicaId;
use futures::Future;
use fuzzy::{PathMatch, PathMatchCandidate, PathMatchCandidateSet};
use gpui::{AppContext, Entity, ModelContext, ModelHandle, Task};
use language::{DiagnosticEntry, LanguageRegistry, PointUtf16};
use language::LanguageRegistry;
use std::{
path::Path,
sync::{atomic::AtomicBool, Arc},
@ -39,6 +39,14 @@ pub struct ProjectPath {
pub path: Arc<Path>,
}
pub struct DiagnosticSummary {
pub project_path: ProjectPath,
pub error_count: usize,
pub warning_count: usize,
pub info_count: usize,
pub hint_count: usize,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct ProjectEntry {
pub worktree_id: usize,
@ -165,10 +173,10 @@ impl Project {
}
}
pub fn diagnostics<'a>(
pub fn diagnostic_summaries<'a>(
&'a self,
cx: &'a AppContext,
) -> impl Iterator<Item = (&'a Path, &'a [DiagnosticEntry<PointUtf16>])> {
) -> impl Iterator<Item = DiagnosticSummary> {
std::iter::empty()
}