Start on a DiagnosticProvider implementation for Rust

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-12-24 16:22:22 +01:00
parent 393009a05c
commit a85e400b35
6 changed files with 138 additions and 10 deletions

View file

@ -9,18 +9,14 @@ use anyhow::{anyhow, Result};
use async_trait::async_trait;
pub use buffer::Operation;
pub use buffer::*;
use collections::HashSet;
use collections::{HashMap, HashSet};
pub use diagnostic_set::DiagnosticEntry;
use gpui::AppContext;
use highlight_map::HighlightMap;
use lazy_static::lazy_static;
use parking_lot::Mutex;
use serde::Deserialize;
use std::{
path::{Path, PathBuf},
str,
sync::Arc,
};
use std::{path::Path, str, sync::Arc};
use theme::SyntaxTheme;
use tree_sitter::{self, Query};
pub use tree_sitter::{Parser, Tree};
@ -69,7 +65,7 @@ pub trait DiagnosticProvider: 'static + Send + Sync {
async fn diagnose(
&self,
path: Arc<Path>,
) -> Result<Vec<(PathBuf, Vec<DiagnosticEntry<usize>>)>>;
) -> Result<HashMap<Arc<Path>, Vec<DiagnosticEntry<usize>>>>;
}
pub struct Language {