Start on a DiagnosticProvider
implementation for Rust
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
393009a05c
commit
a85e400b35
6 changed files with 138 additions and 10 deletions
|
@ -805,10 +805,13 @@ impl Buffer {
|
|||
}
|
||||
}
|
||||
|
||||
let start_overshoot = start - last_edit_old_end;
|
||||
start = last_edit_new_end;
|
||||
start.add_assign(&(start - last_edit_old_end));
|
||||
start.add_assign(&start_overshoot);
|
||||
|
||||
let end_overshoot = end - last_edit_old_end;
|
||||
end = last_edit_new_end;
|
||||
end.add_assign(&(end - last_edit_old_end));
|
||||
end.add_assign(&end_overshoot);
|
||||
}
|
||||
|
||||
let range = start.clip(Bias::Left, content)..end.clip(Bias::Right, content);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue