Add files to project diagnostics view in order

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2022-01-10 16:17:56 -08:00
co-authored by Nathan Sobo
parent c7eb6a6a60
commit 747d9e8784
3 changed files with 27 additions and 26 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ pub enum Event {
DiagnosticsUpdated(ProjectPath),
}
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
#[derive(Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub struct ProjectPath {
pub worktree_id: WorktreeId,
pub path: Arc<Path>,
+2 -2
View File
@@ -57,7 +57,7 @@ enum ScanState {
Err(Arc<anyhow::Error>),
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, PartialOrd, Ord)]
pub struct WorktreeId(usize);
pub enum Worktree {
@@ -711,7 +711,7 @@ impl Worktree {
let mut primary_diagnostic_group_ids = HashMap::default();
let mut sources_by_group_id = HashMap::default();
let mut supporting_diagnostic_severities = HashMap::default();
for diagnostic in &params.diagnostics {
for diagnostic in dbg!(&params.diagnostics) {
let source = diagnostic.source.as_ref();
let code = diagnostic.code.as_ref().map(|code| match code {
lsp::NumberOrString::Number(code) => code.to_string(),